Symmetric encryption services; combined cipher AES+TWOFISH (256-bit each) More...
Go to the source code of this file.
Macros | |
| #define | LOG(kind, ...) |
Functions | |
| void | GNUNET_CRYPTO_symmetric_create_session_key (struct GNUNET_CRYPTO_SymmetricSessionKey *key) |
| Create a new SessionKey (for symmetric encryption). | |
| static int | setup_cipher_aes (gcry_cipher_hd_t *handle, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv) |
| Initialize AES cipher. | |
| static int | setup_cipher_twofish (gcry_cipher_hd_t *handle, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv) |
| Initialize TWOFISH cipher. | |
| ssize_t | GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t size, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, void *result) |
| Encrypt a block using a symmetric sessionkey. | |
| ssize_t | GNUNET_CRYPTO_symmetric_decrypt (const void *block, size_t size, const struct GNUNET_CRYPTO_SymmetricSessionKey *sessionkey, const struct GNUNET_CRYPTO_SymmetricInitializationVector *iv, void *result) |
| Decrypt a given block using a symmetric sessionkey. | |
| void | GNUNET_CRYPTO_aes_ctr (const void *in_buf, size_t in_buf_len, const unsigned char key[GNUNET_CRYPTO_AES_KEY_LENGTH], const unsigned char iv[GNUNET_CRYPTO_AES_IV_LENGTH], void *out_buf) |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_xsalsa20poly1305_decrypt (size_t in_buf_len, const unsigned char in_buf[in_buf_len], const unsigned char key[GNUNET_CRYPTO_XSALSA20_KEY_LENGTH], const unsigned char nonce[GNUNET_CRYPTO_XSALSA20_IV_LENGTH], void *out_buf) |
| enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_xsalsa20poly1305_encrypt (size_t in_buf_len, const unsigned char in_buf[in_buf_len], const unsigned char key[GNUNET_CRYPTO_XSALSA20_KEY_LENGTH], const unsigned char nonce[GNUNET_CRYPTO_XSALSA20_IV_LENGTH], void *out_buf) |
Symmetric encryption services; combined cipher AES+TWOFISH (256-bit each)
Definition in file crypto_symmetric.c.
| #define LOG | ( | kind, | |
| ... | |||
| ) |
Definition at line 33 of file crypto_symmetric.c.
|
static |
Initialize AES cipher.
| handle | handle to initialize |
| sessionkey | session key to use |
| iv | initialization vector to use |
Definition at line 64 of file crypto_symmetric.c.
References GNUNET_CRYPTO_SymmetricInitializationVector::aes_iv, GNUNET_CRYPTO_SymmetricSessionKey::aes_key, GNUNET_assert, GNUNET_OK, and handle.
Referenced by GNUNET_CRYPTO_symmetric_decrypt(), and GNUNET_CRYPTO_symmetric_encrypt().
|
static |
Initialize TWOFISH cipher.
| handle | handle to initialize |
| sessionkey | session key to use |
| iv | initialization vector to use |
Definition at line 94 of file crypto_symmetric.c.
References GNUNET_assert, GNUNET_OK, handle, GNUNET_CRYPTO_SymmetricInitializationVector::twofish_iv, and GNUNET_CRYPTO_SymmetricSessionKey::twofish_key.
Referenced by GNUNET_CRYPTO_symmetric_decrypt(), and GNUNET_CRYPTO_symmetric_encrypt().
| void GNUNET_CRYPTO_aes_ctr | ( | const void * | in_buf, |
| size_t | in_buf_len, | ||
| const unsigned char | key[GNUNET_CRYPTO_AES_KEY_LENGTH], | ||
| const unsigned char | iv[GNUNET_CRYPTO_AES_IV_LENGTH], | ||
| void * | out_buf | ||
| ) |
Definition at line 170 of file crypto_symmetric.c.
References GNUNET_assert, GNUNET_CRYPTO_AES_IV_LENGTH, GNUNET_CRYPTO_AES_KEY_LENGTH, handle, and key.
| enum GNUNET_GenericReturnValue GNUNET_CRYPTO_xsalsa20poly1305_decrypt | ( | size_t | in_buf_len, |
| const unsigned char | in_buf[in_buf_len], | ||
| const unsigned char | key[GNUNET_CRYPTO_XSALSA20_KEY_LENGTH], | ||
| const unsigned char | nonce[GNUNET_CRYPTO_XSALSA20_IV_LENGTH], | ||
| void * | out_buf | ||
| ) |
Definition at line 197 of file crypto_symmetric.c.
References GNUNET_OK, GNUNET_SYSERR, and key.
| enum GNUNET_GenericReturnValue GNUNET_CRYPTO_xsalsa20poly1305_encrypt | ( | size_t | in_buf_len, |
| const unsigned char | in_buf[in_buf_len], | ||
| const unsigned char | key[GNUNET_CRYPTO_XSALSA20_KEY_LENGTH], | ||
| const unsigned char | nonce[GNUNET_CRYPTO_XSALSA20_IV_LENGTH], | ||
| void * | out_buf | ||
| ) |
Definition at line 223 of file crypto_symmetric.c.
References GNUNET_OK, GNUNET_SYSERR, and key.