summaryrefslogtreecommitdiff
path: root/twofish.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2010-07-07 21:32:03 +0200
committerNiels Möller <nisse@lysator.liu.se>2010-07-07 21:32:03 +0200
commitc8f4cc3588e534cf5dfe8163113e16c64fe33b29 (patch)
tree459efa3ceddf45d0d7174087bd5050cbc40391cd /twofish.c
parent99db053679b4daceb4a43d96955cb59a225912fa (diff)
downloadnettle-c8f4cc3588e534cf5dfe8163113e16c64fe33b29.tar.gz
* aes.h (aes_encrypt, aes_decrypt): Declare ctx argument as const.
Also updated implementation. * blowfish.h (blowfish_encrypt, blowfish_decrypt): Likewise. * cast128.h (cast128_encrypt, cast128_decrypt): Likewise. * serpent.h (serpent_encrypt, serpent_decrypt): Likewise. * twofish.h (twofish_encrypt, twofish_decrypt): Likewise. Rev: nettle/ChangeLog:1.91 Rev: nettle/aes-decrypt.c:1.2 Rev: nettle/aes-encrypt.c:1.2 Rev: nettle/aes.h:1.2 Rev: nettle/blowfish.c:1.3 Rev: nettle/blowfish.h:1.3 Rev: nettle/cast128.c:1.2 Rev: nettle/cast128.h:1.2 Rev: nettle/serpent.c:1.2 Rev: nettle/serpent.h:1.2 Rev: nettle/twofish.c:1.2 Rev: nettle/twofish.h:1.2
Diffstat (limited to 'twofish.c')
-rw-r--r--twofish.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/twofish.c b/twofish.c
index c7d05a13..0e519eab 100644
--- a/twofish.c
+++ b/twofish.c
@@ -333,13 +333,13 @@ twofish_set_key(struct twofish_ctx *context,
*/
void
-twofish_encrypt(struct twofish_ctx *context,
+twofish_encrypt(const struct twofish_ctx *context,
unsigned length,
uint8_t *ciphertext,
const uint8_t *plaintext)
{
- uint32_t * keys = context->keys;
- uint32_t (*s_box)[256] = context->s_box;
+ const uint32_t * keys = context->keys;
+ const uint32_t (*s_box)[256] = context->s_box;
assert( !(length % TWOFISH_BLOCK_SIZE) );
for ( ; length; length -= TWOFISH_BLOCK_SIZE)
@@ -403,14 +403,14 @@ twofish_encrypt(struct twofish_ctx *context,
*/
void
-twofish_decrypt(struct twofish_ctx *context,
+twofish_decrypt(const struct twofish_ctx *context,
unsigned length,
uint8_t *plaintext,
const uint8_t *ciphertext)
{
- uint32_t *keys = context->keys;
- uint32_t (*s_box)[256] = context->s_box;
+ const uint32_t *keys = context->keys;
+ const uint32_t (*s_box)[256] = context->s_box;
assert( !(length % TWOFISH_BLOCK_SIZE) );
for ( ; length; length -= TWOFISH_BLOCK_SIZE)