MC3302_SDK_V1.1.9_202507281.../bsp/test/crypto/aes.h
2025-11-11 12:08:31 +08:00

20 lines
545 B
C
Executable File

#ifndef AES_H
# define AES_H
#include <stdint.h>
struct cryptodev_ctx {
int cfd;
struct session_op sess;
uint16_t alignmask;
};
#define AES_BLOCK_SIZE 16
int aes_ctx_init(struct cryptodev_ctx* ctx, int cfd, const char *key, unsigned int key_size,enum cryptodev_crypto_op_t alg);
void aes_ctx_deinit();
int aes_encrypt(struct cryptodev_ctx* ctx, const void* iv, const void* plaintext, void* ciphertext, size_t size);
int aes_decrypt(struct cryptodev_ctx* ctx, const void* iv, const void* ciphertext, void* plaintext, size_t size);
#endif