5 * Created on 12/03/2010
7 * Copyright (c) 2010,2011,2012,2014,2015 Apple Inc. All rights reserved.
11 #ifndef _CORECRYPTO_CCSHA2_H_
12 #define _CORECRYPTO_CCSHA2_H_
14 #include <corecrypto/ccdigest.h>
17 const struct ccdigest_info
*ccsha224_di(void);
18 const struct ccdigest_info
*ccsha256_di(void);
19 const struct ccdigest_info
*ccsha384_di(void);
20 const struct ccdigest_info
*ccsha512_di(void);
22 /* TODO: Placeholders */
23 #define ccoid_sha224 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x04")
24 #define ccoid_sha224_len 11
26 #define ccoid_sha256 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01")
27 #define ccoid_sha256_len 11
29 #define ccoid_sha384 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x02")
30 #define ccoid_sha384_len 11
32 #define ccoid_sha512 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03")
33 #define ccoid_sha512_len 11
37 #define CCSHA256_BLOCK_SIZE 64
38 #define CCSHA256_OUTPUT_SIZE 32
39 #define CCSHA256_STATE_SIZE 32
40 extern const struct ccdigest_info ccsha256_ltc_di
;
41 extern const struct ccdigest_info ccsha256_v6m_di
;
43 #if defined __x86_64__
44 extern const struct ccdigest_info ccsha224_vng_intel_AVX2_di
;
45 extern const struct ccdigest_info ccsha224_vng_intel_AVX1_di
;
46 extern const struct ccdigest_info ccsha256_vng_intel_AVX2_di
;
47 extern const struct ccdigest_info ccsha256_vng_intel_AVX1_di
;
48 extern const struct ccdigest_info ccsha384_vng_intel_AVX2_di
;
49 extern const struct ccdigest_info ccsha384_vng_intel_AVX1_di
;
50 extern const struct ccdigest_info ccsha384_vng_intel_SupplementalSSE3_di
;
51 extern const struct ccdigest_info ccsha512_vng_intel_AVX2_di
;
52 extern const struct ccdigest_info ccsha512_vng_intel_AVX1_di
;
53 extern const struct ccdigest_info ccsha512_vng_intel_SupplementalSSE3_di
;
55 extern const struct ccdigest_info ccsha256_vng_intel_SupplementalSSE3_di
;
57 #if CCSHA2_VNG_ARMV7NEON
58 extern const struct ccdigest_info ccsha256_vng_armv7neon_di
;
59 extern const struct ccdigest_info ccsha384_vng_arm64_di
;
60 extern const struct ccdigest_info ccsha384_vng_armv7neon_di
;
61 extern const struct ccdigest_info ccsha512_vng_arm64_di
;
62 extern const struct ccdigest_info ccsha512_vng_armv7neon_di
;
64 extern const uint32_t ccsha256_K
[64];
65 extern const uint64_t ccsha512_K
[80];
68 #define CCSHA224_OUTPUT_SIZE 28
69 extern const struct ccdigest_info ccsha224_ltc_di
;
71 extern const struct ccdigest_info ccsha224_vng_intel_SupplementalSSE3_di
;
73 #if CCSHA2_VNG_ARMV7NEON
74 extern const struct ccdigest_info ccsha224_vng_armv7neon_di
;
78 #define CCSHA512_BLOCK_SIZE 128
79 #define CCSHA512_OUTPUT_SIZE 64
80 #define CCSHA512_STATE_SIZE 64
81 extern const struct ccdigest_info ccsha512_ltc_di
;
84 #define CCSHA384_OUTPUT_SIZE 48
85 extern const struct ccdigest_info ccsha384_ltc_di
;
87 #endif /* _CORECRYPTO_CCSHA2_H_ */