summaryrefslogtreecommitdiff
path: root/test/pinweaver.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/pinweaver.c')
-rw-r--r--test/pinweaver.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/pinweaver.c b/test/pinweaver.c
index 21bd30396d..df7327887f 100644
--- a/test/pinweaver.c
+++ b/test/pinweaver.c
@@ -894,29 +894,40 @@ void HASH_update(union hash_ctx *ctx, const void *data, size_t len)
SHA256_sw_update(&ctx->sha256, data, len);
}
+void HMAC_SHA256_update(struct hmac_sha256_ctx *ctx, const void *data,
+ size_t len)
+{
+ if (MOCK_hash_update_cb)
+ MOCK_hash_update_cb(data, len);
+ if (ctx)
+ SHA256_sw_update(&ctx->hash, data, len);
+}
+
const union sha_digests *HASH_final(union hash_ctx *ctx)
{
++MOCK_DECRYPTO_release_counter;
return (union sha_digests *)SHA256_sw_final(&ctx->sha256);
}
-void SHA256_hw_init(struct sha256_ctx *ctx)
+enum dcrypto_result DCRYPTO_hw_sha256_init(struct sha256_ctx *ctx)
{
SHA256_sw_init(ctx);
++MOCK_DECRYPTO_init_counter;
+ return DCRYPTO_OK;
}
-void HMAC_SHA256_hw_init(struct hmac_sha256_ctx *ctx, const void *key,
- size_t len)
+enum dcrypto_result DCRYPTO_hw_hmac_sha256_init(struct hmac_sha256_ctx *ctx,
+ const void *key, size_t len)
{
TEST_ASRT_NORET(len == sizeof(EMPTY_TREE.hmac_key));
TEST_ASRT_NORET(memcmp(key, EMPTY_TREE.hmac_key,
sizeof(EMPTY_TREE.hmac_key)) == 0);
SHA256_sw_init(&ctx->hash);
++MOCK_DECRYPTO_init_counter;
+ return DCRYPTO_OK;
}
-const struct sha256_digest *HMAC_SHA256_hw_final(struct hmac_sha256_ctx *ctx)
+const struct sha256_digest *HMAC_SHA256_final(struct hmac_sha256_ctx *ctx)
{
++MOCK_DECRYPTO_release_counter;
return (struct sha256_digest *)MOCK_hmac;