diff options
author | Ben Laurie <ben@openssl.org> | 2003-07-29 17:05:16 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2003-07-29 17:05:16 +0000 |
commit | f3b2ea53e28ffed640ff9a929676b233d9b94837 (patch) | |
tree | 876d219db80a309fac9a7a56ce70a5875770eee6 /crypto/aes | |
parent | ed717699486f7c104628e0c4c8f8c0cfa4cfac1b (diff) |
AES CFB8.
Diffstat (limited to 'crypto/aes')
-rw-r--r-- | crypto/aes/aes.h | 3 | ||||
-rw-r--r-- | crypto/aes/aes_cfb.c | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/crypto/aes/aes.h b/crypto/aes/aes.h index 4ac943e9a8..5e177a3dd8 100644 --- a/crypto/aes/aes.h +++ b/crypto/aes/aes.h @@ -98,6 +98,9 @@ void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, const unsigned long length, const AES_KEY *key, unsigned char *ivec, int *num, const int enc); +void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc); void AES_cfbr_encrypt_block(const unsigned char *in,unsigned char *out, const int nbits,const AES_KEY *key, unsigned char *ivec,const int enc); diff --git a/crypto/aes/aes_cfb.c b/crypto/aes/aes_cfb.c index bd61aa8229..31d7e2dd77 100644 --- a/crypto/aes/aes_cfb.c +++ b/crypto/aes/aes_cfb.c @@ -222,6 +222,7 @@ void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, { unsigned int n; unsigned char c[1],d[1]; + assert(in && out && key && ivec && num); assert(*num == 0); @@ -234,3 +235,16 @@ void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, } } +void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, + const unsigned long length, const AES_KEY *key, + unsigned char *ivec, int *num, const int enc) + { + unsigned int n; + + assert(in && out && key && ivec && num); + assert(*num == 0); + + for(n=0 ; n < length ; ++n) + AES_cfbr_encrypt_block(&in[n],&out[n],8,key,ivec,enc); + } + |