zig/lib/std/crypto
Frank Denis 332fbb4b02
crypto.edwards25519: add the ability to check for group membership (#20175)
Most of the functions related to points on the Edwards25519 curve
check that input points are not in a small-order subgroup.

They don't check that points are on the prime-order subgroup,
because this is expensive, and not always necessary.

However, applications may require such a check in order to
ensure that a public key is valid, and that a secret key counterpart
exists.

Many functions in the public API of libsodium related to arithmetic
over Edwards25519 also do that check unconditionally. This is
expensive, but a good way to catch bugs in protocols and
implementations.

So, add a `rejectUnexpectedSubgroup()` function to achieve this.

The documentation on the edwards25519->curve25519 conversion
function was also updated, in order to explain how to match
libsodium's behavior if necessary.

We use an addition chain to multiply the point by the order of
the prime group.

An alternative we may implement later is Pornin's point halving
technique: https://eprint.iacr.org/2022/1164.pdf
2024-06-04 10:11:05 +02:00
..
25519 crypto.edwards25519: add the ability to check for group membership (#20175) 2024-06-04 10:11:05 +02:00
aes std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
Certificate extract std.posix from std.os 2024-03-19 11:45:09 -07:00
pcurves std.crypto.pcurves.*: simpler, smaller, faster u64 addition with carry (#19644) 2024-04-14 01:13:22 +02:00
tls std.posix.iovec: use .base and .len instead of .iov_base and .iov_len 2024-04-28 00:20:30 -07:00
aegis.zig {aegis,aes_gcm}: fix overflow with large inputs on 32-bit systems (#19270) 2024-03-12 22:56:28 +00:00
aes.zig x86_64: fix incorrect mnemonic selection 2024-02-25 11:22:10 +01:00
aes_gcm.zig {aegis,aes_gcm}: fix overflow with large inputs on 32-bit systems (#19270) 2024-03-12 22:56:28 +00:00
aes_ocb.zig x86_64: implement shifts of big integers 2024-02-12 05:25:07 +01:00
argon2.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
ascon.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
bcrypt.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
benchmark.zig std.crypto.pcurves.*: simpler, smaller, faster u64 addition with carry (#19644) 2024-04-14 01:13:22 +02:00
blake2.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
blake3.zig x86_64: implement more shuffles 2024-02-25 11:22:10 +01:00
Certificate.zig ComptimeStringMap: return a regular struct and optimize 2024-04-22 15:31:41 -07:00
chacha20.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
cmac.zig x86_64: fix std test failures 2023-11-03 23:18:21 -04:00
ecdsa.zig Rename der_encoded_max_length to der_encoded_length_max 2024-04-20 16:27:56 -07:00
errors.zig crypto.edwards25519: add the ability to check for group membership (#20175) 2024-06-04 10:11:05 +02:00
ff.zig std.crypto: make ff.ct_unprotected.limbsCmpLt compile (#19741) 2024-04-23 20:29:36 +00:00
ghash_polyval.zig Deprecate suggestVectorSize in favor of suggestVectorLength 2024-01-01 16:18:57 +01:00
hash_composition.zig x86_64: implement enough to pass unicode tests 2023-10-23 22:42:18 -04:00
hkdf.zig x86_64: implement enough to pass unicode tests 2023-10-23 22:42:18 -04:00
hmac.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
isap.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
keccak_p.zig sha3.keccak: allow Keccak[f=200] (#20181) 2024-06-04 10:10:46 +02:00
md5.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
ml_kem.zig ml_kem.zig: inLen -> in_len (#19269) 2024-03-12 19:52:06 +00:00
modes.zig update codebase to use @memset and @memcpy 2023-04-28 13:24:43 -07:00
pbkdf2.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
phc_encoding.zig x86_64: fix std test failures 2023-11-03 23:18:21 -04:00
poly1305.zig Remove redundant test name prefixes now that test names are fully qualified 2024-02-26 15:18:31 -08:00
salsa20.zig x86_64: implement more shuffles 2024-02-25 11:22:10 +01:00
scrypt.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
sha1.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
sha2.zig std.crypto.hash.sha2: cleanup add add more docs (#19744) 2024-04-28 22:22:09 +02:00
sha3.zig Delete compile errors for deprecated decls 2024-05-03 13:27:30 -07:00
siphash.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
test.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
tlcsprng.zig handle visionos target OS tag in the compiler 2024-05-09 15:04:15 +02:00
tls.zig Fix TLS record overflow by limiting inner record length to 2^14 2024-01-16 14:58:56 -08:00
utils.zig std: promote tests to doctests 2024-03-21 14:11:46 -07:00