Added Appro's SSSE3 SHA implementations
[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                         int rounds:4;
13                         int dgst:1;     /* n/a in C3 */
14                         int align:1;    /* n/a in C3 */
15                         int ciphr:1;    /* n/a in C3 */
16                         unsigned int keygen:1;
17                         int interm:1;
18                         unsigned int encdec:1;
19                         int 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 aes_gcm_padlock_struct;
31 extern const gnutls_crypto_mac_st hmac_sha_padlock_struct;
32 extern const gnutls_crypto_digest_st sha_padlock_struct;
33
34 int padlock_aes_cipher_setkey(void *_ctx, const void *userkey,
35                               size_t keysize);
36
37 /* asm */
38 unsigned int padlock_capability(void);
39 void padlock_reload_key(void);
40 int padlock_ecb_encrypt(void *out, const void *inp,
41                         struct padlock_cipher_data *ctx, size_t len);
42 int padlock_cbc_encrypt(void *out, const void *inp,
43                         struct padlock_cipher_data *ctx, size_t len);
44 #endif