From a3219b24a8ea4699e7b04cf1f1131aade9fcd855 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 18 Feb 2009 21:56:02 +0000 Subject: [crypto] Split crypto_algorithm into {digest,cipher,pubkey}_algorithm The various types of cryptographic algorithm are fundamentally different, and it was probably a mistake to try to handle them via a single common type. pubkey_algorithm is a placeholder type for now. --- src/crypto/cipher.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/crypto/cipher.c') diff --git a/src/crypto/cipher.c b/src/crypto/cipher.c index 9c392009a..f83a6d0ff 100644 --- a/src/crypto/cipher.c +++ b/src/crypto/cipher.c @@ -2,23 +2,23 @@ #include #include -int cipher_encrypt ( struct crypto_algorithm *crypto, +int cipher_encrypt ( struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len ) { - if ( ( len & ( crypto->blocksize - 1 ) ) ) { + if ( ( len & ( cipher->blocksize - 1 ) ) ) { return -EINVAL; } - crypto->encode ( ctx, src, dst, len ); + cipher->encrypt ( ctx, src, dst, len ); return 0; } -int cipher_decrypt ( struct crypto_algorithm *crypto, +int cipher_decrypt ( struct cipher_algorithm *cipher, void *ctx, const void *src, void *dst, size_t len ) { - if ( ( len & ( crypto->blocksize - 1 ) ) ) { + if ( ( len & ( cipher->blocksize - 1 ) ) ) { return -EINVAL; } - crypto->decode ( ctx, src, dst, len ); + cipher->decrypt ( ctx, src, dst, len ); return 0; } -- cgit v1.2.3-55-g7522