diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-09-10 00:47:24 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-09-10 00:47:24 +0000 |
commit | 9955b265ab77c712861f33411e521c9761184226 (patch) | |
tree | 3cd11789926945c80a6f34ae0101437fe60cb12b /src/common/crypto.h | |
parent | 67697d5ab197c09f90adafef7d82895cfdbbb085 (diff) | |
download | tor-9955b265ab77c712861f33411e521c9761184226.tar.gz tor-9955b265ab77c712861f33411e521c9761184226.zip |
Make crypto structures private to crypto.c
svn:r437
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r-- | src/common/crypto.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h index 051251329a..f723e71952 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -18,23 +18,8 @@ #define CRYPTO_PK_RSA 0 -typedef struct -{ - int type; - int refs; /* reference counting; so we don't have to copy keys */ - unsigned char *key; - /* auxiliary data structure(s) used by the underlying crypto library */ - unsigned char *aux; -} crypto_pk_env_t; - -typedef struct -{ - int type; - unsigned char *key; - unsigned char *iv; - /* auxiliary data structure(s) used by the underlying crypto library */ - unsigned char *aux; -} crypto_cipher_env_t; +typedef struct crypto_pk_env_t crypto_pk_env_t; +typedef struct crypto_cipher_env_t crypto_cipher_env_t; /* global state */ int crypto_global_init(); @@ -94,6 +79,7 @@ int crypto_cipher_set_iv(crypto_cipher_env_t *env, unsigned char *iv); int crypto_cipher_set_key(crypto_cipher_env_t *env, unsigned char *key); int crypto_cipher_encrypt_init_cipher(crypto_cipher_env_t *env); int crypto_cipher_decrypt_init_cipher(crypto_cipher_env_t *env); +unsigned char *crypto_cipher_get_key(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); |