Commit Graph
1949 Commits
Author SHA1 Message Date
Frank Denis 13d2c97a72 Remove useless sodium_memzero, add one that makes sense 2026-03-08 15:26:40 +01:00
Frank Denis c4e3b4028f Zero the state afetr AES decryption 2026-02-10 09:01:00 +01:00
Frank Denis 8a8d8a62fa secretbox: zero the state after checking only the tag 2026-02-10 09:00:59 +01:00
Frank Denis f6c18801a8 Add WASM SIMD implementations of Argon2 2026-01-22 10:42:14 +01:00
Frank Denis e4c2190330 randombytes: cleanup the JavaScript path
Refactor Emscripten handling to use a proper
randombytes_implementation struct instead of scattered #ifdef
blocks.
2026-01-17 12:28:29 +01:00
Frank Denis a937222006 Compatibility with gcc 4.x
Reported by @pedro0311

Fixes #1507
2026-01-13 23:00:25 +01:00
Frank Denis 3804ecc0e2 Add ARM acceleration for SHA3 2026-01-11 17:13:18 +01:00
Frank Denis 6b48659e3d Export missing crypto_ipcrypt_nd_keygen() helper function 2026-01-07 23:00:08 +01:00
Frank Denis 91fe8a46ec Fix compilation with GCC on aarch64
Use unsigned NEON intrinsics everywhere

Fixes #1502
2026-01-07 12:00:49 +01:00
Frank Denis 6a569ef3be Relax alignment of SHAKE states 2026-01-06 15:42:08 +01:00
Frank Denis d66b358741 Add crypto_core_keccak1600_state, remove keccak1600_STATEBYTES 2026-01-06 15:42:08 +01:00
Frank Denis 995c501554 Rename parameters to improve clarity 2026-01-06 15:42:08 +01:00
Frank Denis 7fcc982618 Change sodium_ip2bin to take the ip length 2026-01-06 15:42:08 +01:00
Frank Denis 7df634f2c5 Remove unnecessary checks 2026-01-06 15:42:08 +01:00
Frank Denis 7572dcccb9 Sync prototypes 2026-01-06 15:42:08 +01:00
Frank Denis 2fd321e42c Remove unused constants 2026-01-06 15:42:08 +01:00
Frank Denis b4263fc800 Add missing prototype 2026-01-06 15:42:08 +01:00
Frank Denis ff05585f75 Add sodium_ip2bin, sodium_bin2ip 2026-01-06 15:42:07 +01:00
Frank Denis 232a878877 MSVC doesn't allow direct C-style casts between NEON vector types
Replace (int8x16_t) with vreinterpretq intrinsics
2026-01-06 15:42:07 +01:00
Frank Denis f1eeb2787e Use a specialized shuffle macro and avoid non-portable builtins 2026-01-06 15:42:07 +01:00
Frank Denis 5aa6d1910b Import ipcrypt 2026-01-06 15:42:07 +01:00
Frank Denis 350604eb25 Import SHAKE128, SHAKE256, TurboSHAKE128, and TurboSHAKE256
- crypto_core_keccak1600: Keccak-f[1600] permutation
- crypto_xof_shake128/256: FIPS 202 SHAKE functions
- crypto_xof_turboshake128/256: TurboSHAKE (faster, 12-round variant)
2026-01-06 15:42:07 +01:00
Siddhesh Poyarekar a4832a91b1 Build correctly with IBT and Shadow Stack (#1289)
Add .gnu.property notes to indicate support for IBT and shadow stacks
when libsodium is built with it.  There's no stack switching code in
here, so this should not need any other codegen changes.
2026-01-06 15:38:52 +01:00
Frank Denis 22b9c35f28 Add fences 2026-01-06 23:17:45 +01:00
Frank Denis b000439e01 Add defensive NULL guard in escrypt_r 2026-01-05 23:51:23 +01:00
Frank Denis f703a31935 kdf_hkdf_sha*: wipe the entire structure 2026-01-05 23:51:19 +01:00
Frank Denis c6e4a6d42f Add some ending CRLF 2026-01-05 15:10:33 +01:00
Frank Denis 08e39ef24d Remove unused variable 2026-01-03 19:09:39 +01:00
Frank Denis f2da4cd8cb core_ed25519_is_valid_point: check Y==Z in addition to X==0 2025-12-29 23:22:15 +01:00
Frank Denis 55f06e6738 Refer to the correct header 2025-12-29 23:12:15 +01:00
Frank Denis 79b9b08273 Fix typos 2025-12-29 16:09:03 +01:00
Frank Denis d121c829ee Format 2025-12-29 23:05:15 +01:00
Frank Denis 2a6640640f That useless function will be removed 2025-12-29 15:44:16 +01:00
Frank Denis 3c55699b71 nsec isn't used 2025-12-08 16:05:11 +01:00
Frank Denis 7baa22c819 Downgrade ax_valgrind_check.m4 2025-12-08 04:51:33 +01:00
Frank Denis 3eabeb547f Relax ((nonnull)) attributes where applicable
Reported by @stef -- Thanks!

Fixes #1477
2025-09-12 17:57:47 +02:00
Frank Denis 605f02d601 Add an optblocker in ge25519_from_hash 2025-08-27 22:57:36 +02:00
Frank Denis 37c5ecb937 Include <threads.h> if it exists 2025-07-30 13:27:37 +02:00
Frank Denis 51f3bee2bc Remove duplicate include 2025-07-30 13:16:13 +02:00
Frank Denis 3dea5725a9 Regen 2025-07-30 12:34:41 +02:00
Frank Denis 604d0e17bd Update autoconf 2025-07-30 12:28:39 +02:00
Frank Denis b4cd238892 Improve AES256-GCM performance on ARM 2025-05-21 23:04:56 +02:00
Frank Denis ff507ae4c4 Reorder arguments to vaeseq_u8 to improve AArch64 performance
The register arguments to the AESE instruction are commutative, however
the first input register is constrained in that it also names the output
register. The constraint on register allocation causes recent LLVM
versions to emit a lot of MOV instructions, significantly impacting
performance.

Swapping the register operands allows the compiler to emit significantly
fewer MOV instructions. This change improves performance on Arm
infrastructure micro-architectures by 14-36% depending on the
micro-architecture

Found and reported by George Steed from ARM. Thanks!
2025-05-21 14:51:27 +02:00
Frank Denis 9fff3a842a Nits 2025-04-30 01:41:10 +02:00
Frank Denis 32de824a8d MSC_VER -> _MSC_VER 2025-04-22 11:33:14 +02:00
Frank Denis 9e125388a1 Use uint64_t sizes in aegis*_mac()
No-op in libsodium for now, but useful if we introduce a streaming
API later.
2024-12-04 17:38:55 +01:00
Frank Denis 8855e8c300 Add assembly versions of equal() and negative() 2024-10-23 22:37:37 +02:00
Frank Denis 42f4e42b06 Use an optblocker in crypto_verify_n() 2024-10-23 22:34:15 +02:00
Frank Denis c1fc74e690 Sync softaes with libaegis 2024-10-23 22:11:51 +02:00
Frank Denis 96d115cf29 Decrement and shift in separate steps 2024-10-23 19:52:14 +02:00