clickingbuttons 8a36a1f913
std.crypto.hash.sha2: cleanup add add more docs (#19744)
* std.crypto.hash.sha2: generalize sha512 truncation

Replace `Sha512224`, `Sha512256`, and `Sha512T224` with
`fn Sha512Truncated(digest_bits: comptime_int)`.

This required refactoring `Sha2x64(comptime params)` to
`Sha2x64(comptime iv: [8]u64, digest_bits: comptime_int)`
for user-specified `digest_bits`.

I left #19697 alone but added a compile-time check that digest_bits is
divisible by 8.

Remove docs which restate type name. Add module docs and reference where
IVs come from.

* std.crypto.sha2: make Sha512_224 and Sha512_256 pub

* make generic type implementation detail, add comments

* fix iv

* address @jedisct1 feedback

* fix typo

* renaming

* add truncation clarifying comment and Sha259T192 tests
2024-04-28 22:22:09 +02:00
..
2024-03-19 11:45:09 -07:00
2024-03-29 22:15:17 -07:00
2024-03-20 21:05:35 -07:00
2024-03-21 14:11:46 -07:00
2024-02-23 02:37:11 -07:00
2024-03-19 11:45:09 -07:00
2024-03-21 14:11:46 -07:00
2024-03-21 14:11:46 -07:00
2024-03-15 02:28:50 -04:00
2024-03-10 18:13:30 -07:00
2024-03-21 14:11:46 -07:00
2024-03-19 11:45:09 -07:00
2024-03-23 18:11:32 +01:00
2024-03-10 18:13:30 -07:00
2024-04-11 23:33:38 -07:00
2024-03-19 11:45:09 -07:00
2024-03-10 18:13:30 -07:00
2024-03-21 14:11:46 -07:00
2024-04-23 17:57:56 -07:00
2024-03-19 16:18:18 -07:00
2024-02-05 11:55:14 +03:30
2024-03-19 11:45:09 -07:00
2024-04-10 02:11:54 -07:00
2023-10-25 04:28:30 -04:00
2024-02-09 14:02:57 -08:00
2024-04-15 15:24:30 -07:00
2024-03-19 16:18:18 -07:00
2024-03-19 11:45:09 -07:00
2024-02-08 15:39:28 +01:00
2024-03-10 18:13:30 -07:00
2024-03-21 14:11:46 -07:00
2024-03-30 20:50:48 -04:00
2024-03-21 14:11:46 -07:00
2024-04-22 15:27:05 -07:00
2024-03-21 14:11:46 -07:00
2023-10-21 21:24:55 +00:00