Fix PAGECOUNT when buf == buflen == 0
[cryptodev-linux.git] / examples / aes.h
blobade90c92b58c5e7f9d8391512f00aa9ea59c1e10
1 #ifndef AES_H
2 # define AES_H
4 #include <stdint.h>
6 struct cryptodev_ctx {
7 int cfd;
8 struct session_op sess;
9 uint16_t alignmask;
12 #define AES_BLOCK_SIZE 16
14 int aes_ctx_init(struct cryptodev_ctx* ctx, int cfd, const uint8_t *key, unsigned int key_size);
15 void aes_ctx_deinit();
16 int aes_encrypt(struct cryptodev_ctx* ctx, const void* iv, const void* plaintext, void* ciphertext, size_t size);
17 int aes_decrypt(struct cryptodev_ctx* ctx, const void* iv, const void* ciphertext, void* plaintext, size_t size);
19 #endif