zig/lib/std/crypto
Naoki MATSUMOTO cd4865d88c
std.crypto.sign.ecdsa: accepts unusual parameters like EcdsaP384Sha256 (#13302)
This commit accepts unusual parameters like EcdsaP384Sha256.
Some certifictes(below certs are in /etc/ssl/certs/ca-certificates.crt on Ubuntu 22.04) use EcdsaP384Sha256 to sign itself.
- Subject: C=GR, L=Athens, O=Hellenic Academic and Research Institutions Cert. Authority, CN=Hellenic Academic and Research Institutions ECC RootCA 2015
- Subject: C=US, ST=Texas, L=Houston, O=SSL Corporation, CN=SSL.com EV Root Certification Authority ECC
- Subject: C=US, ST=Texas, L=Houston, O=SSL Corporation, CN=SSL.com Root Certification Authority ECC

In verify(), hash array `h` is allocated to be larger than the scalar.encoded_length.
The array is regarded as big-endian.
Hash values are filled in the back of the array and the rest bytes in front are filled with zero.

In sign(), the hash array is allocated and filled as same as verify().
In deterministicScalar(), hash bytes are insufficient to generate `k`
To generate `k` without narrowing its value range,
this commit uses algorithm stage h. in  "Section 3.2 Generation of k" in RFC6979.
2022-10-26 13:18:06 +02:00
..
25519 std: remove deprecated API for the upcoming release 2022-09-16 14:46:53 -04:00
aes std.crypto: cosmetic improvement to AES multiplication algorithm (#11616) 2022-05-25 19:23:49 +02:00
pcurves std.crypto.ecc: add support for the secp256k1 curve (#11880) 2022-06-29 15:11:33 +02:00
aegis.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
aes.zig std: break up some long lines 2022-01-28 16:23:47 -07:00
aes_gcm.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
aes_ocb.zig stage2+stage1: remove type parameter from bit builtins 2022-08-22 11:19:20 +03:00
argon2.zig std.crypto: fix invalid pass by value 2022-06-20 15:11:22 +03:00
bcrypt.zig crypto/bcrypt: don't reimplement base64, just use a custom alphabet 2022-10-25 21:52:03 -07:00
benchmark.zig crypto/benchmark - replace testing allocator 2022-10-20 14:04:59 +03:00
blake2.zig std: add writer methods on all crypto.hash types (#10168) 2021-11-20 01:37:17 -08:00
blake3.zig std: update tests to stage2 semantics 2022-06-03 20:21:20 +03:00
chacha20.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
ecdsa.zig std.crypto.sign.ecdsa: accepts unusual parameters like EcdsaP384Sha256 (#13302) 2022-10-26 13:18:06 +02:00
errors.zig
ghash.zig stage2+stage1: remove type parameter from bit builtins 2022-08-22 11:19:20 +03:00
gimli.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
hash_composition.zig std.crypto.hash: allow creating hash functions from compositions (#11965) 2022-07-01 11:37:41 +02:00
hkdf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
hmac.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
isap.zig std: update usage of std.testing 2021-05-08 15:15:30 +03:00
md5.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
modes.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
pbkdf2.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
phc_encoding.zig std.fmt: require specifier for unwrapping ?T and E!T 2022-07-26 11:25:49 -07:00
poly1305.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
salsa20.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
scrypt.zig std.mem: add first method to SplitIterator and SplitBackwardsIterator 2022-07-25 22:04:30 +03:00
sha1.zig std: add writer methods on all crypto.hash types (#10168) 2021-11-20 01:37:17 -08:00
sha2.zig std: add writer methods on all crypto.hash types (#10168) 2021-11-20 01:37:17 -08:00
sha3.zig std: update tests to stage2 semantics 2022-06-03 20:21:20 +03:00
siphash.zig Fixes comptime 'error: cannot assign to constant' error in siphash. 2022-05-16 22:31:09 -04:00
test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
tlcsprng.zig stage1, stage2: rename c_void to anyopaque (#10316) 2021-12-19 00:24:45 -05:00
utils.zig replace other uses of std.meta.Vector with @Vector (#11346) 2022-03-30 14:12:14 -04:00
xoodoo.zig crypto: add the Xoodoo permutation, prepare for Gimli deprecation (#11866) 2022-07-01 13:18:08 +02:00