Move algorithm specific ppccap code from crypto/ppccap.c
[openssl.git] / crypto / sha / sha_ppccap.c
1 /*
2  * Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #include <stdlib.h>
11 #include <openssl/opensslconf.h>
12 #include "../ppc_arch.h"
13
14 void sha256_block_p8(void *ctx, const void *inp, size_t len);
15 void sha256_block_ppc(void *ctx, const void *inp, size_t len);
16 void sha256_block_data_order(void *ctx, const void *inp, size_t len)
17 {
18     OPENSSL_ppccap_P & PPC_CRYPTO207 ? sha256_block_p8(ctx, inp, len) :
19         sha256_block_ppc(ctx, inp, len);
20 }
21
22 void sha512_block_p8(void *ctx, const void *inp, size_t len);
23 void sha512_block_ppc(void *ctx, const void *inp, size_t len);
24 void sha512_block_data_order(void *ctx, const void *inp, size_t len)
25 {
26     OPENSSL_ppccap_P & PPC_CRYPTO207 ? sha512_block_p8(ctx, inp, len) :
27         sha512_block_ppc(ctx, inp, len);
28 }
29