36 return aes_new_cipher((
const uint8_t*)key, (
const uint8_t*)iv, bits);
57 memset(zeroiv, 0,
sizeof(zeroiv));
89 const char *from,
size_t fromlen)
98 memcpy(to, from, fromlen);
99 aes_crypt_inplace(env, to, fromlen);
109 const char *from,
size_t fromlen)
116 memcpy(to, from, fromlen);
117 aes_crypt_inplace(env, to, fromlen);
128 aes_crypt_inplace(env, buf, len);
139 char *to,
size_t tolen,
140 const char *from,
size_t fromlen)
142 crypto_cipher_t *cipher;
158 crypto_cipher_free(cipher);
171 char *to,
size_t tolen,
172 const char *from,
size_t fromlen)
174 crypto_cipher_t *cipher;
188 crypto_cipher_free(cipher);
int crypto_cipher_decrypt_with_iv(const char *key, char *to, size_t tolen, const char *from, size_t fromlen)
crypto_cipher_t * crypto_cipher_new(const char *key)
void crypto_cipher_crypt_inplace(crypto_cipher_t *env, char *buf, size_t len)
crypto_cipher_t * crypto_cipher_new_with_bits(const char *key, int bits)
int crypto_cipher_decrypt(crypto_cipher_t *env, char *to, const char *from, size_t fromlen)
int crypto_cipher_encrypt_with_iv(const char *key, char *to, size_t tolen, const char *from, size_t fromlen)
crypto_cipher_t * crypto_cipher_new_with_iv_and_bits(const uint8_t *key, const uint8_t *iv, int bits)
int crypto_cipher_encrypt(crypto_cipher_t *env, char *to, const char *from, size_t fromlen)
void crypto_cipher_free_(crypto_cipher_t *env)
crypto_cipher_t * crypto_cipher_new_with_iv(const char *key, const char *iv)
Headers for crypto_cipher.c.
void crypto_rand(char *to, size_t n)
Common functions for using (pseudo-)random number generators.
void memwipe(void *mem, uint8_t byte, size_t sz)
Common functions for cryptographic routines.
Integer definitions used throughout Tor.
Macros to manage assertions, fatal and non-fatal.