summaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorMichael Brown2009-02-18 23:27:34 +0100
committerMichael Brown2009-02-19 01:06:41 +0100
commitb4d3d686cc67c2503976ec4c854efc3a20519203 (patch)
treec194d6d6a4b6fb93fae56bc6ac9a81607048861d /src/crypto
parent[crypto] Split crypto_algorithm into {digest,cipher,pubkey}_algorithm (diff)
downloadipxe-b4d3d686cc67c2503976ec4c854efc3a20519203.tar.gz
ipxe-b4d3d686cc67c2503976ec4c854efc3a20519203.tar.xz
ipxe-b4d3d686cc67c2503976ec4c854efc3a20519203.zip
[crypto] Change cipher_{en,de}crypt() to void functions
It is a programming error, not a runtime error, if we attempt to use block ciphers with an incorrect blocksize, so use an assert() rather than an error status return.
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/cipher.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/crypto/cipher.c b/src/crypto/cipher.c
deleted file mode 100644
index f83a6d0f..00000000
--- a/src/crypto/cipher.c
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdint.h>
-#include <errno.h>
-#include <gpxe/crypto.h>
-
-int cipher_encrypt ( struct cipher_algorithm *cipher,
- void *ctx, const void *src, void *dst,
- size_t len ) {
- if ( ( len & ( cipher->blocksize - 1 ) ) ) {
- return -EINVAL;
- }
- cipher->encrypt ( ctx, src, dst, len );
- return 0;
-}
-
-int cipher_decrypt ( struct cipher_algorithm *cipher,
- void *ctx, const void *src, void *dst,
- size_t len ) {
- if ( ( len & ( cipher->blocksize - 1 ) ) ) {
- return -EINVAL;
- }
- cipher->decrypt ( ctx, src, dst, len );
- return 0;
-}
-