diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2023-01-04 19:39:23 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2023-01-04 19:48:52 +0200 |
commit | 86db4b02c6e5fd41ae958fb5e1fcf3e296a820ad (patch) | |
tree | 275e9f2a54244f6faee4959b73c89f9ee9ac0be2 /cipher/twofish.c | |
parent | d1ccc409d4c655f695c7dc042a629a8898bd14eb (diff) | |
download | libgcrypt-86db4b02c6e5fd41ae958fb5e1fcf3e296a820ad.tar.gz |
bulkhelp: change bulk function definition to allow modifying context
* cipher/bulkhelp.h (bulk_crypt_fn_t): Make 'ctx' non-constant and
change 'num_blks' from 'unsigned int' to 'size_t'.
* cipher/camellia-glue.c (camellia_encrypt_blk1_32)
(camellia_encrypt_blk1_64, camellia_decrypt_blk1_32)
(camellia_decrypt_blk1_64): Adjust to match 'bulk_crypt_fn_t'.
* cipher/serpent.c (serpent_crypt_blk1_16, serpent_encrypt_blk1_16)
(serpent_decrypt_blk1_16): Likewise.
* cipher/sm4.c (crypt_blk1_16_fn_t, _gcry_sm4_aesni_avx_crypt_blk1_8)
(sm4_aesni_avx_crypt_blk1_16, _gcry_sm4_aesni_avx2_crypt_blk1_16)
(sm4_aesni_avx2_crypt_blk1_16, _gcry_sm4_gfni_avx2_crypt_blk1_16)
(sm4_gfni_avx2_crypt_blk1_16, _gcry_sm4_gfni_avx512_crypt_blk1_16)
(_gcry_sm4_gfni_avx512_crypt_blk32, sm4_gfni_avx512_crypt_blk1_16)
(_gcry_sm4_aarch64_crypt_blk1_8, sm4_aarch64_crypt_blk1_16)
(_gcry_sm4_armv8_ce_crypt_blk1_8, sm4_armv8_ce_crypt_blk1_16)
(_gcry_sm4_armv9_sve_ce_crypt, sm4_armv9_sve_ce_crypt_blk1_16)
(sm4_crypt_blocks, sm4_crypt_blk1_32, sm4_encrypt_blk1_32)
(sm4_decrypt_blk1_32): Likewise.
* cipher/twofish.c (twofish_crypt_blk1_16, twofish_encrypt_blk1_16)
(twofish_decrypt_blk1_16): Likewise.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/twofish.c')
-rw-r--r-- | cipher/twofish.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cipher/twofish.c b/cipher/twofish.c index 92c463fc..e5eae770 100644 --- a/cipher/twofish.c +++ b/cipher/twofish.c @@ -1541,10 +1541,10 @@ _gcry_twofish_ocb_auth (gcry_cipher_hd_t c, const void *abuf_arg, static unsigned int -twofish_crypt_blk1_16(const void *context, byte *out, const byte *in, - unsigned int num_blks, int encrypt) +twofish_crypt_blk1_16(void *context, byte *out, const byte *in, + size_t num_blks, int encrypt) { - const TWOFISH_context *ctx = context; + TWOFISH_context *ctx = context; unsigned int burn, burn_stack_depth = 0; #ifdef USE_AVX2 @@ -1584,15 +1584,15 @@ twofish_crypt_blk1_16(const void *context, byte *out, const byte *in, } static unsigned int -twofish_encrypt_blk1_16(const void *ctx, byte *out, const byte *in, - unsigned int num_blks) +twofish_encrypt_blk1_16(void *ctx, byte *out, const byte *in, + size_t num_blks) { return twofish_crypt_blk1_16 (ctx, out, in, num_blks, 1); } static unsigned int -twofish_decrypt_blk1_16(const void *ctx, byte *out, const byte *in, - unsigned int num_blks) +twofish_decrypt_blk1_16(void *ctx, byte *out, const byte *in, + size_t num_blks) { return twofish_crypt_blk1_16 (ctx, out, in, num_blks, 0); } |