diff options
author | Andy Polyakov <appro@openssl.org> | 2008-12-16 08:39:21 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2008-12-16 08:39:21 +0000 |
commit | 85b2c0ce7fdf597d60d8c366e8f7de24f674fc5a (patch) | |
tree | 5b1c0c5457eb67faaa69696308c44bc5c8e8d31e /crypto/modes/modes.h | |
parent | f826bf779854ab9375f89a74d77f0142bf6944ae (diff) | |
download | openssl-85b2c0ce7fdf597d60d8c366e8f7de24f674fc5a.tar.gz |
128-bit block cipher modes consolidation. As consolidated functions
rely on indirect call to block functions, they are not as fast as
non-consolidated routines. However, performance loss(*) is within
measurement error and consolidation advantages are considered to
outweigh it.
(*) actually one can observe performance *improvement* on e.g.
CBC benchmarks thanks to optimization, which also becomes
shared among ciphers.
Diffstat (limited to 'crypto/modes/modes.h')
-rw-r--r-- | crypto/modes/modes.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/crypto/modes/modes.h b/crypto/modes/modes.h new file mode 100644 index 0000000000..87e0ec6115 --- /dev/null +++ b/crypto/modes/modes.h @@ -0,0 +1,34 @@ +typedef void (*block_f)(const unsigned char in[16], + unsigned char out[16], + const void *key); + +void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block_f block); +void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], block_f block); + +void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], unsigned char ecount_buf[16], + unsigned int *num, block_f block); + +void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int *num, + block_f block); + +void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const void *key, + unsigned char ivec[16], int *num, + int enc, block_f block); +void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const void *key, + unsigned char ivec[16], int *num, + int enc, block_f block); +void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, + size_t bits, const void *key, + unsigned char ivec[16], int *num, + int enc, block_f block); + |