zig/lib/std/crypto
Frank Denis 10f2d62789
std/crypto: use finer-grained error sets in function signatures (#8558)
std/crypto: use finer-grained error sets in function signatures

Returning the `crypto.Error` error set for all crypto operations
was very convenient to ensure that errors were used consistently,
and to avoid having multiple error names for the same thing.

The flipside is that callers were forced to always handle all
possible errors, even those that could never be returned by a
function.

This PR makes all functions return union sets of the actual errors
they can return.

The error sets themselves are all limited to a single error.

Larger sets are useful for platform-specific APIs, but we don't have
any of these in `std/crypto`, and I couldn't find any meaningful way
to build larger sets.
2021-04-20 19:57:27 +02:00
..
25519 std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
aes std/crypto/aes: fix AES {encrypt,decrypt}Wide 2021-02-28 21:55:58 +02:00
aegis.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
aes.zig std: Add more error checking in hexToBytes 2021-02-21 12:19:03 +02:00
aes_gcm.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
aes_ocb.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
bcrypt.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
benchmark.zig std/crypto/chacha20: add round-reduced versions & cleanup internals 2021-03-17 11:25:51 -07:00
blake2.zig std/crypto: add BLAKE2-160 types and tests 2021-01-03 19:53:30 -08:00
blake3.zig std: Add more error checking in hexToBytes 2021-02-21 12:19:03 +02:00
chacha20.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
errors.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
ghash.zig Convert inline fn to callconv(.Inline) everywhere 2021-02-10 20:06:12 -07:00
gimli.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
hkdf.zig Year++ 2020-12-31 15:45:24 -08:00
hmac.zig Year++ 2020-12-31 15:45:24 -08:00
isap.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
md5.zig Year++ 2020-12-31 15:45:24 -08:00
modes.zig Year++ 2020-12-31 15:45:24 -08:00
pbkdf2.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
poly1305.zig Year++ 2020-12-31 15:45:24 -08:00
salsa20.zig std/crypto: use finer-grained error sets in function signatures (#8558) 2021-04-20 19:57:27 +02:00
sha1.zig Year++ 2020-12-31 15:45:24 -08:00
sha2.zig Year++ 2020-12-31 15:45:24 -08:00
sha3.zig crypto: add legacy keccak hash functions 2021-01-15 12:36:38 -08:00
siphash.zig fix typo in comment 2021-02-02 20:07:08 -08:00
test.zig Year++ 2020-12-31 15:45:24 -08:00
tlcsprng.zig initial support for haiku sync update 2021-02-25 16:41:42 -07:00
utils.zig std: introduce a thread-local CSPRNG for general use 2020-12-18 12:22:46 -07:00