193 Commits

Author SHA1 Message Date
Yawning Angel
e1ba69ea51 base/runtime: Add rand_bytes and HAS_RAND_BYTES
Having the OS/runtime provide a cryptographic entropy source is the
right thing to do, and we need it to initialize the default random
number generator.
2025-11-29 10:45:53 +09:00
gingerBill
784f320e12 Fix indentation in comments 2025-11-18 12:11:29 +00:00
gingerBill
842cfee0f3 Change Odin's LICENSE to zlib from BSD 3-clause
This change was made in order to allow things produced with Odin and using Odin's core library, to not require the LICENSE to also be distributed alongside the binary form.
2025-10-28 14:38:25 +00:00
Jeroen van Rijn
7a9ea3ee6d Further overhaul of package line comments. 2025-10-09 23:05:29 +02:00
Jeroen van Rijn
288b45f50c package lines for encoding 2025-10-09 16:34:18 +02:00
Jeroen van Rijn
248b0fe9e1 More package lines 2025-10-09 16:11:33 +02:00
Laytan
164bb52212 crypto/hash: hash_bytes_to_buffer slice result to digest size 2025-07-19 19:50:32 +02:00
Feoramund
45219f240e Rename SIMD_IS_EMULATED to capability-affirmative HAS_HARDWARE_SIMD 2025-05-29 17:17:51 -04:00
Jeroen van Rijn
655fab7227 Add core/hyperthread count for Windows and Linux (#5216)
Add core/hyperthread count to `core:sys/info` for Windows and Linux.
TODO: Linux RISCV, Linux ARM, Darwin, and the BSDs.
2025-05-25 19:43:10 +02:00
Yawning Angel
38665431dd core/crypto/_aes/ct64: Disable bounds checking 2025-03-23 19:17:18 +09:00
Yawning Angel
2f301e46dc core/crypto: Switch to using ensure 2025-03-23 19:14:33 +09:00
Yawning Angel
dc94452fb9 core/crypto/blake2: Add the ability to easily alter digest size 2025-03-23 19:14:33 +09:00
Yawning Angel
93951ac72a core/crypto/sha2: Clean up the portable code slightly 2025-03-23 19:14:33 +09:00
Yawning Angel
982ab11aa1 core/crypto/sha2: Use hardware SHA224/256 when available (AMD64) 2025-03-23 19:14:33 +09:00
Yawning Angel
b220df60b8 core:crypto/deoxysii: Initial import 2025-03-23 19:14:33 +09:00
Yawning Angel
c2786a6dd5 core/crypto/aegis: Initial import 2025-03-23 19:14:33 +09:00
Yawning Angel
9fdcc4e39a core/crypto/x448: Initial import 2025-03-23 19:14:33 +09:00
Yawning Angel
bb395aeb41 core/crypto: Add rodata annotations (NFC) 2025-03-23 19:14:33 +09:00
Yawning Angel
50d40c2a26 core/crypto/chacha20poly1305: Add missing assertions 2025-03-23 19:14:33 +09:00
Yawning Angel
6e8710fce4 core/crypto/chacha20: Misc Simd128 improvements
- Detect the RISC-V `v` profile
- Don't bother trying to process 4 blocks at a time if emulated
2025-03-23 19:14:33 +09:00
Yawning Angel
e4e76f27f6 core/crypto: Use panic_contextless instead of intrinsics.trap 2025-03-23 19:14:33 +09:00
Yawning Angel
4c28f6d170 core/crypto/_aes/hw_intel: Fix comment (NFC) 2025-03-23 19:14:33 +09:00
Laytan Laats
e4892f1bb2 os/os2: wasi target support 2025-01-18 22:23:44 +01:00
Yawning Angel
cf7d705c1f core/crypto/_sha3: Fix edge case in cSHAKE bytepad
If the domain separator happens to be exactly the rate, we would
previously incorrectly add another rate-bytes of 0s.
2024-09-30 21:50:18 +09:00
Antonino Simone Di Stefano
5a6f761535 Add missing package qualifier to Context 2024-09-22 23:15:36 +02:00
gingerBill
68960e7d0a Use #+ tags 2024-09-19 12:39:56 +01:00
gingerBill
6bbeb0a243 Merge pull request #4203 from karl-zylinski/file-tags-without-comments
Make tags use #+ syntax instead of //+
2024-09-19 12:36:43 +01:00
gingerBill
d560dad0d8 Add missing import that was accidentally deleted before commit 2024-09-19 12:09:30 +01:00
gingerBill
244907149a Move os stuff to OS specific files 2024-09-19 12:06:31 +01:00
Karl Zylinski
19f0127e55 Moved all packages in core, base, vendor, tests and examples to use new #+ file tag syntax. 2024-09-14 18:27:49 +02:00
Laytan Laats
288312a812 core: improve package doc comments for the documentation generator 2024-09-03 19:59:04 +02:00
Laytan
ca6ef95b03 add support for linux_riscv64 and freestanding_riscv64 2024-08-20 14:06:40 +02:00
Yawning Angel
ba1ad82c2b core/crypto/aead: Initial import 2024-08-10 18:32:37 +09:00
Yawning Angel
38aea1f907 core/crypto/aes,chacha20poly1305: Add require_results to open 2024-08-10 18:32:37 +09:00
Yawning Angel
b381791f42 core/crypto/chacha20: Change API terminology to be consistent with AES 2024-08-10 18:32:37 +09:00
Yawning Angel
14ceb0b19d core/crypto/chacha20poly1305: Support AEAD_XChaCha20_Poly1305
IETF-draft flavor (32-bit counter) though this makes no practical
difference.
2024-08-10 18:32:37 +09:00
Yawning Angel
8efc98ce90 core/crypto/chacha20poly1305: Change the interface to match GCM 2024-08-10 18:32:37 +09:00
Yawning Angel
1f3107e693 core/crypto/chacha20: Use 128-bit/256-bit SIMD 2024-08-10 18:32:37 +09:00
Yawning Angel
708f053fe6 core/crypto/aes: Use NIST terminology for the IV 2024-08-10 18:32:37 +09:00
Yawning Angel
ac7f44b1b8 core/crypto/aes: Slightly tweak GHASH to look less spooky 2024-08-10 18:32:37 +09:00
Yawning Angel
b1d6e4139e core/crypto/aes: Disable bounds checking for the CTR loops 2024-08-10 18:32:37 +09:00
Yawning Angel
dfc4df9807 core/crypto/_aes/hw_intel: Use a constant for the PSHUFB indicies 2024-08-10 18:32:37 +09:00
Yawning Angel
b9293334ca core/crypto/ed25519: Rename a member for clarity
This better matches the spec.
2024-08-10 18:32:37 +09:00
Yawning Angel
b68311d777 core/crypto/hash: Make the _to_buffer routines return the hash slice
Quality of life improvement.
2024-08-10 18:32:37 +09:00
gingerBill
9f9abb8fb3 Use union #shared_nil for os.Error 2024-08-04 11:05:30 +01:00
gingerBill
e60951a902 Begin converting os.Errno to be a nil-able type as a transition period 2024-08-04 10:51:08 +01:00
Yawning Angel
33dae2e26c core/crypto/aes: Support the full range of GCM nonce sizes 2024-07-16 01:29:43 +09:00
Yawning Angel
69026852ce core/crypto/aes: Add Intel AES-NI support
This supports AES-NI + PCLMUL, and provides optimized key schedule, ECB,
CTR, and GCM.  Other modes are trivial to add later if required.
2024-07-16 01:29:43 +09:00
Yawning Angel
1bc21c3481 core/crypto/_aes: Remove redundant sanity checks 2024-07-16 01:29:43 +09:00
Yawning Angel
c9c0b9ea7b core/crypto: Fix/add some documentation (NFC) 2024-07-16 01:29:43 +09:00