]>
Commit | Line | Data |
---|---|---|
316670eb A |
1 | /* |
2 | * ccaes.h | |
3 | * corecrypto | |
4 | * | |
3e170ce0 A |
5 | * Created on 12/10/2010 |
6 | * | |
7 | * Copyright (c) 2010,2011,2012,2013,2015 Apple Inc. All rights reserved. | |
316670eb A |
8 | * |
9 | */ | |
10 | ||
11 | #ifndef _CORECRYPTO_CCAES_H_ | |
12 | #define _CORECRYPTO_CCAES_H_ | |
13 | ||
14 | #include <corecrypto/cc_config.h> | |
15 | #include <corecrypto/ccmode.h> | |
16 | ||
17 | #define CCAES_BLOCK_SIZE 16 | |
18 | #define CCAES_KEY_SIZE_128 16 | |
19 | #define CCAES_KEY_SIZE_192 24 | |
20 | #define CCAES_KEY_SIZE_256 32 | |
21 | ||
5ba3f43e A |
22 | #define CCAES_CTR_MAX_PARALLEL_NBLOCKS 8 |
23 | ||
316670eb A |
24 | extern const struct ccmode_ecb ccaes_ltc_ecb_decrypt_mode; |
25 | extern const struct ccmode_ecb ccaes_ltc_ecb_encrypt_mode; | |
26 | ||
27 | extern const struct ccmode_cbc ccaes_gladman_cbc_encrypt_mode; | |
28 | extern const struct ccmode_cbc ccaes_gladman_cbc_decrypt_mode; | |
29 | ||
39037602 | 30 | #if CCAES_ARM_ASM |
316670eb A |
31 | extern const struct ccmode_ecb ccaes_arm_ecb_encrypt_mode; |
32 | extern const struct ccmode_ecb ccaes_arm_ecb_decrypt_mode; | |
33 | ||
34 | extern const struct ccmode_cbc ccaes_arm_cbc_encrypt_mode; | |
35 | extern const struct ccmode_cbc ccaes_arm_cbc_decrypt_mode; | |
3e170ce0 A |
36 | |
37 | extern const struct ccmode_xts ccaes_arm_xts_encrypt_mode; | |
38 | extern const struct ccmode_xts ccaes_arm_xts_decrypt_mode; | |
39 | ||
40 | extern const struct ccmode_cfb ccaes_arm_cfb_encrypt_mode; | |
41 | extern const struct ccmode_cfb ccaes_arm_cfb_decrypt_mode; | |
42 | ||
43 | extern const struct ccmode_ofb ccaes_arm_ofb_crypt_mode; | |
44 | ||
316670eb A |
45 | #endif |
46 | ||
fe8ab488 A |
47 | #if CCAES_MUX |
48 | extern const struct ccmode_cbc ccaes_ios_hardware_cbc_encrypt_mode; | |
49 | extern const struct ccmode_cbc ccaes_ios_hardware_cbc_decrypt_mode; | |
50 | ||
5ba3f43e A |
51 | extern const struct ccmode_ctr ccaes_ios_hardware_ctr_crypt_mode; |
52 | ||
fe8ab488 A |
53 | extern const struct ccmode_cbc *ccaes_ios_mux_cbc_encrypt_mode(void); |
54 | extern const struct ccmode_cbc *ccaes_ios_mux_cbc_decrypt_mode(void); | |
5ba3f43e A |
55 | |
56 | extern const struct ccmode_ctr *ccaes_ios_mux_ctr_crypt_mode(void); | |
57 | ||
fe8ab488 A |
58 | #endif |
59 | ||
39037602 | 60 | #if CCAES_INTEL_ASM |
316670eb A |
61 | //extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_mode; |
62 | //extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_mode; | |
63 | ||
64 | extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_opt_mode; | |
65 | extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_aesni_mode; | |
66 | ||
67 | extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_opt_mode; | |
68 | extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_aesni_mode; | |
69 | ||
70 | //extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_mode; | |
71 | //extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_mode; | |
72 | ||
73 | extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_opt_mode; | |
74 | extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_aesni_mode; | |
75 | ||
76 | extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_opt_mode; | |
77 | extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_aesni_mode; | |
78 | ||
79 | //extern const struct ccmode_xts ccaes_intel_xts_encrypt_mode; | |
80 | //extern const struct ccmode_xts ccaes_intel_xts_decrypt_mode; | |
81 | ||
82 | extern const struct ccmode_xts ccaes_intel_xts_encrypt_opt_mode; | |
83 | extern const struct ccmode_xts ccaes_intel_xts_encrypt_aesni_mode; | |
84 | ||
85 | extern const struct ccmode_xts ccaes_intel_xts_decrypt_opt_mode; | |
86 | extern const struct ccmode_xts ccaes_intel_xts_decrypt_aesni_mode; | |
87 | #endif | |
88 | ||
89 | ||
90 | /* Implementation Selectors: */ | |
91 | const struct ccmode_ecb *ccaes_ecb_encrypt_mode(void); | |
92 | const struct ccmode_cbc *ccaes_cbc_encrypt_mode(void); | |
93 | const struct ccmode_cfb *ccaes_cfb_encrypt_mode(void); | |
94 | const struct ccmode_cfb8 *ccaes_cfb8_encrypt_mode(void); | |
95 | const struct ccmode_xts *ccaes_xts_encrypt_mode(void); | |
96 | const struct ccmode_gcm *ccaes_gcm_encrypt_mode(void); | |
fe8ab488 | 97 | const struct ccmode_ccm *ccaes_ccm_encrypt_mode(void); |
316670eb A |
98 | |
99 | const struct ccmode_ecb *ccaes_ecb_decrypt_mode(void); | |
100 | const struct ccmode_cbc *ccaes_cbc_decrypt_mode(void); | |
101 | const struct ccmode_cfb *ccaes_cfb_decrypt_mode(void); | |
102 | const struct ccmode_cfb8 *ccaes_cfb8_decrypt_mode(void); | |
103 | const struct ccmode_xts *ccaes_xts_decrypt_mode(void); | |
104 | const struct ccmode_gcm *ccaes_gcm_decrypt_mode(void); | |
fe8ab488 | 105 | const struct ccmode_ccm *ccaes_ccm_decrypt_mode(void); |
316670eb A |
106 | |
107 | const struct ccmode_ctr *ccaes_ctr_crypt_mode(void); | |
108 | const struct ccmode_ofb *ccaes_ofb_crypt_mode(void); | |
109 | ||
39037602 A |
110 | const struct ccmode_siv *ccaes_siv_encrypt_mode(void); |
111 | const struct ccmode_siv *ccaes_siv_decrypt_mode(void); | |
112 | ||
316670eb | 113 | #endif /* _CORECRYPTO_CCAES_H_ */ |