small fixes

restoring wycheproof files

restoring wycheproof files2
This commit is contained in:
Alejandro 2023-07-03 15:21:21 +02:00
parent fb758fe8d6
commit b6b9834e8d
6 changed files with 7 additions and 7 deletions

View File

@ -95,7 +95,7 @@ static void secure_erase(void *ptr, size_t len) {
* As best as we can tell, this is sufficient to break any optimisations that * As best as we can tell, this is sufficient to break any optimisations that
* might try to eliminate "superfluous" memsets. * might try to eliminate "superfluous" memsets.
* This method used in memzero_explicit() the Linux kernel, too. Its advantage is that it is * This method used in memzero_explicit() the Linux kernel, too. Its advantage is that it is
* pretty efficient, because the compiler can still implement the memset() efficently, * pretty efficient, because the compiler can still implement the memset() efficiently,
* just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by * just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
* Yang et al. (USENIX Security 2017) for more background. * Yang et al. (USENIX Security 2017) for more background.
*/ */

View File

@ -161,7 +161,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ellswift_create(
/** Given a private key, and ElligatorSwift public keys sent in both directions, /** Given a private key, and ElligatorSwift public keys sent in both directions,
* compute a shared secret using x-only Elliptic Curve Diffie-Hellman (ECDH). * compute a shared secret using x-only Elliptic Curve Diffie-Hellman (ECDH).
* *
* Returns: 1: shared secret was succesfully computed * Returns: 1: shared secret was successfully computed
* 0: secret was invalid or hashfp returned 0 * 0: secret was invalid or hashfp returned 0
* Args: ctx: pointer to a context object. * Args: ctx: pointer to a context object.
* Out: output: pointer to an array to be filled by hashfp. * Out: output: pointer to an array to be filled by hashfp.

View File

@ -198,7 +198,7 @@ def normalize_factor(p):
(8) * (-bx + ax)^3 (8) * (-bx + ax)^3
``` ```
""" """
# Assert p is not 0 and that its non-zero coeffients are coprime. # Assert p is not 0 and that its non-zero coefficients are coprime.
# (We could just work with the primitive part p/p.content() but we want to be # (We could just work with the primitive part p/p.content() but we want to be
# aware if factor() does not return a primitive part in future sage versions.) # aware if factor() does not return a primitive part in future sage versions.)
assert p.content() == 1 assert p.content() == 1

View File

@ -22,7 +22,7 @@
# pragma message DEBUG_CONFIG_DEF(ECMULT_WINDOW_SIZE) # pragma message DEBUG_CONFIG_DEF(ECMULT_WINDOW_SIZE)
#endif #endif
/* Noone will ever need more than a window size of 24. The code might /* No one will ever need more than a window size of 24. The code might
* be correct for larger values of ECMULT_WINDOW_SIZE but this is not * be correct for larger values of ECMULT_WINDOW_SIZE but this is not
* tested. * tested.
* *

View File

@ -276,7 +276,7 @@ static int secp256k1_ecmult_const_xonly(secp256k1_fe* r, const secp256k1_fe *n,
* *
* It is easy to verify that both (n*g, g^2, v) and its negation (n*g, -g^2, v) have affine X * It is easy to verify that both (n*g, g^2, v) and its negation (n*g, -g^2, v) have affine X
* coordinate n/d, and this holds even when the square root function doesn't have a * coordinate n/d, and this holds even when the square root function doesn't have a
* determinstic sign. We choose the (n*g, g^2, v) version. * deterministic sign. We choose the (n*g, g^2, v) version.
* *
* Now switch to the effective affine curve using phi_v, where the input point has coordinates * Now switch to the effective affine curve using phi_v, where the input point has coordinates
* (n*g, g^2). Compute (X, Y, Z) = q * (n*g, g^2) there. * (n*g, g^2). Compute (X, Y, Z) = q * (n*g, g^2) there.

View File

@ -192,14 +192,14 @@ static int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b);
/** Set a field element equal to a provided 32-byte big endian value, reducing it. /** Set a field element equal to a provided 32-byte big endian value, reducing it.
* *
* On input, r does not need to be initalized. a must be a pointer to an initialized 32-byte array. * On input, r does not need to be initialized. a must be a pointer to an initialized 32-byte array.
* On output, r = a (mod p). It will have magnitude 1, and not be normalized. * On output, r = a (mod p). It will have magnitude 1, and not be normalized.
*/ */
static void secp256k1_fe_set_b32_mod(secp256k1_fe *r, const unsigned char *a); static void secp256k1_fe_set_b32_mod(secp256k1_fe *r, const unsigned char *a);
/** Set a field element equal to a provided 32-byte big endian value, checking for overflow. /** Set a field element equal to a provided 32-byte big endian value, checking for overflow.
* *
* On input, r does not need to be initalized. a must be a pointer to an initialized 32-byte array. * On input, r does not need to be initialized. a must be a pointer to an initialized 32-byte array.
* On output, r = a if (a < p), it will be normalized with magnitude 1, and 1 is returned. * On output, r = a if (a < p), it will be normalized with magnitude 1, and 1 is returned.
* If a >= p, 0 is returned, and r will be made invalid (and must not be used without overwriting). * If a >= p, 0 is returned, and r will be made invalid (and must not be used without overwriting).
*/ */