2.7.1.1 Crypto_Sym_ChaCha20_Init

crypto_Sym_Status_E Crypto_Sym_ChaCha20_Init(
    st_Crypto_Sym_StreamCtx *ptr_chaChaCtx_st, 
    crypto_HandlerType_E handlerType_en, 
    uint8_t *ptr_key, 
    uint8_t *ptr_initVect, 
    uint32_t sessionID
    );

Description

This API is used to initiate the ChaCha20 algorithm parameters for the context.

Parameters

No.Argument TypeArgument NameTypeDescription
1st_Crypto_Sym_StreamCtx*ptr_chaChaCtx_stInputChaCha20 algorithm context
2crypto_HandlerType_EhandlerType_enInputEnum for crypto operation handler i.e., SW, HW
3uint8_t*ptr_keyInputKey for the Symmetric operation (32 bytes for Chacha20)
4uint8_t*ptr_initVectInputInitialization vector where 96 bits are Nonce, and 32 bits are counter
5uint32_tsessionIDInputIt defines the session ID, must be more than zero

Returns

Return TypeDescription
crypto_Sym_Status_EFunction returns the status of the API.

Example

crypto_Sym_Status_E status;
status = Crypto_Sym_ChaCha20_Init(
    &ptr_chaChaCtx_st, 
    handlerType_en, 
    ptr_key, 
    ptr_initVect, 
    sessionID
    );