Skip to content

Commit 9ede8ee

Browse files
committed
Add std.crypto.hash.sha3.{KT128,KT256} - RFC 9861. (#25593)
KangarooTwelve is a family of two fast and secure extendable-output functions (XOFs): KT128 and KT256. These functions generalize traditional hash functions by allowing arbitrary output lengths. KangarooTwelve was designed by SHA-3 authors. It aims to deliver higher performance than the SHA-3 and SHAKE functions defined in FIPS 202, while preserving their flexibility and core security principles. On high-end platforms, it can take advantage of parallelism, whether through multiple CPU cores or SIMD instructions. As modern SHA-3 constructions, KT128 and KT256 can serve as general-purpose hash functions and can be used, for example, in key-derivation, and with arbitrarily large inputs. RFC9861: https://datatracker.ietf.org/doc/rfc9861/
1 parent e23af9d commit 9ede8ee

File tree

3 files changed

+1658
-0
lines changed

3 files changed

+1658
-0
lines changed

lib/std/crypto/benchmark.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ const hashes = [_]Crypto{
3030
Crypto{ .ty = crypto.hash.sha3.Shake256, .name = "shake-256" },
3131
Crypto{ .ty = crypto.hash.sha3.TurboShake128(null), .name = "turboshake-128" },
3232
Crypto{ .ty = crypto.hash.sha3.TurboShake256(null), .name = "turboshake-256" },
33+
Crypto{ .ty = crypto.hash.sha3.KT128, .name = "kt128" },
3334
Crypto{ .ty = crypto.hash.blake2.Blake2s256, .name = "blake2s" },
3435
Crypto{ .ty = crypto.hash.blake2.Blake2b512, .name = "blake2b" },
3536
Crypto{ .ty = crypto.hash.Blake3, .name = "blake3" },
3637
};
3738

3839
const parallel_hashes = [_]Crypto{
3940
Crypto{ .ty = crypto.hash.Blake3, .name = "blake3-parallel" },
41+
Crypto{ .ty = crypto.hash.sha3.KT128, .name = "kt128-parallel" },
4042
};
4143

4244
const block_size: usize = 8 * 8192;

0 commit comments

Comments
 (0)