Commit Graph

35782 Commits

Author SHA1 Message Date
Frank Denis ee4df4ad3e crypto - threaded K12: separate context computation from thread spawning (#25793)
* threaded K12: separate context computation from thread spawning

Compute all contexts and store them in a pre-allocated array,
then spawn threads using the pre-computed contexts.

This ensures each context is fully materialized in memory with the
correct values before any thread tries to access it.

* kt128: unroll the permutation rounds only twice

This appears to deliver the best performance thanks to improved cache
utilization, and it’s consistent with what we already do for SHA3.
2025-11-03 17:09:00 +01:00
Linus Groh afdd04356c std: serenity has preadv now
https://github.com/SerenityOS/serenity/commit/2a9154e77c61d79d4b96b5f957aca2d70325ac6d
2025-11-02 14:45:32 -08:00
Frank Denis bf9082518c crypto.kt128: when using incremental hashing, use SIMD when possible (#25783)
Also add plain kt128 (without threading) to the benchmarks
2025-11-02 11:31:00 +01:00
Alex Rønne Petersen 2f4bca41ea ci: bump riscv64-linux-debug timeout to 9 hours on Forgejo Actions 2025-11-01 17:18:24 +01:00
Jacob Young 143ea88017 Revert "std.http: disable failing test on 32-bit arm"
This reverts commit 16185f66f1.

Which was fixed by d000574380.

Closes #25762
2025-11-01 11:21:28 -04:00
Alex Rønne Petersen 5db9eaa851 std.Io.Threaded: use ResetEventPosix on illumos
Like NetBSD, illumos has no futexes.

ref #25760
2025-11-01 16:18:56 +01:00
Bingwu Zhang a8fea09cd5 cbe: fix more MIPS register names in inline assembly 2025-11-01 15:11:35 +01:00
Frank Denis 95c76b1b4a Add std.crypto.hash.sha3.{KT128,KT256} - RFC 9861. (#25593)
KT128 and KT256 are fast, secure cryptographic hash functions based on Keccak (SHA-3).

They can be seen as the modern version of SHA-3, and evolution of SHAKE, with better performance.

After the SHA-3 competition, the Keccak team proposed these variants in 2016, and the constructions underwent 8 years of public scrutiny before being standardized in October 2025 as RFC 9861.

They uses a tree-hashing mode on top of TurboSHAKE, providing both high security and excellent performance, especially on large inputs.

They support arbitrary-length output and optional customization strings.

Hashing of very large inputs can be done using multiple threads, for high throughput.

KT128 provides 128-bit security strength, equivalent to AES-128 and SHAKE128, which is sufficient for virtually all applications.

KT256 provides 256-bit security strength, equivalent to SHA-512. For virtually all applications, KT128 is enough (equivalent to SHA-256 or BLAKE3).

For small inputs, TurboSHAKE128 and TurboSHAKE256 (which KT128 and KT256 are based on) can be used instead as they have less overhead.
2025-11-01 14:03:43 +00:00
Alex Rønne Petersen 4e943fc847 std.c: add missing MINSIGSTKSZ for some FreeBSD targets 2025-11-01 09:58:05 +01:00
Frank Denis d5585bc650 Implement threaded BLAKE3 (#25587)
Allows BLAKE3 to be computed using multiple threads.
2025-11-01 07:40:03 +01:00
Jay Petacat 5a38dd28dc std: Skip element comparisons if mem.order args point to same memory
This optimization is used in `mem.eql`, but was missing from `order`,
`orderZ`, and `ascii.orderIgnoreCase`.
2025-10-31 18:34:33 -07:00
Alex Rønne Petersen 8468549726 std.Target: bump vulkan max version to 1.4.331 2025-10-31 15:46:44 +01:00
Alex Rønne Petersen d677086bcd std.Target: bump opencl/nvcl max version to 3.0.19 2025-10-31 15:46:29 +01:00
Alex Rønne Petersen adbf46aef3 std.Target: bump cuda max version to 13.0.2 2025-10-31 15:46:08 +01:00
Alex Rønne Petersen 802ee515d8 std.Target: bump amdhsa max version to 7.1.0 2025-10-31 15:45:57 +01:00
Alex Rønne Petersen 27c949689e std.Target: bump wasi max version to 0.3.0 2025-10-31 15:45:43 +01:00
Alex Rønne Petersen 3801e6366f std.Target: bump dragonfly max version to 6.4.2 2025-10-31 15:45:26 +01:00
Alex Rønne Petersen a9c648c060 std.Target: bump linux max version to 6.17 2025-10-31 15:45:13 +01:00
Alex Rønne Petersen 0116d98093 std.Target: bump fuchsia max version to 28.0.0 2025-10-31 15:45:01 +01:00
Alex Rønne Petersen 38413446b0 std.Target: bump contiki max version to 5.1.0 2025-10-31 15:44:47 +01:00
Alex Rønne Petersen a46c3a1582 test: remove some unsupported x86_64 darwin targets from llvm_targets 2025-10-31 15:36:17 +01:00
qilme 8347791ce3 std.os.windows: eliminate forwarder function in kernel32 (#25766)
#1840

kernel32.AddVectoredExceptionHandler -> ntdll.RtlAddVectoredExceptionHandler
kernel32.RemoveVectoredExceptionHandler -> ntdll.RtlRemoveVectoredExceptionHandler
kernel32.ExitProcess -> ntdll.RtlExitUserProcess
kernel32.InitializeCriticalSection -> ntdll.RtlInitializeCriticalSection
kernel32.EnterCriticalSection -> ntdll.RtlEnterCriticalSection
kernel32.LeaveCriticalSection -> ntdll.RtlLeaveCriticalSection
kernel32.DeleteCriticalSection -> ntdll.RtlDeleteCriticalSection
kernel32.TryAcquireSRWLockExclusive -> ntdll.RtlTryAcquireSRWLockExclusive
kernel32.AcquireSRWLockExclusive -> ntdll.RtlAcquireSRWLockExclusive
kernel32.ReleaseSRWLockExclusive -> ntdll.RtlReleaseSRWLockExclusive
kernel32.WakeConditionVariable -> ntdll.RtlWakeConditionVariable
kernel32.WakeAllConditionVariable -> ntdll.RtlWakeAllConditionVariable
kernel32.HeapReAlloc -> ntdll.RtlReAllocateHeap
kernel32.HeapAlloc -> ntdll.RtlAllocateHeap
2025-10-31 13:54:50 +00:00
TibboddiT 62de7a2efd fix typo in std.debug.ElfFile.loadSeparateDebugFile
closes #25667
2025-10-31 09:44:47 +01:00
Alex Rønne Petersen 389368392e Revert "ci: stop building FreeBSD module tests on x86_64-linux"
This reverts commit 16c18b835e.

There must be one CI script that doesn't skip anything.
2025-10-30 23:17:33 +01:00
Jacob Young d000574380 Io: fix some horrible data races and UAFs caused by Condition misuse 2025-10-30 16:53:05 -04:00
Alex Rønne Petersen 0ca4df540f std.debug.cpu_context: fix signal_ucontext_t for arm-linux 2025-10-30 20:28:31 +01:00
Alex Rønne Petersen 8126e22756 build: bump libc-test max_rss from 1758181785 to 2253598720 2025-10-30 17:52:50 +01:00
Jacob Young 5b060ef9d4 Merge pull request #25558 from jacobly0/elfv2-load-obj
Elf2: start implementing input object loading
2025-10-30 12:09:13 -04:00
Matthew Lugg 4174ab9c2c Merge pull request #25726 from mlugg/std-log-colors
Cache stderr ttyconf, colorize `std.log`, and fix `--webui`
2025-10-30 15:24:47 +00:00
Jacob Young 32779a7c73 aarch64: fix macho external references 2025-10-30 09:31:30 +00:00
Jacob Young 402c14f86a aarch64: implement optional comparisons 2025-10-30 09:31:30 +00:00
Matthew Lugg 0dde70ef76 std.Build: fix '--webui' crash
Using '--webui' without '--time-report' when there are Run steps in the
graph was regressed by https://github.com/ziglang/zig/pull/25029.
2025-10-30 09:31:30 +00:00
Matthew Lugg 9215121688 std.log: colorize output in default implementation
Also remove the example implementation from the file doc comment; it's
better to just link to `defaultLog` as an example, since this avoids
writing the example implementation twice and prevents the example from
bitrotting.
2025-10-30 09:31:30 +00:00
Matthew Lugg 74931fe25c std.debug.lockStderrWriter: also return ttyconf
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving
syscalls), and doing it every time we need to print isn't really
necessary; under normal usage, we can compute the value once and cache
it for the whole program's execution. Since anyone outputting to stderr
may reasonably want this information (in fact they are very likely to),
it makes sense to cache it and return it from `lockStderrWriter`. Call
sites who do not need it will experience no significant overhead, and
can just ignore the TTY config with a `const w, _` destructure.
2025-10-30 09:31:28 +00:00
John Benediktsson 74c23a237e Merge pull request #25763 from mrjbq7/cancelled
rename Cancelled to Canceled
2025-10-30 04:40:13 +00:00
Jacob Young 1d80c9540a Threaded: fix safety crashes 2025-10-29 21:01:47 -04:00
Alex Rønne Petersen 767f28d7a6 Merge pull request #25733 from GasInfinity-Forks/x86_16-cpu_context
* fix: add `i86` cpu in `update_cpu_features`
* feat: add `x86_16` debug `cpu_context`
2025-10-30 01:41:32 +01:00
Jacob Young 09aa4add2a x86_64: add lret encoding
Closes #25608
2025-10-29 19:31:44 -04:00
Jacob Young 52a029e503 x86_64: continue hacking around unimplemented linker logic
Closes #25666
2025-10-29 19:31:44 -04:00
Jacob Young ada9035af5 x86_64: fix encoding for out with an immediate port
Closes #25547
2025-10-29 18:41:31 -04:00
Jacob Young 6e8b07ca15 Elf: fix alignment of merge subsections
Closes #25565
2025-10-29 18:41:05 -04:00
Jacob Young 0834e696f7 Elf2: start implementing dynamic linking 2025-10-29 18:15:09 -04:00
Jacob Young 40901440a6 Elf2: simplify archive loading 2025-10-29 18:14:16 -04:00
Jacob Young c4478e078b Elf2: load archives 2025-10-29 18:07:12 -04:00
Jacob Young 7542c3260f Elf2: load relocations from input objects 2025-10-29 18:06:17 -04:00
Jacob Young 6f0476e41d Elf2: start implementing input object loading 2025-10-29 18:05:49 -04:00
Andrew Kelley a072d821be Merge pull request #25592 from ziglang/init-std.Io
std: Introduce `Io` Interface
2025-10-29 13:51:37 -07:00
Andrew Kelley 16185f66f1 std.http: disable failing test on 32-bit arm
tracked by https://github.com/ziglang/zig/issues/25762
2025-10-29 13:50:04 -07:00
Alex Rønne Petersen b2bc44e0d5 std.os.linux: fix restore for powerpc/powerpc64
sigreturn and rt_sigreturn are distinct syscalls on PowerPC.
2025-10-29 20:44:43 +01:00
GasInfinity ef4f6e6c05 feat: add x86_16 debug cpu_context 2025-10-29 14:35:33 +01:00