Robert Sloan | ab8b888 | 2018-03-26 11:39:51 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. |
| 3 | * Copyright (c) 2012, Intel Corporation. All Rights Reserved. |
| 4 | * |
| 5 | * Licensed under the OpenSSL license (the "License"). You may not use |
| 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 |
| 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 |
| 13 | */ |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 14 | |
Robert Sloan | ab8b888 | 2018-03-26 11:39:51 -0700 | [diff] [blame^] | 15 | #ifndef OPENSSL_HEADER_BN_RSAZ_EXP_H |
| 16 | #define OPENSSL_HEADER_BN_RSAZ_EXP_H |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 17 | |
| 18 | #include <openssl/bn.h> |
| 19 | |
Robert Sloan | ab8b888 | 2018-03-26 11:39:51 -0700 | [diff] [blame^] | 20 | // RSAZ_1024_mod_exp_avx2 sets |result| to |base_norm| raised to |exponent| |
| 21 | // modulo |m_norm|. |base_norm| must be fully-reduced and |exponent| must have |
| 22 | // the high bit set (it is 1024 bits wide). |RR| and |k0| must be |RR| and |n0|, |
| 23 | // respectively, extracted from |m_norm|'s |BN_MONT_CTX|. |
| 24 | void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], const BN_ULONG base_norm[16], |
| 25 | const BN_ULONG exponent[16], |
| 26 | const BN_ULONG m_norm[16], const BN_ULONG RR[16], |
| 27 | BN_ULONG k0); |
| 28 | |
| 29 | // rsaz_avx2_eligible returns one if |RSAZ_1024_mod_exp_avx2| should be used and |
| 30 | // zero otherwise. |
Adam Langley | d9e397b | 2015-01-22 14:27:53 -0800 | [diff] [blame] | 31 | int rsaz_avx2_eligible(void); |
| 32 | |
Robert Sloan | ab8b888 | 2018-03-26 11:39:51 -0700 | [diff] [blame^] | 33 | #endif // OPENSSL_HEADER_BN_RSAZ_EXP_H |