aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-06-30 19:18:32 +0000
committerNick Mathewson <nickm@torproject.org>2003-06-30 19:18:32 +0000
commit300984c05773084b3a70de88c8deedd8723645e7 (patch)
treed3f48c44f886bafa9dc7b2d283866acdf3457fcf /src/common/crypto.h
parenta0f15883187da1a381e5a5e1495373b0d30ff636 (diff)
downloadtor-300984c05773084b3a70de88c8deedd8723645e7.tar
tor-300984c05773084b3a70de88c8deedd8723645e7.tar.gz
Add AES counter-mode support to the crypt library
svn:r362
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index b71ed902f..50b2c9540 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -13,6 +13,7 @@
#define CRYPTO_CIPHER_DES 1
#define CRYPTO_CIPHER_RC4 2
#define CRYPTO_CIPHER_3DES 3
+#define CRYPTO_CIPHER_AES_CTR 4
#define CRYPTO_PK_RSA 0
@@ -93,6 +94,9 @@ int crypto_cipher_decrypt_init_cipher(crypto_cipher_env_t *env);
int crypto_cipher_encrypt(crypto_cipher_env_t *env, unsigned char *from, unsigned int fromlen, unsigned char *to);
int crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *from, unsigned int fromlen, unsigned char *to);
+/* only implemented for CRYPTO_CIPHER_AES_CTR */
+int crypto_cipher_advance(crypto_cipher_env_t *env, long delta);
+
/* convenience function: wraps crypto_create_crypto_env, set_key, set_iv, and init. */
crypto_cipher_env_t *crypto_create_init_cipher(int cipher_type, char *key, char *iv, int encrypt_mode);