22#ifndef CRYPT_EAL_CIPHER_H
23#define CRYPT_EAL_CIPHER_H
27#include "crypt_algid.h"
28#include "crypt_types.h"
34typedef struct CRYPT_EAL_CipherCtxLocal CRYPT_EAL_CipherCtx;
103 uint32_t ivLen,
bool enc);
CRYPT_EAL_CipherCtx * CRYPT_EAL_ProviderCipherNewCtx(CRYPT_EAL_LibCtx *libCtx, int32_t algId, const char *attrName)
Generate symmetric encryption and decryption handles in the providers
int32_t CRYPT_EAL_CipherCopyCtx(CRYPT_EAL_CipherCtx *to, const CRYPT_EAL_CipherCtx *from)
Copy the cipher context.
int32_t CRYPT_EAL_CipherGetInfo(CRYPT_CIPHER_AlgId id, int32_t type, uint32_t *infoValue)
Obtain the type of an algorithm based on the algorithm ID.
int32_t CRYPT_EAL_CipherGetPadding(CRYPT_EAL_CipherCtx *ctx)
Obtain the padding type.
int32_t CRYPT_EAL_CipherInit(CRYPT_EAL_CipherCtx *ctx, const uint8_t *key, uint32_t keyLen, const uint8_t *iv, uint32_t ivLen, bool enc)
Initialize the symmetric encryption/decryption handle. The key cannot be null. Except the ECB mode,...
int32_t CRYPT_EAL_CipherUpdate(CRYPT_EAL_CipherCtx *ctx, const uint8_t *in, uint32_t inLen, uint8_t *out, uint32_t *outLen)
int32_t CRYPT_EAL_CipherCtrl(CRYPT_EAL_CipherCtx *ctx, int32_t type, void *data, uint32_t len)
void CRYPT_EAL_CipherDeinit(CRYPT_EAL_CipherCtx *ctx)
Deinitialize the handle and restore the handle to the state, when the CRYPT_EAL_CipherNewCtx function...
CRYPT_EAL_CipherCtx * CRYPT_EAL_CipherDupCtx(const CRYPT_EAL_CipherCtx *from)
Dup the cipher context.
int32_t CRYPT_EAL_CipherSetPadding(CRYPT_EAL_CipherCtx *ctx, CRYPT_PaddingType type)
Set the padding mode.
void CRYPT_EAL_CipherFreeCtx(CRYPT_EAL_CipherCtx *ctx)
Release the symmetric encryption/decryption handle. Clear sensitive information before releasing the ...
int32_t CRYPT_EAL_CipherReinit(CRYPT_EAL_CipherCtx *ctx, uint8_t *iv, uint32_t ivLen)
CRYPT_EAL_CipherCtx * CRYPT_EAL_CipherNewCtx(CRYPT_CIPHER_AlgId id)
Generate symmetric encryption and decryption handles.
bool CRYPT_EAL_CipherIsValidAlgId(CRYPT_CIPHER_AlgId id)
Check whether the given symmetric algorithm ID is valid.
int32_t CRYPT_EAL_CipherFinal(CRYPT_EAL_CipherCtx *ctx, uint8_t *out, uint32_t *outLen)
Fill the data with the size of the block and output the encrypted data; the AEAD tag is obtained thro...