]> git.saurik.com Git - apple/xnu.git/blob - osfmk/corecrypto/ccsha2/src/ccsha2_internal.h
14fd2d4fbcec256190d03f57f61201f0f218bc2f
[apple/xnu.git] / osfmk / corecrypto / ccsha2 / src / ccsha2_internal.h
1 /*
2 * ccsha2_internal.h
3 * corecrypto
4 *
5 * Created on 12/07/2010
6 *
7 * Copyright (c) 2010,2011,2012,2014,2015 Apple Inc. All rights reserved.
8 *
9 *
10 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
11 *
12 * This file contains Original Code and/or Modifications of Original Code
13 * as defined in and that are subject to the Apple Public Source License
14 * Version 2.0 (the 'License'). You may not use this file except in
15 * compliance with the License. The rights granted to you under the License
16 * may not be used to create, or enable the creation or redistribution of,
17 * unlawful or unlicensed copies of an Apple operating system, or to
18 * circumvent, violate, or enable the circumvention or violation of, any
19 * terms of an Apple operating system software license agreement.
20 *
21 * Please obtain a copy of the License at
22 * http://www.opensource.apple.com/apsl/ and read it before using this file.
23 *
24 * The Original Code and all software distributed under the License are
25 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
26 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
27 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
28 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
29 * Please see the License for the specific language governing rights and
30 * limitations under the License.
31 *
32 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
33 */
34
35 #ifndef _CORECRYPTO_CCSHA2_INTERNAL_H_
36 #define _CORECRYPTO_CCSHA2_INTERNAL_H_
37
38 #include <corecrypto/ccdigest.h>
39
40 void ccsha256_ltc_compress(ccdigest_state_t state, size_t nblocks, const void *buf);
41 void ccsha256_v6m_compress(ccdigest_state_t state, size_t nblocks, const void *buf);
42 void ccsha512_ltc_compress(ccdigest_state_t state, size_t nblocks, const void *in);
43
44 #if CCSHA2_VNG_INTEL
45 #if defined __x86_64__
46 void ccsha256_vng_intel_avx2_compress(ccdigest_state_t state, size_t nblocks, const void *in);
47 void ccsha256_vng_intel_avx1_compress(ccdigest_state_t state, size_t nblocks, const void *in);
48 void ccsha256_vng_intel_ssse3_compress(ccdigest_state_t state, size_t nblocks, const void *in);
49 void ccsha512_vng_intel_avx2_compress(ccdigest_state_t state, size_t nblocks, const void *in);
50 void ccsha512_vng_intel_avx1_compress(ccdigest_state_t state, size_t nblocks, const void *in);
51 void ccsha512_vng_intel_ssse3_compress(ccdigest_state_t state, size_t nblocks, const void *in);
52 #endif
53 void ccsha256_vng_intel_sse3_compress(ccdigest_state_t state, size_t nblocks, const void *in);
54 #endif
55
56 void ccsha512_final(const struct ccdigest_info *di, ccdigest_ctx_t ctx, unsigned char *digest);
57
58 extern const uint32_t ccsha224_initial_state[8];
59 extern const uint32_t ccsha256_initial_state[8];
60 extern const uint64_t ccsha384_initial_state[8];
61 extern const uint64_t ccsha512_initial_state[8];
62
63 #endif /* _CORECRYPTO_CCSHA2_INTERNAL_H_ */