]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/corecrypto/ccaes.h
xnu-2782.1.97.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccaes.h
1 /*
2 * ccaes.h
3 * corecrypto
4 *
5 * Created by Michael Brouwer on 12/10/10.
6 * Copyright 2010,2011 Apple Inc. All rights reserved.
7 *
8 */
9
10 #ifndef _CORECRYPTO_CCAES_H_
11 #define _CORECRYPTO_CCAES_H_
12
13 #include <corecrypto/cc_config.h>
14 #include <corecrypto/ccmode.h>
15
16 #define CCAES_BLOCK_SIZE 16
17 #define CCAES_KEY_SIZE_128 16
18 #define CCAES_KEY_SIZE_192 24
19 #define CCAES_KEY_SIZE_256 32
20
21 extern const struct ccmode_ecb ccaes_ltc_ecb_decrypt_mode;
22 extern const struct ccmode_ecb ccaes_ltc_ecb_encrypt_mode;
23
24 extern const struct ccmode_cbc ccaes_gladman_cbc_encrypt_mode;
25 extern const struct ccmode_cbc ccaes_gladman_cbc_decrypt_mode;
26
27 #if CCAES_ARM
28 extern const struct ccmode_ecb ccaes_arm_ecb_encrypt_mode;
29 extern const struct ccmode_ecb ccaes_arm_ecb_decrypt_mode;
30
31 extern const struct ccmode_cbc ccaes_arm_cbc_encrypt_mode;
32 extern const struct ccmode_cbc ccaes_arm_cbc_decrypt_mode;
33 #endif
34
35 #if CCAES_MUX
36 extern const struct ccmode_cbc ccaes_ios_hardware_cbc_encrypt_mode;
37 extern const struct ccmode_cbc ccaes_ios_hardware_cbc_decrypt_mode;
38
39 extern const struct ccmode_cbc *ccaes_ios_mux_cbc_encrypt_mode(void);
40 extern const struct ccmode_cbc *ccaes_ios_mux_cbc_decrypt_mode(void);
41 #endif
42
43 #if CCAES_INTEL
44 //extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_mode;
45 //extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_mode;
46
47 extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_opt_mode;
48 extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_aesni_mode;
49
50 extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_opt_mode;
51 extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_aesni_mode;
52
53 //extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_mode;
54 //extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_mode;
55
56 extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_opt_mode;
57 extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_aesni_mode;
58
59 extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_opt_mode;
60 extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_aesni_mode;
61
62 //extern const struct ccmode_xts ccaes_intel_xts_encrypt_mode;
63 //extern const struct ccmode_xts ccaes_intel_xts_decrypt_mode;
64
65 extern const struct ccmode_xts ccaes_intel_xts_encrypt_opt_mode;
66 extern const struct ccmode_xts ccaes_intel_xts_encrypt_aesni_mode;
67
68 extern const struct ccmode_xts ccaes_intel_xts_decrypt_opt_mode;
69 extern const struct ccmode_xts ccaes_intel_xts_decrypt_aesni_mode;
70 #endif
71
72
73 /* Implementation Selectors: */
74 const struct ccmode_ecb *ccaes_ecb_encrypt_mode(void);
75 const struct ccmode_cbc *ccaes_cbc_encrypt_mode(void);
76 const struct ccmode_cfb *ccaes_cfb_encrypt_mode(void);
77 const struct ccmode_cfb8 *ccaes_cfb8_encrypt_mode(void);
78 const struct ccmode_xts *ccaes_xts_encrypt_mode(void);
79 const struct ccmode_gcm *ccaes_gcm_encrypt_mode(void);
80 const struct ccmode_ccm *ccaes_ccm_encrypt_mode(void);
81
82 const struct ccmode_ecb *ccaes_ecb_decrypt_mode(void);
83 const struct ccmode_cbc *ccaes_cbc_decrypt_mode(void);
84 const struct ccmode_cfb *ccaes_cfb_decrypt_mode(void);
85 const struct ccmode_cfb8 *ccaes_cfb8_decrypt_mode(void);
86 const struct ccmode_xts *ccaes_xts_decrypt_mode(void);
87 const struct ccmode_gcm *ccaes_gcm_decrypt_mode(void);
88 const struct ccmode_ccm *ccaes_ccm_decrypt_mode(void);
89
90 const struct ccmode_ctr *ccaes_ctr_crypt_mode(void);
91 const struct ccmode_ofb *ccaes_ofb_crypt_mode(void);
92
93 #endif /* _CORECRYPTO_CCAES_H_ */