]> git.saurik.com Git - apple/xnu.git/blame - EXTERNAL_HEADERS/corecrypto/ccsha2.h
xnu-4570.1.46.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccsha2.h
CommitLineData
316670eb
A
1/*
2 * ccsha2.h
3 * corecrypto
4 *
3e170ce0
A
5 * Created on 12/03/2010
6 *
7 * Copyright (c) 2010,2011,2012,2014,2015 Apple Inc. All rights reserved.
316670eb
A
8 *
9 */
10
11#ifndef _CORECRYPTO_CCSHA2_H_
12#define _CORECRYPTO_CCSHA2_H_
13
14#include <corecrypto/ccdigest.h>
15
16/* sha2 selectors */
17const struct ccdigest_info *ccsha224_di(void);
18const struct ccdigest_info *ccsha256_di(void);
19const struct ccdigest_info *ccsha384_di(void);
20const struct ccdigest_info *ccsha512_di(void);
21
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
25
26#define ccoid_sha256 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01")
27#define ccoid_sha256_len 11
28
29#define ccoid_sha384 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x02")
30#define ccoid_sha384_len 11
31
32#define ccoid_sha512 ((unsigned char *)"\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03")
33#define ccoid_sha512_len 11
34
35
36/* SHA256 */
37#define CCSHA256_BLOCK_SIZE 64
38#define CCSHA256_OUTPUT_SIZE 32
39#define CCSHA256_STATE_SIZE 32
40extern const struct ccdigest_info ccsha256_ltc_di;
39037602
A
41extern const struct ccdigest_info ccsha256_v6m_di;
42#if CCSHA2_VNG_INTEL
fe8ab488 43#if defined __x86_64__
39037602
A
44extern const struct ccdigest_info ccsha224_vng_intel_AVX2_di;
45extern const struct ccdigest_info ccsha224_vng_intel_AVX1_di;
fe8ab488
A
46extern const struct ccdigest_info ccsha256_vng_intel_AVX2_di;
47extern const struct ccdigest_info ccsha256_vng_intel_AVX1_di;
39037602
A
48extern const struct ccdigest_info ccsha384_vng_intel_AVX2_di;
49extern const struct ccdigest_info ccsha384_vng_intel_AVX1_di;
50extern const struct ccdigest_info ccsha384_vng_intel_SupplementalSSE3_di;
51extern const struct ccdigest_info ccsha512_vng_intel_AVX2_di;
52extern const struct ccdigest_info ccsha512_vng_intel_AVX1_di;
53extern const struct ccdigest_info ccsha512_vng_intel_SupplementalSSE3_di;
fe8ab488 54#endif
d190cdc3 55extern const struct ccdigest_info ccsha224_vng_intel_SupplementalSSE3_di;
fe8ab488 56extern const struct ccdigest_info ccsha256_vng_intel_SupplementalSSE3_di;
fe8ab488 57#endif
39037602 58#if CCSHA2_VNG_ARMV7NEON
d190cdc3 59extern const struct ccdigest_info ccsha224_vng_armv7neon_di;
316670eb 60extern const struct ccdigest_info ccsha256_vng_armv7neon_di;
39037602
A
61extern const struct ccdigest_info ccsha384_vng_arm64_di;
62extern const struct ccdigest_info ccsha384_vng_armv7neon_di;
63extern const struct ccdigest_info ccsha512_vng_arm64_di;
64extern const struct ccdigest_info ccsha512_vng_armv7neon_di;
fe8ab488 65#endif
316670eb 66extern const uint32_t ccsha256_K[64];
39037602 67extern const uint64_t ccsha512_K[80];
316670eb
A
68
69/* SHA224 */
70#define CCSHA224_OUTPUT_SIZE 28
71extern const struct ccdigest_info ccsha224_ltc_di;
316670eb
A
72
73/* SHA512 */
74#define CCSHA512_BLOCK_SIZE 128
75#define CCSHA512_OUTPUT_SIZE 64
76#define CCSHA512_STATE_SIZE 64
77extern const struct ccdigest_info ccsha512_ltc_di;
78
79/* SHA384 */
80#define CCSHA384_OUTPUT_SIZE 48
81extern const struct ccdigest_info ccsha384_ltc_di;
82
83#endif /* _CORECRYPTO_CCSHA2_H_ */