ec: Rename reference p521 field operations and use them via macros

This will allow clean addition of assembly versions of these operations.

Signed-off-by: Martin Schwenke <martin@meltin.net>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15401)
This commit is contained in:
Martin Schwenke 2021-05-12 11:47:55 +10:00 committed by Pauli
parent 7711227059
commit 3363a2c3d6

View File

@ -401,7 +401,7 @@ static void felem_diff128(largefelem out, const largefelem in)
* On exit:
* out[i] < 17 * max(in[i]) * max(in[i])
*/
static void felem_square(largefelem out, const felem in)
static void felem_square_ref(largefelem out, const felem in)
{
felem inx2, inx4;
felem_scalar(inx2, in, 2);
@ -485,7 +485,7 @@ static void felem_square(largefelem out, const felem in)
* On exit:
* out[i] < 17 * max(in1[i]) * max(in2[i])
*/
static void felem_mul(largefelem out, const felem in1, const felem in2)
static void felem_mul_ref(largefelem out, const felem in1, const felem in2)
{
felem in2x2;
felem_scalar(in2x2, in2, 2);
@ -675,6 +675,9 @@ static void felem_reduce(felem out, const largefelem in)
*/
}
#define felem_square felem_square_ref
#define felem_mul felem_mul_ref
static void felem_square_reduce(felem out, const felem in)
{
largefelem tmp;