]>
Commit | Line | Data |
---|---|---|
4f22f405 | 1 | /* |
c781eb1c AM |
2 | * Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved. |
3 | * Copyright (c) 2020, Intel Corporation. All Rights Reserved. | |
4f22f405 | 4 | * |
367ace68 | 5 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
4f22f405 RS |
6 | * this file except in compliance with the License. You can obtain a copy |
7 | * in the file LICENSE in the source distribution or at | |
8 | * https://www.openssl.org/source/license.html | |
dcf6e50f RS |
9 | * |
10 | * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) | |
11 | * (1) Intel Corporation, Israel Development Center, Haifa, Israel | |
12 | * (2) University of Haifa, Israel | |
4f22f405 RS |
13 | */ |
14 | ||
ae4186b0 DMSP |
15 | #ifndef OSSL_CRYPTO_BN_RSAZ_EXP_H |
16 | # define OSSL_CRYPTO_BN_RSAZ_EXP_H | |
ca48ace5 | 17 | |
ed45f3c2 RL |
18 | # undef RSAZ_ENABLED |
19 | # if defined(OPENSSL_BN_ASM_MONT) && \ | |
20 | (defined(__x86_64) || defined(__x86_64__) || \ | |
21 | defined(_M_AMD64) || defined(_M_X64)) | |
22 | # define RSAZ_ENABLED | |
23 | ||
24 | # include <openssl/bn.h> | |
ca48ace5 AP |
25 | |
26 | void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], | |
0f113f3e MC |
27 | const BN_ULONG base_norm[16], |
28 | const BN_ULONG exponent[16], | |
29 | const BN_ULONG m_norm[16], const BN_ULONG RR[16], | |
30 | BN_ULONG k0); | |
d4a8ba77 | 31 | int rsaz_avx2_eligible(void); |
ca48ace5 AP |
32 | |
33 | void RSAZ_512_mod_exp(BN_ULONG result[8], | |
0f113f3e MC |
34 | const BN_ULONG base_norm[8], const BN_ULONG exponent[8], |
35 | const BN_ULONG m_norm[8], BN_ULONG k0, | |
36 | const BN_ULONG RR[8]); | |
ed45f3c2 | 37 | |
c781eb1c AM |
38 | |
39 | int rsaz_avx512ifma_eligible(void); | |
40 | ||
41 | int RSAZ_mod_exp_avx512_x2(BN_ULONG *res1, | |
42 | const BN_ULONG *base1, | |
43 | const BN_ULONG *exponent1, | |
44 | const BN_ULONG *m1, | |
45 | const BN_ULONG *RR1, | |
46 | BN_ULONG k0_1, | |
47 | BN_ULONG *res2, | |
48 | const BN_ULONG *base2, | |
49 | const BN_ULONG *exponent2, | |
50 | const BN_ULONG *m2, | |
51 | const BN_ULONG *RR2, | |
52 | BN_ULONG k0_2, | |
53 | int factor_size); | |
54 | ||
ed45f3c2 RL |
55 | # endif |
56 | ||
ca48ace5 | 57 | #endif |