My Project
Loading...
Searching...
No Matches
chacha.h File Reference

Go to the source code of this file.

Data Structures

struct  ChaCha
 

Typedefs

typedef struct ChaCha ChaCha
 

Functions

WOLFSSL_API int wc_Chacha_SetIV (ChaCha *ctx, const byte *inIv, word32 counter)
 This function sets the initialization vector (nonce) for a ChaCha object, initializing it for use as a cipher. It should be called after the key has been set, using wc_Chacha_SetKey. A difference nonce should be used for each round of encryption.
 
WOLFSSL_API int wc_Chacha_Process (ChaCha *ctx, byte *cipher, const byte *plain, word32 msglen)
 This function processes the text from the buffer input, encrypts or decrypts it, and stores the result in the buffer output.
 
WOLFSSL_API int wc_Chacha_SetKey (ChaCha *ctx, const byte *key, word32 keySz)
 This function sets the key for a ChaCha object, initializing it for use as a cipher. It should be called before setting the nonce with wc_Chacha_SetIV, and before using it for encryption with wc_Chacha_Process.
 

Variables

 C
 

Variable Documentation

◆ C

C
extern
Initial value:
{
#endif
#define CHACHA_IV_WORDS 3
#define CHACHA_IV_BYTES (CHACHA_IV_WORDS * sizeof(word32))
#define CHACHA_CHUNK_WORDS 16
#define CHACHA_CHUNK_BYTES (CHACHA_CHUNK_WORDS * sizeof(word32))
#ifdef WOLFSSL_X86_64_BUILD
#if defined(USE_INTEL_SPEEDUP) && !defined(NO_CHACHA_ASM)
#endif
#endif
enum {
CHACHA_ENC_TYPE = WC_CIPHER_CHACHA,
CHACHA_MAX_KEY_SZ = 32,
}