latex doc: updated copyright dates
[gnutls:gnutls.git] / lib / accelerated / x86 / aes-padlock.h
1 #ifndef AES_PADLOCK_H
2 #define AES_PADLOCK_H
3
4 #include <gnutls_int.h>
5 #include <aes-x86.h>
6
7 struct padlock_cipher_data {
8         unsigned char iv[16];   /* Initialization vector */
9         union {
10                 unsigned int pad[4];
11                 struct {
12                         unsigned rounds:4;
13                         unsigned dgst:1;        /* n/a in C3 */
14                         unsigned align:1;       /* n/a in C3 */
15                         unsigned ciphr:1;       /* n/a in C3 */
16                         unsigned int keygen:1;
17                         unsigned interm:1;
18                         unsigned int encdec:1;
19                         unsigned ksize:2;
20                 } b;
21         } cword;                /* Control word */
22         AES_KEY ks;             /* Encryption key */
23 };
24
25 struct padlock_ctx {
26         struct padlock_cipher_data expanded_key;
27         int enc;
28 };
29
30 extern const gnutls_crypto_cipher_st _gnutls_aes_padlock;
31 extern const gnutls_crypto_cipher_st _gnutls_aes_gcm_padlock;
32
33 extern const gnutls_crypto_mac_st _gnutls_hmac_sha_padlock;
34 extern const gnutls_crypto_digest_st _gnutls_sha_padlock;
35
36 int padlock_aes_cipher_setkey(void *_ctx, const void *userkey,
37                               size_t keysize);
38
39 /* asm */
40 unsigned int padlock_capability(void);
41 void padlock_reload_key(void);
42 int padlock_ecb_encrypt(void *out, const void *inp,
43                         struct padlock_cipher_data *ctx, size_t len);
44 int padlock_cbc_encrypt(void *out, const void *inp,
45                         struct padlock_cipher_data *ctx, size_t len);
46 #endif