zc.c: simplify code a bit by exiting early
[cryptodev-linux.git] / examples / aes-sha1.h
bloba07334cf3a4ae10a38dabd824b492bd9917a757a
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_sha1_ctx_init(struct cryptodev_ctx* ctx, int cfd,
15 const uint8_t *key, unsigned int key_size,
16 const uint8_t *mac_key, unsigned int mac_key_size);
17 void aes_sha1_ctx_deinit();
19 /* Note that encryption assumes that ciphertext has enough size
20 * for the tag and padding to be appended.
22 * Only in-place encryption and decryption are supported.
24 int aes_sha1_encrypt(struct cryptodev_ctx* ctx, const void* iv,
25 const void* auth, size_t auth_size,
26 void* plaintext, size_t size);
27 int aes_sha1_decrypt(struct cryptodev_ctx* ctx, const void* iv,
28 const void* auth, size_t auth_size,
29 void* ciphertext, size_t size);
31 #endif