commit c3a38c276427ba1c9633a415dd448927a160c89b
parent b34a4e0d313698d91961a5852bbb88a39c1e7158
Author: Armin Preiml <apreiml@strohwolke.at>
Date: Mon, 10 Jan 2022 12:53:39 +0100
hash: remove createfunc
Since hmac does not need a createfunc anymore, there is no use for such
in the stdlib.
Signed-off-by: Armin Preiml <apreiml@strohwolke.at>
Diffstat:
3 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/crypto/sha1/sha1.ha b/crypto/sha1/sha1.ha
@@ -39,9 +39,6 @@ export fn sha1() digest = {
return sha;
};
-// [[hash::createfunc]] to allocate a hash state to compute SHA1
-export fn create() *hash::hash = alloc(sha1());
-
fn write(st: *io::stream, buf: const []u8) (size | io::error) = {
let h = st: *digest;
let b: []u8 = buf;
diff --git a/crypto/sha256/sha256.ha b/crypto/sha256/sha256.ha
@@ -53,9 +53,6 @@ export fn sha256() state = {
return sha;
};
-// [[hash::createfunc]] to allocate a hash state to compute SHA-256
-export fn create() *hash::hash = alloc(sha256());
-
fn reset(h: *hash::hash) void = {
let h = h: *state;
h.h[0] = init0;
diff --git a/hash/hash.ha b/hash/hash.ha
@@ -52,8 +52,3 @@ export fn sz(h: *hash) size = h.sz;
// Returns the block size of the hash.
export fn bsz(h: *hash) size = h.bsz;
-
-// General purpose type for creating hash functions, such as via
-// [[crypto::sha256::create]]. Note that hashes created this way must be freed
-// by the caller.
-export type createfunc = fn() *hash::hash;