diff options
| author | Frank Denis <github@pureftpd.org> | 2020-08-19 16:21:05 +0200 |
|---|---|---|
| committer | Frank Denis <github@pureftpd.org> | 2020-08-20 23:02:05 +0200 |
| commit | 6f9ea9eaef79863ebdc9bf44b2af67ec4caad031 (patch) | |
| tree | 4a34acd626affbf4e98484a357e6464c92952b2a /lib/std/crypto/sha3.zig | |
| parent | 1a4059ed88740c0289b7fea5735115fa9481a8e5 (diff) | |
| download | zig-6f9ea9eaef79863ebdc9bf44b2af67ec4caad031.tar.gz zig-6f9ea9eaef79863ebdc9bf44b2af67ec4caad031.zip | |
Breaking: sort std/crypto functions into categories
Instead of having all primitives and constructions share the same namespace,
they are now organized by category and function family.
Types within the same category are expected to share the exact same API.
Diffstat (limited to 'lib/std/crypto/sha3.zig')
| -rw-r--r-- | lib/std/crypto/sha3.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/crypto/sha3.zig b/lib/std/crypto/sha3.zig index 03635ca553..630a44fbfb 100644 --- a/lib/std/crypto/sha3.zig +++ b/lib/std/crypto/sha3.zig @@ -27,14 +27,14 @@ fn Keccak(comptime bits: usize, comptime delim: u8) type { pub fn init() Self { var d: Self = undefined; - d.reset(); - return d; - } - - pub fn reset(d: *Self) void { mem.set(u8, d.s[0..], 0); d.offset = 0; d.rate = 200 - (bits / 4); + return d; + } + + pub fn reset(self: *Self) void { + self.* = init(); } pub fn hash(b: []const u8, out: []u8) void { |
