summaryrefslogtreecommitdiffstats
path: root/src/crypto/cipher.c
diff options
context:
space:
mode:
authorMichael Brown2009-02-18 22:56:02 +0100
committerMichael Brown2009-02-18 23:17:41 +0100
commita3219b24a8ea4699e7b04cf1f1131aade9fcd855 (patch)
treedf3d4cc515e6a02203e8560ff881351daf48111d /src/crypto/cipher.c
parent[crypto] Move AES_convert_key() hack into axtls_aes.c (diff)
downloadipxe-a3219b24a8ea4699e7b04cf1f1131aade9fcd855.tar.gz
ipxe-a3219b24a8ea4699e7b04cf1f1131aade9fcd855.tar.xz
ipxe-a3219b24a8ea4699e7b04cf1f1131aade9fcd855.zip
[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.
Diffstat (limited to 'src/crypto/cipher.c')
-rw-r--r--src/crypto/cipher.c12
1 files changed, 6 insertions, 6 deletions
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 <errno.h>
#include <gpxe/crypto.h>
-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;
}