And add an assertion to `Sema.pointerDerefExtra` to hopefully catch this
kind of bug a little more easily next time: this bug actually snuck past
our existing assertions in many cases!
Resolves: https://codeberg.org/ziglang/zig/issues/36452
These have no clear use case, no coherent definition, and incomplete/broken
compiler and linker support.
If actually needed, they can be reintroduced if someone can present a reasonable
use case along with a plan for how they should be implemented consistently in
all backends and linkers.
I don't think this technically used to matter for instructions other
than `struct_decl`/`union_decl`/`enum_decl`/`opaque_decl` (which were
already handled correctly), but it now does because of the recent
improvements to DWARF's line number tracking.
Resolves: https://codeberg.org/ziglang/zig/issues/36963
Our "multiple definitions" check in the frontend was a little
overzealous! The only case which should actually be an error is when
there are multiple *strong* definitions.
In the future we will eliminate this frontend check entirely, because
it's redundant with the check the linker will perform---but for now it's
worth keeping since our linkers do not yet print useful source location
information for Zig exports.
Resolves: https://codeberg.org/ziglang/zig/issues/36678
- Add imperative setAll/unsetAll methods to all bitset types.
Previously setAll/unsetAll were declared only for Dynamic.
- Fix a padding bug in Dynamic.setAll the last mask set to all ones.
- Add tests for previously untested setAll, unsetAll
serves an ErrorBundle as a configuration_failed message instead of
configuration message upon connection. at this point the protocol enters
an invalid state and the process will need to be restarted in order to
reconfigure. in the future, build server should outlive
reconfigurations.
closes#36389
in preparation for sending them over the build server protocol (#36403),
they are now stored in the same format in memory: one byte for prefix
followed by the relative path.
The assumption currentPathAlloc was making (that the path can never exceed max_path_bytes) was incorrect.
What exactly that means depends on (1) the system, (2) whether or not libc is linked, and (3) (if libc is linked) the libc implementation of `getcwd`.
The POSIX spec says that ERANGE is returned when the buffer is smaller than necessary.
https://pubs.opengroup.org/onlinepubs/9799919799/
However, on Linux, the getcwd *syscall* is limited by PATH_MAX, so the getcwd syscall will return ENAMETOOLONG if the syscall is unable to provide the full cwd path.
e4b2755318/fs/d_path.c (L406-L407)
That doesn't mean the full cwd path can't be gotten, but it means it would need to be reconstructed piece-by-piece by walking the filesystem.
Many libc implementations will do that filesystem walking automatically (musl doesn't; gnu libc, freebsd, etc do), so the libc being linked also determines whether or not ENAMETOOLONG is possible.
FreeBSD: https://cgit.freebsd.org/src/tree/lib/libc/gen/getcwd.c
GNU libc: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/posix/getcwd.c;h=91c6ffd4d8208a0a8efb9c3fcb9dca0ca1007f33;hb=HEAD
Instead of adding recovery to these APIs (e.g. expanding the buffer and retrying, or walking the filesystem to construct the path independently), `currentPathAlloc` is now explicitly a convenience function, and the error sets of both `currentPath` and `currentPathAlloc` have been expanded to give the caller the ability to disambiguate between the possible ways they may be able to recover and let them handle recovery if deeply nested cwd paths are something they want to support.
Closes#36928
Problem was that when Maker.Step.Compile was deinitialized, it would
reap the memory for the child process, but not actually kill & wait for
the termination of the process. Leaving the extra processes running
caused "Reusing Cache Artifacts" deadlocks, not to mention wasting
resources.
closes#36513
This performs a scalar multiplication of the base point by a clamped
scalar (a multiple of 8, so we end up in the prime order group), so
these functions cannot return an error.
Fixes#36154
Compare the full zero-padded buffers so we can support different
active widths and still keep the comparison length fixed at comptime.
Also add a constant-time isOne() check, which is quite useful for
a long of applications using finite field arithemtic.
see #36719
tried to follow the style of the existing legalizations
tested with `stage4/bin/zig build test -Dskip-release -Dskip-non-native`
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36818
Reviewed-by: Justus Klausecker <justusk@noreply.codeberg.org>
For every hybrid KEM, compute the correct seed length (even with
P-384 to be aligned with the current version of the draft).
And to eliminate a footgun (thanks Erik Schlyter), use fixed-size
seeds rather than a minimum size with padding and expose it.
That also makes the code simpler and shorter.
This target is effectively dead. We'll keep it on life support in the compiler
and standard library, but there's no reason to waste CI resources on it at this
stage.
AES is nice but has a problem when implemented in pure software
(on CPUs without AES instructions).
In order to not be insanely slow, the non-linear operation is
usually implemented with a lookup tables. But memory lookups
with a secret index is a side channel that can be exploited for
key recovery.
The current implementation of software AES mitigates this by
doing multiple passes over tiny lookup tables that fit in a single
cache line.
It works. Intra-cacheline attacks leveraging SMT exist, but the
number of CPUs with SMT but no AES instructions is pretty small
(old Intel Atom Medfield CPUs).
But we can do better. Bitslicing is another way to mitigate these
issues, but packing all the bits that will go through the same
circuit into the same register, essentially emulating a
hardware implementation.
For single-block AES, this is quite slow, but for any algorithm
that can leverage parallelization (AES-CTR, AES-OCB, etc), it's
not bad at all.
Long story short:
- Constant time everywhere, including weird old CPUs
- About 4x faster than the current cacheline-tables code
for inputs > 32 bytes.
On modern CPUs, the speedup is significant for WebAssembly.
Note that when side channels are not part of the threat model,
the unprotected lookup table remains faster.
The packing/unpacking/round operations are intentionally public.
Because in order to get decent performance, some AES-based ciphers
really need to control when they want to use the regular word
representation vs the packed representation.
An edwards25519 point with x=0 is not expected to have the sign
bit set.
This is rejected later with an IdentityElement error, but
technically it should be a decoding error (InvalidEncoding).