diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2019-11-08 13:22:20 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-07-07 13:26:36 +0200 |
commit | 8265531e1130bf1b31b88d79c3ba8a734b3b1474 (patch) | |
tree | 67da5de8b2de97e46ccf4c8a184bcdc32d75ac65 | |
parent | 59a36abaa4256381bdd90133d41d38861309aa0a (diff) | |
download | linux-crypto-8265531e1130bf1b31b88d79c3ba8a734b3b1474.tar.gz linux-crypto-8265531e1130bf1b31b88d79c3ba8a734b3b1474.zip |
crypto: x86/poly1305 - unify Poly1305 state struct with generic code
commit cb47ba99195bd0956dc1421df222c4ceb41f2c5c upstream.
In preparation of exposing a Poly1305 library interface directly from
the accelerated x86 driver, align the state descriptor of the x86 code
with the one used by the generic driver. This is needed to make the
library interface unified between all implementations.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | crypto/poly1305_generic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/poly1305_generic.c b/crypto/poly1305_generic.c index 067f493c..f3fcd957 100644 --- a/crypto/poly1305_generic.c +++ b/crypto/poly1305_generic.c @@ -25,7 +25,7 @@ int crypto_poly1305_init(struct shash_desc *desc) poly1305_core_init(&dctx->h); dctx->buflen = 0; - dctx->rset = false; + dctx->rset = 0; dctx->sset = false; return 0; @@ -43,7 +43,7 @@ static void poly1305_blocks(struct poly1305_desc_ctx *dctx, const u8 *src, srclen = datalen; } - poly1305_core_blocks(&dctx->h, &dctx->r, src, + poly1305_core_blocks(&dctx->h, dctx->r, src, srclen / POLY1305_BLOCK_SIZE, 1); } @@ -95,7 +95,7 @@ int crypto_poly1305_final(struct shash_desc *desc, u8 *dst) dctx->buf[dctx->buflen++] = 1; memset(dctx->buf + dctx->buflen, 0, POLY1305_BLOCK_SIZE - dctx->buflen); - poly1305_core_blocks(&dctx->h, &dctx->r, dctx->buf, 1, 0); + poly1305_core_blocks(&dctx->h, dctx->r, dctx->buf, 1, 0); } poly1305_core_emit(&dctx->h, digest); |