]>
Commit | Line | Data |
---|---|---|
316670eb A |
1 | /* |
2 | * ccsha2.h | |
3 | * corecrypto | |
4 | * | |
5 | * Created by Fabrice Gautier on 12/3/10. | |
6 | * Copyright 2010,2011 Apple Inc. All rights reserved. | |
7 | * | |
8 | */ | |
9 | ||
10 | #ifndef _CORECRYPTO_CCSHA2_H_ | |
11 | #define _CORECRYPTO_CCSHA2_H_ | |
12 | ||
13 | #include <corecrypto/ccdigest.h> | |
14 | ||
15 | /* sha2 selectors */ | |
16 | const struct ccdigest_info *ccsha224_di(void); | |
17 | const struct ccdigest_info *ccsha256_di(void); | |
18 | const struct ccdigest_info *ccsha384_di(void); | |
19 | const struct ccdigest_info *ccsha512_di(void); | |
20 | ||
21 | /* TODO: Placeholders */ | |
22 | #define ccoid_sha224 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x04") | |
23 | #define ccoid_sha224_len 11 | |
24 | ||
25 | #define ccoid_sha256 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01") | |
26 | #define ccoid_sha256_len 11 | |
27 | ||
28 | #define ccoid_sha384 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x02") | |
29 | #define ccoid_sha384_len 11 | |
30 | ||
31 | #define ccoid_sha512 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03") | |
32 | #define ccoid_sha512_len 11 | |
33 | ||
34 | ||
35 | /* SHA256 */ | |
36 | #define CCSHA256_BLOCK_SIZE 64 | |
37 | #define CCSHA256_OUTPUT_SIZE 32 | |
38 | #define CCSHA256_STATE_SIZE 32 | |
39 | extern const struct ccdigest_info ccsha256_ltc_di; | |
40 | extern const struct ccdigest_info ccsha256_vng_intel_SSE3_di; | |
41 | extern const struct ccdigest_info ccsha256_vng_intel_NOSSE3_di; | |
42 | extern const struct ccdigest_info ccsha256_vng_armv7neon_di; | |
43 | extern const uint32_t ccsha256_K[64]; | |
44 | ||
45 | /* SHA224 */ | |
46 | #define CCSHA224_OUTPUT_SIZE 28 | |
47 | extern const struct ccdigest_info ccsha224_ltc_di; | |
48 | extern const struct ccdigest_info ccsha224_vng_intel_SSE3_di; | |
49 | extern const struct ccdigest_info ccsha224_vng_intel_NOSSE3_di; | |
50 | extern const struct ccdigest_info ccsha224_vng_armv7neon_di; | |
51 | ||
52 | /* SHA512 */ | |
53 | #define CCSHA512_BLOCK_SIZE 128 | |
54 | #define CCSHA512_OUTPUT_SIZE 64 | |
55 | #define CCSHA512_STATE_SIZE 64 | |
56 | extern const struct ccdigest_info ccsha512_ltc_di; | |
57 | ||
58 | /* SHA384 */ | |
59 | #define CCSHA384_OUTPUT_SIZE 48 | |
60 | extern const struct ccdigest_info ccsha384_ltc_di; | |
61 | ||
62 | #endif /* _CORECRYPTO_CCSHA2_H_ */ |