25 #define ECRYPT_NAME "ChaCha8" 26 #define ECRYPT_PROFILE "_____" 43 #define ECRYPT_MAXKEYSIZE 256 44 #define ECRYPT_KEYSIZE(i) (128 + (i)*128) 46 #define ECRYPT_MAXIVSIZE 64 47 #define ECRYPT_IVSIZE(i) (64 + (i)*64) 153 #define ECRYPT_GENERATES_KEYSTREAM 154 #ifdef ECRYPT_GENERATES_KEYSTREAM 177 #define ECRYPT_USES_DEFAULT_ALL_IN_ONE 192 #define ECRYPT_BLOCKLENGTH 64 194 #define ECRYPT_USES_DEFAULT_BLOCK_MACROS 195 #ifdef ECRYPT_USES_DEFAULT_BLOCK_MACROS 197 #define ECRYPT_encrypt_blocks(ctx, plaintext, ciphertext, blocks) \ 198 ECRYPT_encrypt_bytes(ctx, plaintext, ciphertext, (blocks)*ECRYPT_BLOCKLENGTH) 200 #define ECRYPT_decrypt_blocks(ctx, ciphertext, plaintext, blocks) \ 201 ECRYPT_decrypt_bytes(ctx, ciphertext, plaintext, (blocks)*ECRYPT_BLOCKLENGTH) 203 #ifdef ECRYPT_GENERATES_KEYSTREAM 205 #define ECRYPT_keystream_blocks(ctx, keystream, blocks) \ 206 ECRYPT_keystream_bytes(ctx, keystream, (blocks)*ECRYPT_BLOCKLENGTH) 218 #ifdef ECRYPT_GENERATES_KEYSTREAM 236 #define ECRYPT_MAXVARIANT 1 238 #ifndef ECRYPT_VARIANT 239 #define ECRYPT_VARIANT 1 242 #if (ECRYPT_VARIANT > ECRYPT_MAXVARIANT) 243 #error this variant does not exist void ECRYPT_keystream_bytes(ECRYPT_ctx *ctx, u8 *keystream, u32 length)
Definition: sw_chacha.c:143
void ECRYPT_decrypt_packet(ECRYPT_ctx *ctx, const u8 *iv, const u8 *ciphertext, u8 *plaintext, u32 msglen)
void ECRYPT_init(void)
Definition: sw_chacha.c:59
void ECRYPT_encrypt_bytes(ECRYPT_ctx *ctx, const u8 *plaintext, u8 *ciphertext, u32 msglen)
Definition: sw_chacha.c:102
void ECRYPT_ivsetup(ECRYPT_ctx *ctx, const u8 *iv)
Definition: sw_chacha.c:94
void ECRYPT_encrypt_packet(ECRYPT_ctx *ctx, const u8 *iv, const u8 *plaintext, u8 *ciphertext, u32 msglen)
void ECRYPT_keysetup(ECRYPT_ctx *ctx, const u8 *key, u32 keysize, u32 ivsize)
Definition: sw_chacha.c:67
#define ECRYPT_keystream_blocks(ctx, keystream, blocks)
Definition: sw_ecrypt-sync.h:205
#define ECRYPT_decrypt_blocks(ctx, ciphertext, plaintext, blocks)
Definition: sw_ecrypt-sync.h:200
Definition: sw_ecrypt-sync.h:58
void ECRYPT_decrypt_bytes(ECRYPT_ctx *ctx, const u8 *ciphertext, u8 *plaintext, u32 msglen)
Definition: sw_chacha.c:138
#define ECRYPT_encrypt_blocks(ctx, plaintext, ciphertext, blocks)
Definition: sw_ecrypt-sync.h:197