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
21extern const struct ccmode_ecb ccaes_ltc_ecb_decrypt_mode;
22extern const struct ccmode_ecb ccaes_ltc_ecb_encrypt_mode;
23
24extern const struct ccmode_cbc ccaes_gladman_cbc_encrypt_mode;
25extern const struct ccmode_cbc ccaes_gladman_cbc_decrypt_mode;
26
27#if CCAES_ARM
28extern const struct ccmode_ecb ccaes_arm_ecb_encrypt_mode;
29extern const struct ccmode_ecb ccaes_arm_ecb_decrypt_mode;
30
31extern const struct ccmode_cbc ccaes_arm_cbc_encrypt_mode;
32extern const struct ccmode_cbc ccaes_arm_cbc_decrypt_mode;
33#endif
34
35#if CCAES_INTEL
36//extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_mode;
37//extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_mode;
38
39extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_opt_mode;
40extern const struct ccmode_ecb ccaes_intel_ecb_encrypt_aesni_mode;
41
42extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_opt_mode;
43extern const struct ccmode_ecb ccaes_intel_ecb_decrypt_aesni_mode;
44
45//extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_mode;
46//extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_mode;
47
48extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_opt_mode;
49extern const struct ccmode_cbc ccaes_intel_cbc_encrypt_aesni_mode;
50
51extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_opt_mode;
52extern const struct ccmode_cbc ccaes_intel_cbc_decrypt_aesni_mode;
53
54//extern const struct ccmode_xts ccaes_intel_xts_encrypt_mode;
55//extern const struct ccmode_xts ccaes_intel_xts_decrypt_mode;
56
57extern const struct ccmode_xts ccaes_intel_xts_encrypt_opt_mode;
58extern const struct ccmode_xts ccaes_intel_xts_encrypt_aesni_mode;
59
60extern const struct ccmode_xts ccaes_intel_xts_decrypt_opt_mode;
61extern const struct ccmode_xts ccaes_intel_xts_decrypt_aesni_mode;
62#endif
63
64
65/* Implementation Selectors: */
66const struct ccmode_ecb *ccaes_ecb_encrypt_mode(void);
67const struct ccmode_cbc *ccaes_cbc_encrypt_mode(void);
68const struct ccmode_cfb *ccaes_cfb_encrypt_mode(void);
69const struct ccmode_cfb8 *ccaes_cfb8_encrypt_mode(void);
70const struct ccmode_xts *ccaes_xts_encrypt_mode(void);
71const struct ccmode_gcm *ccaes_gcm_encrypt_mode(void);
72
73const struct ccmode_ecb *ccaes_ecb_decrypt_mode(void);
74const struct ccmode_cbc *ccaes_cbc_decrypt_mode(void);
75const struct ccmode_cfb *ccaes_cfb_decrypt_mode(void);
76const struct ccmode_cfb8 *ccaes_cfb8_decrypt_mode(void);
77const struct ccmode_xts *ccaes_xts_decrypt_mode(void);
78const struct ccmode_gcm *ccaes_gcm_decrypt_mode(void);
79
80const struct ccmode_ctr *ccaes_ctr_crypt_mode(void);
81const struct ccmode_ofb *ccaes_ofb_crypt_mode(void);
82
83#endif /* _CORECRYPTO_CCAES_H_ */
84