summaryrefslogtreecommitdiff
path: root/siv-cmac-aes256.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2019-06-06 09:25:59 +0200
committerNiels Möller <nisse@lysator.liu.se>2019-06-06 09:25:59 +0200
commit83296eb6a45f7dba125372a2ce3c8f4d6c8b9934 (patch)
tree367f44c3c9bbf46d0169880ab17c06186dd51a04 /siv-cmac-aes256.c
parentf8c206ed23e98a62c2b4d17237d6c0a2f6050843 (diff)
parent22fda42f765f93372f0871fd7e29f0bdbf176a42 (diff)
downloadnettle-83296eb6a45f7dba125372a2ce3c8f4d6c8b9934.tar.gz
Merge branch 'master' into siv-modesiv-mode
The cmac changes on master breaks the previous version of the siv code. Now updated, and improved to use const context arguments for the _message functions.
Diffstat (limited to 'siv-cmac-aes256.c')
-rw-r--r--siv-cmac-aes256.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/siv-cmac-aes256.c b/siv-cmac-aes256.c
index 1fb11ab2..9401bbf1 100644
--- a/siv-cmac-aes256.c
+++ b/siv-cmac-aes256.c
@@ -49,29 +49,29 @@
void
siv_cmac_aes256_set_key(struct siv_cmac_aes256_ctx *ctx, const uint8_t *key)
{
- siv_cmac_set_key(&ctx->siv_cmac.ctx, &ctx->siv_cmac.cipher, &ctx->siv_cipher, &nettle_aes256, key);
+ siv_cmac_set_key(&ctx->cmac_key, &ctx->cmac_cipher, &ctx->ctr_cipher, &nettle_aes256, key);
}
void
-siv_cmac_aes256_encrypt_message(struct siv_cmac_aes256_ctx *ctx,
+siv_cmac_aes256_encrypt_message(const struct siv_cmac_aes256_ctx *ctx,
size_t nlength, const uint8_t *nonce,
size_t alength, const uint8_t *adata,
size_t clength, uint8_t *dst, const uint8_t *src)
{
- siv_cmac_encrypt_message(&ctx->siv_cmac.ctx, &ctx->siv_cmac.cipher,
- &nettle_aes256, &ctx->siv_cipher,
+ siv_cmac_encrypt_message(&ctx->cmac_key, &ctx->cmac_cipher,
+ &nettle_aes256, &ctx->ctr_cipher,
nlength, nonce, alength, adata,
clength, dst, src);
}
int
-siv_cmac_aes256_decrypt_message(struct siv_cmac_aes256_ctx *ctx,
- size_t nlength, const uint8_t *nonce,
- size_t alength, const uint8_t *adata,
- size_t mlength, uint8_t *dst, const uint8_t *src)
+siv_cmac_aes256_decrypt_message(const struct siv_cmac_aes256_ctx *ctx,
+ size_t nlength, const uint8_t *nonce,
+ size_t alength, const uint8_t *adata,
+ size_t mlength, uint8_t *dst, const uint8_t *src)
{
- return siv_cmac_decrypt_message(&ctx->siv_cmac.ctx, &ctx->siv_cmac.cipher,
- &nettle_aes256, &ctx->siv_cipher,
+ return siv_cmac_decrypt_message(&ctx->cmac_key, &ctx->cmac_cipher,
+ &nettle_aes256, &ctx->ctr_cipher,
nlength, nonce, alength, adata,
mlength, dst, src);
}