rust-secp256k1-unsafe-fast/secp256k1-sys/depend/secp256k1/src/field.h

353 lines
16 KiB
C
Raw Normal View History

/***********************************************************************
* Copyright (c) 2013, 2014 Pieter Wuille *
* Distributed under the MIT software license, see the accompanying *
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
***********************************************************************/
2015-10-26 14:54:21 +00:00
#ifndef SECP256K1_FIELD_H
#define SECP256K1_FIELD_H
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
#include "util.h"
2015-10-26 14:54:21 +00:00
/* This file defines the generic interface for working with rustsecp256k1_v0_9_1_fe
2023-09-27 18:37:09 +00:00
* objects, which represent field elements (integers modulo 2^256 - 2^32 - 977).
*
* The actual definition of the rustsecp256k1_v0_9_1_fe type depends on the chosen field
2023-09-27 18:37:09 +00:00
* implementation; see the field_5x52.h and field_10x26.h files for details.
*
* All rustsecp256k1_v0_9_1_fe objects have implicit properties that determine what
2023-09-27 18:37:09 +00:00
* operations are permitted on it. These are purely a function of what
* rustsecp256k1_v0_9_1_fe_ operations are applied on it, generally (implicitly) fixed at
2023-09-27 18:37:09 +00:00
* compile time, and do not depend on the chosen field implementation. Despite
* that, what these properties actually entail for the field representation
* values depends on the chosen field implementation. These properties are:
* - magnitude: an integer in [0,32]
* - normalized: 0 or 1; normalized=1 implies magnitude <= 1.
*
* In VERIFY mode, they are materialized explicitly as fields in the struct,
* allowing run-time verification of these properties. In that case, the field
* implementation also provides a rustsecp256k1_v0_9_1_fe_verify routine to verify that
2023-09-27 18:37:09 +00:00
* these fields match the run-time value and perform internal consistency
* checks. */
#ifdef VERIFY
# define SECP256K1_FE_VERIFY_FIELDS \
int magnitude; \
int normalized;
#else
# define SECP256K1_FE_VERIFY_FIELDS
2015-10-26 14:54:21 +00:00
#endif
#if defined(SECP256K1_WIDEMUL_INT128)
2015-10-26 14:54:21 +00:00
#include "field_5x52.h"
#elif defined(SECP256K1_WIDEMUL_INT64)
#include "field_10x26.h"
2015-10-26 14:54:21 +00:00
#else
#error "Please select wide multiplication implementation"
2015-10-26 14:54:21 +00:00
#endif
2023-09-27 18:37:09 +00:00
#ifdef VERIFY
/* Magnitude and normalized value for constants. */
#define SECP256K1_FE_VERIFY_CONST(d7, d6, d5, d4, d3, d2, d1, d0) \
/* Magnitude is 0 for constant 0; 1 otherwise. */ \
, (((d7) | (d6) | (d5) | (d4) | (d3) | (d2) | (d1) | (d0)) != 0) \
/* Normalized is 1 unless sum(d_i<<(32*i) for i=0..7) exceeds field modulus. */ \
, (!(((d7) & (d6) & (d5) & (d4) & (d3) & (d2)) == 0xfffffffful && ((d1) == 0xfffffffful || ((d1) == 0xfffffffe && (d0 >= 0xfffffc2f)))))
#else
#define SECP256K1_FE_VERIFY_CONST(d7, d6, d5, d4, d3, d2, d1, d0)
#endif
/** This expands to an initializer for a rustsecp256k1_v0_9_1_fe valued sum((i*32) * d_i, i=0..7) mod p.
2023-09-27 18:37:09 +00:00
*
* It has magnitude 1, unless d_i are all 0, in which case the magnitude is 0.
* It is normalized, unless sum(2^(i*32) * d_i, i=0..7) >= p.
*
* SECP256K1_FE_CONST_INNER is provided by the implementation.
*/
#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0)) SECP256K1_FE_VERIFY_CONST((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0)) }
static const rustsecp256k1_v0_9_1_fe rustsecp256k1_v0_9_1_fe_one = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1);
static const rustsecp256k1_v0_9_1_fe rustsecp256k1_v0_9_1_const_beta = SECP256K1_FE_CONST(
Upgrade the vendored libsecp256k1 code `libsecp256k1` v0.2.0 was just released. Update the vendored code using `./vendor-libsecp.sh depend 0_8_0 21ffe4b` ``` git show 21ffe4b commit 21ffe4b22a9683cf24ae0763359e401d1284cc7a (tag: v0.2.0) Merge: 8c949f5 e025ccd Author: Pieter Wuille <pieter@wuille.net> Date: Mon Dec 12 17:00:52 2022 -0500 Merge bitcoin-core/secp256k1#1055: Prepare initial release e025ccdf7473702a76bb13d763dc096548ffefba release: prepare for initial release 0.2.0 (Jonas Nick) 6d1784a2e2c1c5a8d89ffb08a7f76fa15e84fff5 build: add missing files to EXTRA_DIST (Jonas Nick) 13bf1b6b324f2ed1c1fb4c8d17a4febd3556839e changelog: make order of change types match keepachangelog.com (Jonas Nick) b1f992a552785395d2e60b10862626fd11f66f84 doc: improve release process (Jonas Nick) ad39e2dc417f85c1577a6a6a9c519f5c60453def build: change package version to 0.1.0-dev (Jonas Nick) 90618e9263ebc2a0d73d487d6d94fd3af96b973c doc: move CHANGELOG from doc/ to root directory (Jonas Nick) Pull request description: Based on #964 ACKs for top commit: sipa: ACK e025ccdf7473702a76bb13d763dc096548ffefba Tree-SHA512: b9ab71d7362537d383a32b5e321ef44069f00e3e92340375bcd662267bc5a60c2bad60222998e6602cfac24ad65efb23d772eac37c86065036b90ef090b54c49 ``` Requires a new version of `secp256k1-sys`, use v0.8.0 - Update the `secp256k1-sys` manifest (including links field) - Update symbols to use 0_8_0 - Add a changelog entry - depend on the new version in `secp256k1` Which in turn requires a new version of `secp256k1`, use v0.26.0
2022-12-20 21:11:14 +00:00
0x7ae96a2bul, 0x657c0710ul, 0x6e64479eul, 0xac3434e9ul,
0x9cf04975ul, 0x12f58995ul, 0xc1396c28ul, 0x719501eeul
);
2023-09-27 18:37:09 +00:00
#ifndef VERIFY
/* In non-VERIFY mode, we #define the fe operations to be identical to their
* internal field implementation, to avoid the potential overhead of a
* function call (even though presumably inlinable). */
# define rustsecp256k1_v0_9_1_fe_normalize rustsecp256k1_v0_9_1_fe_impl_normalize
# define rustsecp256k1_v0_9_1_fe_normalize_weak rustsecp256k1_v0_9_1_fe_impl_normalize_weak
# define rustsecp256k1_v0_9_1_fe_normalize_var rustsecp256k1_v0_9_1_fe_impl_normalize_var
# define rustsecp256k1_v0_9_1_fe_normalizes_to_zero rustsecp256k1_v0_9_1_fe_impl_normalizes_to_zero
# define rustsecp256k1_v0_9_1_fe_normalizes_to_zero_var rustsecp256k1_v0_9_1_fe_impl_normalizes_to_zero_var
# define rustsecp256k1_v0_9_1_fe_set_int rustsecp256k1_v0_9_1_fe_impl_set_int
# define rustsecp256k1_v0_9_1_fe_clear rustsecp256k1_v0_9_1_fe_impl_clear
# define rustsecp256k1_v0_9_1_fe_is_zero rustsecp256k1_v0_9_1_fe_impl_is_zero
# define rustsecp256k1_v0_9_1_fe_is_odd rustsecp256k1_v0_9_1_fe_impl_is_odd
# define rustsecp256k1_v0_9_1_fe_cmp_var rustsecp256k1_v0_9_1_fe_impl_cmp_var
# define rustsecp256k1_v0_9_1_fe_set_b32_mod rustsecp256k1_v0_9_1_fe_impl_set_b32_mod
# define rustsecp256k1_v0_9_1_fe_set_b32_limit rustsecp256k1_v0_9_1_fe_impl_set_b32_limit
# define rustsecp256k1_v0_9_1_fe_get_b32 rustsecp256k1_v0_9_1_fe_impl_get_b32
# define rustsecp256k1_v0_9_1_fe_negate_unchecked rustsecp256k1_v0_9_1_fe_impl_negate_unchecked
# define rustsecp256k1_v0_9_1_fe_mul_int_unchecked rustsecp256k1_v0_9_1_fe_impl_mul_int_unchecked
# define rustsecp256k1_v0_9_1_fe_add rustsecp256k1_v0_9_1_fe_impl_add
# define rustsecp256k1_v0_9_1_fe_mul rustsecp256k1_v0_9_1_fe_impl_mul
# define rustsecp256k1_v0_9_1_fe_sqr rustsecp256k1_v0_9_1_fe_impl_sqr
# define rustsecp256k1_v0_9_1_fe_cmov rustsecp256k1_v0_9_1_fe_impl_cmov
# define rustsecp256k1_v0_9_1_fe_to_storage rustsecp256k1_v0_9_1_fe_impl_to_storage
# define rustsecp256k1_v0_9_1_fe_from_storage rustsecp256k1_v0_9_1_fe_impl_from_storage
# define rustsecp256k1_v0_9_1_fe_inv rustsecp256k1_v0_9_1_fe_impl_inv
# define rustsecp256k1_v0_9_1_fe_inv_var rustsecp256k1_v0_9_1_fe_impl_inv_var
# define rustsecp256k1_v0_9_1_fe_get_bounds rustsecp256k1_v0_9_1_fe_impl_get_bounds
# define rustsecp256k1_v0_9_1_fe_half rustsecp256k1_v0_9_1_fe_impl_half
# define rustsecp256k1_v0_9_1_fe_add_int rustsecp256k1_v0_9_1_fe_impl_add_int
# define rustsecp256k1_v0_9_1_fe_is_square_var rustsecp256k1_v0_9_1_fe_impl_is_square_var
2023-09-27 18:37:09 +00:00
#endif /* !defined(VERIFY) */
/** Normalize a field element.
*
* On input, r must be a valid field element.
* On output, r represents the same value but has normalized=1 and magnitude=1.
*/
static void rustsecp256k1_v0_9_1_fe_normalize(rustsecp256k1_v0_9_1_fe *r);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Give a field element magnitude 1.
*
* On input, r must be a valid field element.
* On output, r represents the same value but has magnitude=1. Normalized is unchanged.
*/
static void rustsecp256k1_v0_9_1_fe_normalize_weak(rustsecp256k1_v0_9_1_fe *r);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Normalize a field element, without constant-time guarantee.
*
* Identical in behavior to rustsecp256k1_v0_9_1_fe_normalize, but not constant time in r.
2023-09-27 18:37:09 +00:00
*/
static void rustsecp256k1_v0_9_1_fe_normalize_var(rustsecp256k1_v0_9_1_fe *r);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Determine whether r represents field element 0.
*
* On input, r must be a valid field element.
* Returns whether r = 0 (mod p).
*/
static int rustsecp256k1_v0_9_1_fe_normalizes_to_zero(const rustsecp256k1_v0_9_1_fe *r);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Determine whether r represents field element 0, without constant-time guarantee.
*
* Identical in behavior to rustsecp256k1_v0_9_1_normalizes_to_zero, but not constant time in r.
2023-09-27 18:37:09 +00:00
*/
static int rustsecp256k1_v0_9_1_fe_normalizes_to_zero_var(const rustsecp256k1_v0_9_1_fe *r);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Set a field element to an integer in range [0,0x7FFF].
*
* On input, r does not need to be initialized, a must be in [0,0x7FFF].
* On output, r represents value a, is normalized and has magnitude (a!=0).
*/
static void rustsecp256k1_v0_9_1_fe_set_int(rustsecp256k1_v0_9_1_fe *r, int a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Set a field element to 0.
*
* On input, a does not need to be initialized.
* On output, a represents 0, is normalized and has magnitude 0.
*/
static void rustsecp256k1_v0_9_1_fe_clear(rustsecp256k1_v0_9_1_fe *a);
2023-09-27 18:37:09 +00:00
/** Determine whether a represents field element 0.
*
* On input, a must be a valid normalized field element.
* Returns whether a = 0 (mod p).
*
* This behaves identical to rustsecp256k1_v0_9_1_normalizes_to_zero{,_var}, but requires
2023-09-27 18:37:09 +00:00
* normalized input (and is much faster).
*/
static int rustsecp256k1_v0_9_1_fe_is_zero(const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Determine whether a (mod p) is odd.
*
* On input, a must be a valid normalized field element.
* Returns (int(a) mod p) & 1.
*/
static int rustsecp256k1_v0_9_1_fe_is_odd(const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Determine whether two field elements are equal.
*
* On input, a and b must be valid field elements with magnitudes not exceeding
* 1 and 31, respectively.
* Returns a = b (mod p).
*/
static int rustsecp256k1_v0_9_1_fe_equal(const rustsecp256k1_v0_9_1_fe *a, const rustsecp256k1_v0_9_1_fe *b);
2023-09-27 18:37:09 +00:00
/** Compare the values represented by 2 field elements, without constant-time guarantee.
*
* On input, a and b must be valid normalized field elements.
* Returns 1 if a > b, -1 if a < b, and 0 if a = b (comparisons are done as integers
* in range 0..p-1).
*/
static int rustsecp256k1_v0_9_1_fe_cmp_var(const rustsecp256k1_v0_9_1_fe *a, const rustsecp256k1_v0_9_1_fe *b);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Set a field element equal to a provided 32-byte big endian value, reducing it.
*
* 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.
*/
static void rustsecp256k1_v0_9_1_fe_set_b32_mod(rustsecp256k1_v0_9_1_fe *r, const unsigned char *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Set a field element equal to a provided 32-byte big endian value, checking for overflow.
*
* 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.
* If a >= p, 0 is returned, and r will be made invalid (and must not be used without overwriting).
*/
static int rustsecp256k1_v0_9_1_fe_set_b32_limit(rustsecp256k1_v0_9_1_fe *r, const unsigned char *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Convert a field element to 32-byte big endian byte array.
* On input, a must be a valid normalized field element, and r a pointer to a 32-byte array.
* On output, r = a (mod p).
*/
static void rustsecp256k1_v0_9_1_fe_get_b32(unsigned char *r, const rustsecp256k1_v0_9_1_fe *a);
2023-09-27 18:37:09 +00:00
/** Negate a field element.
*
* On input, r does not need to be initialized. a must be a valid field element with
* magnitude not exceeding m. m must be an integer constant expression in [0,31].
* Performs {r = -a}.
* On output, r will not be normalized, and will have magnitude m+1.
*/
#define rustsecp256k1_v0_9_1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, rustsecp256k1_v0_9_1_fe_negate_unchecked(r, a, m))
2023-09-27 18:37:09 +00:00
/** Like rustsecp256k1_v0_9_1_fe_negate_unchecked but m is not checked to be an integer constant expression.
2023-09-27 18:37:09 +00:00
*
* Should not be called directly outside of tests.
*/
static void rustsecp256k1_v0_9_1_fe_negate_unchecked(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a, int m);
2023-09-27 18:37:09 +00:00
/** Add a small integer to a field element.
*
* Performs {r += a}. The magnitude of r increases by 1, and normalized is cleared.
* a must be in range [0,0x7FFF].
*/
static void rustsecp256k1_v0_9_1_fe_add_int(rustsecp256k1_v0_9_1_fe *r, int a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Multiply a field element with a small integer.
*
* On input, r must be a valid field element. a must be an integer constant expression in [0,32].
* The magnitude of r times a must not exceed 32.
* Performs {r *= a}.
* On output, r's magnitude is multiplied by a, and r will not be normalized.
*/
#define rustsecp256k1_v0_9_1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, rustsecp256k1_v0_9_1_fe_mul_int_unchecked(r, a))
2015-10-26 14:54:21 +00:00
/** Like rustsecp256k1_v0_9_1_fe_mul_int but a is not checked to be an integer constant expression.
2023-09-27 18:37:09 +00:00
*
* Should not be called directly outside of tests.
*/
static void rustsecp256k1_v0_9_1_fe_mul_int_unchecked(rustsecp256k1_v0_9_1_fe *r, int a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Increment a field element by another.
*
* On input, r and a must be valid field elements, not necessarily normalized.
* The sum of their magnitudes must not exceed 32.
* Performs {r += a}.
* On output, r will not be normalized, and will have magnitude incremented by a's.
*/
static void rustsecp256k1_v0_9_1_fe_add(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Multiply two field elements.
*
* On input, a and b must be valid field elements; r does not need to be initialized.
* r and a may point to the same object, but neither can be equal to b. The magnitudes
* of a and b must not exceed 8.
* Performs {r = a * b}
* On output, r will have magnitude 1, but won't be normalized.
*/
static void rustsecp256k1_v0_9_1_fe_mul(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a, const rustsecp256k1_v0_9_1_fe * SECP256K1_RESTRICT b);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Square a field element.
*
* On input, a must be a valid field element; r does not need to be initialized. The magnitude
* of a must not exceed 8.
* Performs {r = a**2}
* On output, r will have magnitude 1, but won't be normalized.
*/
static void rustsecp256k1_v0_9_1_fe_sqr(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Compute a square root of a field element.
*
* On input, a must be a valid field element with magnitude<=8; r need not be initialized.
* If sqrt(a) exists, performs {r = sqrt(a)} and returns 1.
* Otherwise, sqrt(-a) exists. The function performs {r = sqrt(-a)} and returns 0.
* The resulting value represented by r will be a square itself.
* Variables r and a must not point to the same object.
* On output, r will have magnitude 1 but will not be normalized.
*/
static int rustsecp256k1_v0_9_1_fe_sqrt(rustsecp256k1_v0_9_1_fe * SECP256K1_RESTRICT r, const rustsecp256k1_v0_9_1_fe * SECP256K1_RESTRICT a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Compute the modular inverse of a field element.
*
* On input, a must be a valid field element; r need not be initialized.
* Performs {r = a**(p-2)} (which maps 0 to 0, and every other element to its
* inverse).
* On output, r will have magnitude (a.magnitude != 0) and be normalized.
*/
static void rustsecp256k1_v0_9_1_fe_inv(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Compute the modular inverse of a field element, without constant-time guarantee.
*
* Behaves identically to rustsecp256k1_v0_9_1_fe_inv, but is not constant-time in a.
2023-09-27 18:37:09 +00:00
*/
static void rustsecp256k1_v0_9_1_fe_inv_var(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
/** Convert a field element to rustsecp256k1_v0_9_1_fe_storage.
2023-09-27 18:37:09 +00:00
*
* On input, a must be a valid normalized field element.
* Performs {r = a}.
*/
static void rustsecp256k1_v0_9_1_fe_to_storage(rustsecp256k1_v0_9_1_fe_storage *r, const rustsecp256k1_v0_9_1_fe *a);
2015-10-26 14:54:21 +00:00
/** Convert a field element back from rustsecp256k1_v0_9_1_fe_storage.
2023-09-27 18:37:09 +00:00
*
* On input, r need not be initialized.
* Performs {r = a}.
* On output, r will be normalized and will have magnitude 1.
*/
static void rustsecp256k1_v0_9_1_fe_from_storage(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe_storage *a);
2015-10-26 14:54:21 +00:00
/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. Both *r and *a must be initialized.*/
static void rustsecp256k1_v0_9_1_fe_storage_cmov(rustsecp256k1_v0_9_1_fe_storage *r, const rustsecp256k1_v0_9_1_fe_storage *a, int flag);
2015-10-26 14:54:21 +00:00
2023-09-27 18:37:09 +00:00
/** Conditionally move a field element in constant time.
*
* On input, both r and a must be valid field elements. Flag must be 0 or 1.
* Performs {r = flag ? a : r}.
*
* On output, r's magnitude will be the maximum of both input magnitudes.
* It will be normalized if and only if both inputs were normalized.
*/
static void rustsecp256k1_v0_9_1_fe_cmov(rustsecp256k1_v0_9_1_fe *r, const rustsecp256k1_v0_9_1_fe *a, int flag);
2023-09-27 18:37:09 +00:00
/** Halve the value of a field element modulo the field prime in constant-time.
*
* On input, r must be a valid field element.
* On output, r will be normalized and have magnitude floor(m/2) + 1 where m is
* the magnitude of r on input.
*/
static void rustsecp256k1_v0_9_1_fe_half(rustsecp256k1_v0_9_1_fe *r);
2023-09-27 18:37:09 +00:00
/** Sets r to a field element with magnitude m, normalized if (and only if) m==0.
* The value is chosen so that it is likely to trigger edge cases related to
* internal overflows. */
static void rustsecp256k1_v0_9_1_fe_get_bounds(rustsecp256k1_v0_9_1_fe *r, int m);
2023-09-27 18:37:09 +00:00
/** Determine whether a is a square (modulo p).
*
* On input, a must be a valid field element.
*/
static int rustsecp256k1_v0_9_1_fe_is_square_var(const rustsecp256k1_v0_9_1_fe *a);
Upgrade the vendored libsecp256k1 code `libsecp256k1` v0.2.0 was just released. Update the vendored code using `./vendor-libsecp.sh depend 0_8_0 21ffe4b` ``` git show 21ffe4b commit 21ffe4b22a9683cf24ae0763359e401d1284cc7a (tag: v0.2.0) Merge: 8c949f5 e025ccd Author: Pieter Wuille <pieter@wuille.net> Date: Mon Dec 12 17:00:52 2022 -0500 Merge bitcoin-core/secp256k1#1055: Prepare initial release e025ccdf7473702a76bb13d763dc096548ffefba release: prepare for initial release 0.2.0 (Jonas Nick) 6d1784a2e2c1c5a8d89ffb08a7f76fa15e84fff5 build: add missing files to EXTRA_DIST (Jonas Nick) 13bf1b6b324f2ed1c1fb4c8d17a4febd3556839e changelog: make order of change types match keepachangelog.com (Jonas Nick) b1f992a552785395d2e60b10862626fd11f66f84 doc: improve release process (Jonas Nick) ad39e2dc417f85c1577a6a6a9c519f5c60453def build: change package version to 0.1.0-dev (Jonas Nick) 90618e9263ebc2a0d73d487d6d94fd3af96b973c doc: move CHANGELOG from doc/ to root directory (Jonas Nick) Pull request description: Based on #964 ACKs for top commit: sipa: ACK e025ccdf7473702a76bb13d763dc096548ffefba Tree-SHA512: b9ab71d7362537d383a32b5e321ef44069f00e3e92340375bcd662267bc5a60c2bad60222998e6602cfac24ad65efb23d772eac37c86065036b90ef090b54c49 ``` Requires a new version of `secp256k1-sys`, use v0.8.0 - Update the `secp256k1-sys` manifest (including links field) - Update symbols to use 0_8_0 - Add a changelog entry - depend on the new version in `secp256k1` Which in turn requires a new version of `secp256k1`, use v0.26.0
2022-12-20 21:11:14 +00:00
2023-09-27 18:37:09 +00:00
/** Check invariants on a field element (no-op unless VERIFY is enabled). */
static void rustsecp256k1_v0_9_1_fe_verify(const rustsecp256k1_v0_9_1_fe *a);
Upgrade the vendored libsecp256k1 code `libsecp256k1` v0.2.0 was just released. Update the vendored code using `./vendor-libsecp.sh depend 0_8_0 21ffe4b` ``` git show 21ffe4b commit 21ffe4b22a9683cf24ae0763359e401d1284cc7a (tag: v0.2.0) Merge: 8c949f5 e025ccd Author: Pieter Wuille <pieter@wuille.net> Date: Mon Dec 12 17:00:52 2022 -0500 Merge bitcoin-core/secp256k1#1055: Prepare initial release e025ccdf7473702a76bb13d763dc096548ffefba release: prepare for initial release 0.2.0 (Jonas Nick) 6d1784a2e2c1c5a8d89ffb08a7f76fa15e84fff5 build: add missing files to EXTRA_DIST (Jonas Nick) 13bf1b6b324f2ed1c1fb4c8d17a4febd3556839e changelog: make order of change types match keepachangelog.com (Jonas Nick) b1f992a552785395d2e60b10862626fd11f66f84 doc: improve release process (Jonas Nick) ad39e2dc417f85c1577a6a6a9c519f5c60453def build: change package version to 0.1.0-dev (Jonas Nick) 90618e9263ebc2a0d73d487d6d94fd3af96b973c doc: move CHANGELOG from doc/ to root directory (Jonas Nick) Pull request description: Based on #964 ACKs for top commit: sipa: ACK e025ccdf7473702a76bb13d763dc096548ffefba Tree-SHA512: b9ab71d7362537d383a32b5e321ef44069f00e3e92340375bcd662267bc5a60c2bad60222998e6602cfac24ad65efb23d772eac37c86065036b90ef090b54c49 ``` Requires a new version of `secp256k1-sys`, use v0.8.0 - Update the `secp256k1-sys` manifest (including links field) - Update symbols to use 0_8_0 - Add a changelog entry - depend on the new version in `secp256k1` Which in turn requires a new version of `secp256k1`, use v0.26.0
2022-12-20 21:11:14 +00:00
2023-09-27 18:37:09 +00:00
/** Check that magnitude of a is at most m (no-op unless VERIFY is enabled). */
static void rustsecp256k1_v0_9_1_fe_verify_magnitude(const rustsecp256k1_v0_9_1_fe *a, int m);
2015-10-26 14:54:21 +00:00
#endif /* SECP256K1_FIELD_H */