Commit Graph

7343 Commits

Author SHA1 Message Date
xdBronch
e313584a48 more UEFI alignment fixes 2023-07-20 12:46:33 -07:00
Frank Denis
32aeb2c2ec
Be more conservative in the description of Aegis256Mac (#16452)
It is assumed that generating a collision requires more than 2^156
ciphertext modifications. This is plenty enough for any practical
purposes, but it hasn't been proven to be >= 2^256.

Be consistent and conservative here; just claim the same security
as the other variants.
2023-07-19 23:59:24 +00:00
Luuk de Gram
cec1e973b6
Merge pull request #16439 from Luukdegram/wasm-linker
wasm-linker: finish shared-memory & TLS implementation
2023-07-19 21:55:30 +02:00
Luuk de Gram
1a3304ed23
test/link: add shared-memory test for WebAssembly 2023-07-19 17:22:46 +02:00
Andrew Kelley
f3dc53f6b5 compiler: rework inferred error sets
* move inferred error sets into InternPool.
   - they are now represented by pointing directly at the corresponding
     function body value.
 * inferred error set working memory is now in Sema and expires after
   the Sema for the function corresponding to the inferred error set is
   finished having its body analyzed.
 * error sets use a InternPool.Index.Slice rather than an actual slice
   to avoid lifetime issues.
2023-07-18 19:02:05 -07:00
Mathew R Gordon
11695745e5 getenv: remove unnessary small key block
The code removed does unnecessary copying in order to create a null-terminated pointer, just to pass it to libc getenv. It only does this for `small keys`, which are under 64 bytes in size.

Instead of going out of the way to add a null byte to a function that takes normal slices, this should just be handled by the loop below, which scans c.environ to find the value
2023-07-18 11:44:23 +02:00
Frank Denis
a0b35249a2
Replace hand-written endian-specific loads with std.mem.readInt*() (#16431)
And when we have the choice, favor little-endian because it's 2023.

Gives a slight performance improvement:

   md5: 552 -> 555 MiB/s
  sha1: 768 -> 786 MiB/s
sha512: 211 -> 217 MiB/s
2023-07-18 00:40:31 +02:00
Luiz Berti
a86f589a9f
Small documentation fixes on std.crypto (#16427)
* Small documentation fix of ChaCha variants

Previous documentation was seemingly copy-pasted and left
behind some errors where the number of rounds was not
properly updated.

* Suggest `std.crypto.utils.secureZero` on `@memset` docs

* Revert previous change
2023-07-17 21:16:41 +00:00
Mathew R Gordon
bf827d0b55
std: Make getenv return 0-terminated slice 2023-07-17 10:57:41 +00:00
George Zhao
9abe392647
std.crypto: add finalResult and peek api for Sha1 (#16426)
close #16250
2023-07-17 10:02:57 +00:00
Andrew Kelley
a576082170 std: reword some comments 2023-07-16 18:32:52 -07:00
Erik Arvstedt
c6aa29b6fd SinglyLinkedList: rename invert -> reverse 2023-07-15 21:37:54 -07:00
e4m2
3022c525ec
std.crypto.sha3: Minor TurboSHAKE/Keccak fixes (#16408) 2023-07-14 14:02:01 +00:00
xdBronch
b177e17d15 fix alignment error in uefi FileInfo protocol
previously complained about `[*]const u8` having alignment 1 and `[*:0]const u16` having alignment 2
2023-07-14 00:31:31 -07:00
Jakub Konka
546212ff7b
Merge pull request #16398 from ziglang/check-object-elf
std: add ELF parse'n'dump functionality to std.Build.Step.CheckObject
2023-07-14 06:38:33 +02:00
Jakub Konka
77026c67a4 check-object: dump info on PHDRs 2023-07-13 21:27:18 +02:00
Jakub Konka
33154b511c check-object: dump more info on SHDRs 2023-07-13 20:31:19 +02:00
Andrew Kelley
f2d433a193
Merge pull request #15708 from xxxbxxx/build-link
build: avoid repeating objects when linking a static library
2023-07-13 09:48:39 -07:00
Jakub Konka
76dc0d5160 check-object: dump some info on SHDRs 2023-07-13 17:01:26 +02:00
Jakub Konka
0627ca527a elf: add ELF and GNU-specific missing defs 2023-07-13 15:08:01 +02:00
Jakub Konka
4c3625d745 check-object: dump ELF header 2023-07-13 14:33:33 +02:00
Ryan Liptak
2896266a03 docs: Fix outdated doc comments about allocating 'at least' the requested size
The 'at least' behavior of the Allocator interface was removed in #13666, so anything that used reallocAtLeast or the .at_least Exact behavior could still have doc comments that reference no-longer-true behavior.

Funnily enough, ArrayList is the only place that used this functionality (outside of allocator test cases), so its doc comments are the only things that need to be fixed. This was checked by resetting to deda6b5146 and searching for all instances of `reallocAtLeast` and `.at_least` (one of which would need to be used to get the `.at_least` behavior)
2023-07-12 21:54:30 -07:00
antlilja
b463e429b8 Remove len parameter from splat in standard lib 2023-07-12 15:35:57 -07:00
pseudoc
d78517f4f0 feat(list_invert): SinglyLinkedList inversion. 2023-07-13 00:56:28 +03:00
Andrew Kelley
660955c0d6
Merge pull request #15775 from r00ster91/newlines
remove some newlines and other minor cleanups
2023-07-11 23:06:12 -07:00
dweiller
a7707d8279 std.os.sigprocmask: @bitCast flags parameter 2023-07-11 23:03:21 -07:00
Xavier Bouchoux
cea8645423 build: avoid repeating objects when linking a static library
Don't pass the object files from a static library to the linker invocation.
The lib.a file already contains them.

Avoids "duplicate symbol" errors (and useless work by the linker)
2023-07-11 11:46:59 +02:00
Michael Buckley
6bc9c4f716 std.Build: Add methods for creating modules from a TranslateC object. 2023-07-11 01:38:04 -07:00
Niles Salter
e395a08e60
Add more sorting functions to MultiArrayList (#16377) 2023-07-11 06:37:51 +00:00
Meghan
3d5751b579
std.meta: remove isTag (#15584)
This is not used by Zig itself anywhere and not using the function is more idiomatic.
2023-07-10 14:35:36 -04:00
Meghan
cd0594e4a6
std: add mem.SplitIterator.peek() (#15670) 2023-07-10 14:34:39 -04:00
Andrew Kelley
cc56ab8c68
Merge pull request #16100 from squeek502/windows-path-compare
fs.path: Fix Windows path component comparison being ASCII-only
2023-07-10 11:17:07 -07:00
xdBronch
d7c6cfa7fd std.mem.zeroes work with allowzero pointers 2023-07-10 10:52:27 -07:00
Techatrix
3bf0b8eada explicitly specify error set of std.json.stringify 2023-07-10 10:50:57 -07:00
Andrew Kelley
2b8c1f0d46
Merge pull request #16339 from r00ster91/ueficc
std.os.uefi: use std.os.uefi.cc instead of .C as calling convention
2023-07-10 10:41:19 -07:00
Josh Wolfe
874d2dd9f7
std.json: add generic hash map that parses/stringifies with arbitrary string keys (#16366)
* expose innerParseFromValue
2023-07-09 22:18:59 -04:00
Krzysztof Wolicki
a755310734
Changed Step.Run's stdin to accept FileSource (#16358) 2023-07-09 15:51:41 -04:00
Niles Salter
27a66191c2
Change math.Order order (#16356)
This speeds up algorithms like binary search
2023-07-09 01:22:52 -04:00
Garrett
131bfe2f74
std.json: expose innerParse and add .allocate option (#16312) 2023-07-08 22:49:31 -04:00
r00ster91
9be1a3f7ef std.os.uefi: use std.os.uefi.cc instead of .C as calling convention
I tested this and this definitely compiles and these
changes were done programmatically but if there's still anything wrong
it shouldn't be hard to fix.
With this change it's going to be very easy to make further adjustments
to the calling conventions of all these external UEFI functions.

Closes #16309
2023-07-08 17:32:36 -04:00
Techatrix
89396ff02b
add jsonParseFromValue to std.json.Value (#16324) 2023-07-07 23:33:47 -04:00
Nameless
b9fc0d2908
std.http: fix leaked connections (#16341)
The early return in pool release was causing leaked connections.
Closes #16282.
2023-07-07 20:08:19 +00:00
xdBronch
80404cc928 implement std.time.sleep for uefi 2023-07-07 11:57:09 -07:00
dec05eba
2e424e019f Client.zig: support rsa_pss_rsae_sha384 and rsa_pss_rsae_sha512
This fixes HTTP GET to https://www.iana.org/domains/reserved
for example
2023-07-06 18:36:15 -07:00
Jakub Konka
44df3a148b std: add prefixed versions of addFileSource and addDirectorySource to Step.Run 2023-07-06 17:03:28 -07:00
IntegratedQuantum
49ac816e36
Optimize Allocator functions to create less duplicate code for similar types (#16332)
* Move functionality from generic functions that doesn't depend on the type into a function that only depends on comptime alignment.

This reduces comptime code duplication because e.g. `alloc(u32, )` and `alloc(i32, )` now use the same function `allocWithFoo(4, 4, )` under the hood.
2023-07-06 14:41:49 -04:00
Jacob Young
78eb3c5617 bootstrap: support aarch64 in 32-bit mode
* `CMakeLists.txt`: support the weird `uname -m` output.
 * `CMakeLists.txt`: detect and use the C compiler's default arm mode.
 * cbe: support gcc with both `f128` and `u128` emulated.
 * std.os.linux.thumb: fix incorrectly passed asm inputs.
2023-07-04 15:47:07 -07:00
Andrew Kelley
8ae92fd17e std.Build.Step.Compile: fix clearing logic for empty cflags
Commit c0b774fbc6 originally added this
logic but it did not properly clear the C command line flags to empty
when a previous positional argument had command line flags, because it
never set the "previous" flag to true.

This fixes C compiler flags not being reset to empty when using the
build system and a second positional argument has no arguments after a
first positional argument has arguments.

Thanks to @squeek502 for finding this.
2023-07-04 10:53:35 -07:00
Evin Yulo
ba6e5e65a0 json: give enums a default stringify implementation 2023-07-03 20:33:36 -07:00
yujiri8
b26fa4ec4b
add docstring to std.json.stringify (#16241) 2023-07-03 19:26:11 -04:00