Go to the documentation of this file.
79 #include "../bn/internal.h"
80 #include "../../internal.h"
91 assert(0 < w && w <= 7);
94 int next_bit = bit << 1;
95 int mask = next_bit - 1;
98 for (
size_t j = 0; j <
bits + 1; j++) {
99 assert(0 <= window_val && window_val <= next_bit);
101 if (window_val & 1) {
102 assert(0 < window_val && window_val < next_bit);
103 if (window_val & bit) {
104 digit = window_val - next_bit;
108 if (j + w + 1 >=
bits) {
114 digit = window_val & (mask >> 1);
128 assert(window_val == 0 || window_val == next_bit || window_val == bit);
129 assert(-bit < digit && digit < bit);
143 assert(window_val <= next_bit);
147 assert(window_val == 0);
156 for (
size_t i = 1;
i <
len;
i++) {
173 #define EC_WNAF_WINDOW_BITS 4
176 #define EC_WNAF_TABLE_SIZE (1 << (EC_WNAF_WINDOW_BITS - 1))
180 #define EC_WNAF_STACK 3
187 size_t wNAF_len =
bits + 1;
198 precomp = precomp_stack;
200 if (
num >= ((
size_t)-1) /
sizeof(wNAF_alloc[0]) ||
201 num >= ((
size_t)-1) /
sizeof(precomp_alloc[0])) {
207 if (wNAF_alloc == NULL || precomp_alloc == NULL) {
212 precomp = precomp_alloc;
219 if (g_scalar != NULL) {
224 for (
size_t i = 0;
i <
num;
i++) {
231 int r_is_at_infinity = 1;
232 for (
size_t k = wNAF_len - 1;
k < wNAF_len;
k--) {
233 if (!r_is_at_infinity) {
237 if (g_scalar != NULL && g_wNAF[
k] != 0) {
239 if (r_is_at_infinity) {
241 r_is_at_infinity = 0;
247 for (
size_t i = 0;
i <
num;
i++) {
248 if (wNAF[
i][
k] != 0) {
250 if (r_is_at_infinity) {
252 r_is_at_infinity = 0;
260 if (r_is_at_infinity) {
#define ec_GFp_simple_point_set_to_infinity
#define OPENSSL_PUT_ERROR(library, reason)
#define OPENSSL_ARRAY_SIZE(array)
#define ec_GFp_simple_invert
#define bn_is_bit_set_words
#define EC_WNAF_WINDOW_BITS
OPENSSL_EXPORT ASN1_BIT_STRING * bits
#define ec_GFp_simple_point_copy
static void compute_precomp(const EC_GROUP *group, EC_RAW_POINT *out, const EC_RAW_POINT *p, size_t len)
static void lookup_precomp(const EC_GROUP *group, EC_RAW_POINT *out, const EC_RAW_POINT *precomp, int digit)
#define EC_WNAF_TABLE_SIZE
UniquePtr< SSL_SESSION > ret
int ec_GFp_mont_mul_public_batch(const EC_GROUP *group, EC_RAW_POINT *r, const EC_SCALAR *g_scalar, const EC_RAW_POINT *points, const EC_SCALAR *scalars, size_t num)
void ec_compute_wNAF(const EC_GROUP *group, int8_t *out, const EC_SCALAR *scalar, size_t bits, int w)
#define ERR_R_MALLOC_FAILURE
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:54