~ubuntu-branches/ubuntu/precise/gnutls28/precise

« back to all changes in this revision

Viewing changes to lib/accelerated/intel/aes-padlock.h

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-09-20 19:37:06 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20110920193706-a9phjijvddzg3nkl
Tags: 3.0.3-1
* New upstream version. (Includes a fix for #640639)
* Bump shlibs.

Show diffs side-by-side

added added

removed removed

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