mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
ASM: generated code not using uint*_t types
Don't use uint*_t types as they may not be available.
This commit is contained in:
@ -648,7 +648,7 @@ int fe_isnonzero(const fe a_p)
|
||||
: "memory", "cc", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
|
||||
"r12"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
int fe_isnegative(const fe a_p)
|
||||
@ -674,7 +674,7 @@ int fe_isnegative(const fe a_p)
|
||||
:
|
||||
: "memory", "cc", "r1", "r2", "r3", "r4", "r5"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#if defined(HAVE_ED25519_MAKE_KEY) || defined(HAVE_ED25519_SIGN)
|
||||
@ -4030,7 +4030,7 @@ int curve25519(byte* r_p, const byte* n_p, const byte* a_p)
|
||||
: "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11",
|
||||
"r3", "r12", "lr"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -4344,7 +4344,7 @@ int curve25519(byte* r_p, const byte* n_p, const byte* a_p)
|
||||
: "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11",
|
||||
"r3", "r12", "lr"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WC_NO_CACHE_RESISTANT */
|
||||
|
@ -9224,7 +9224,7 @@ unsigned int kyber_arm32_rej_uniform(sword16* p_p, unsigned int len_p,
|
||||
:
|
||||
: "memory", "cc", "r12", "lr", "r5", "r6", "r7", "r8"
|
||||
);
|
||||
return (uint32_t)(size_t)p;
|
||||
return (word32)(size_t)p;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_WC_KYBER */
|
||||
|
@ -234,7 +234,7 @@ int fe_isnonzero(const fe a)
|
||||
:
|
||||
: "memory", "x1", "x2", "x3", "x4", "x5", "x6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
int fe_isnegative(const fe a)
|
||||
@ -253,7 +253,7 @@ int fe_isnegative(const fe a)
|
||||
:
|
||||
: "memory", "x1", "x2", "x3", "x4", "x5", "x6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
void fe_cmov_table(fe* r, fe* base, signed char b)
|
||||
@ -3683,7 +3683,7 @@ int curve25519(byte* r, const byte* n, const byte* a)
|
||||
:
|
||||
: "memory", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "x26", "x27", "x28", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ED25519
|
||||
|
@ -32,7 +32,7 @@
|
||||
#ifdef WOLFSSL_ARMASM
|
||||
#ifdef __aarch64__
|
||||
#ifdef WOLFSSL_ARMASM_INLINE
|
||||
static const uint16_t L_kyber_aarch64_q[] = {
|
||||
static const word16 L_kyber_aarch64_q[] = {
|
||||
0xd01,
|
||||
0xd01,
|
||||
0xd01,
|
||||
@ -43,7 +43,7 @@ static const uint16_t L_kyber_aarch64_q[] = {
|
||||
0xd01,
|
||||
};
|
||||
|
||||
static const uint16_t L_kyber_aarch64_consts[] = {
|
||||
static const word16 L_kyber_aarch64_consts[] = {
|
||||
0xd01,
|
||||
0xf301,
|
||||
0x4ebf,
|
||||
@ -54,7 +54,7 @@ static const uint16_t L_kyber_aarch64_consts[] = {
|
||||
0x0,
|
||||
};
|
||||
|
||||
static const uint64_t L_sha3_aarch64_r[] = {
|
||||
static const word64 L_sha3_aarch64_r[] = {
|
||||
0x1UL,
|
||||
0x8082UL,
|
||||
0x800000000000808aUL,
|
||||
@ -84,7 +84,7 @@ static const uint64_t L_sha3_aarch64_r[] = {
|
||||
#include <wolfssl/wolfcrypt/wc_kyber.h>
|
||||
|
||||
#ifdef WOLFSSL_WC_KYBER
|
||||
static const uint16_t L_kyber_aarch64_zetas[] = {
|
||||
static const word16 L_kyber_aarch64_zetas[] = {
|
||||
0x8ed,
|
||||
0xa0b,
|
||||
0xb9a,
|
||||
@ -375,7 +375,7 @@ static const uint16_t L_kyber_aarch64_zetas[] = {
|
||||
0x65c,
|
||||
};
|
||||
|
||||
static const uint16_t L_kyber_aarch64_zetas_qinv[] = {
|
||||
static const word16 L_kyber_aarch64_zetas_qinv[] = {
|
||||
0xffed,
|
||||
0x7b0b,
|
||||
0x399a,
|
||||
@ -2222,7 +2222,7 @@ void kyber_ntt(sword16* r)
|
||||
);
|
||||
}
|
||||
|
||||
static const uint16_t L_kyber_aarch64_zetas_inv[] = {
|
||||
static const word16 L_kyber_aarch64_zetas_inv[] = {
|
||||
0x6a5,
|
||||
0x6a5,
|
||||
0x70f,
|
||||
@ -2513,7 +2513,7 @@ static const uint16_t L_kyber_aarch64_zetas_inv[] = {
|
||||
0x5a1,
|
||||
};
|
||||
|
||||
static const uint16_t L_kyber_aarch64_zetas_inv_qinv[] = {
|
||||
static const word16 L_kyber_aarch64_zetas_inv_qinv[] = {
|
||||
0xa5a5,
|
||||
0xa5a5,
|
||||
0x440f,
|
||||
@ -4596,7 +4596,7 @@ void kyber_invntt(sword16* r)
|
||||
);
|
||||
}
|
||||
|
||||
static const uint16_t L_kyber_aarch64_zetas_mul[] = {
|
||||
static const word16 L_kyber_aarch64_zetas_mul[] = {
|
||||
0x8b2,
|
||||
0xf74e,
|
||||
0x1ae,
|
||||
@ -7132,7 +7132,7 @@ void kyber_to_mont(sword16* p)
|
||||
);
|
||||
}
|
||||
|
||||
static const uint16_t L_kyber_aarch64_to_msg_neon_low[] = {
|
||||
static const word16 L_kyber_aarch64_to_msg_neon_low[] = {
|
||||
0x373,
|
||||
0x373,
|
||||
0x373,
|
||||
@ -7143,7 +7143,7 @@ static const uint16_t L_kyber_aarch64_to_msg_neon_low[] = {
|
||||
0x373,
|
||||
};
|
||||
|
||||
static const uint16_t L_kyber_aarch64_to_msg_neon_high[] = {
|
||||
static const word16 L_kyber_aarch64_to_msg_neon_high[] = {
|
||||
0x9c0,
|
||||
0x9c0,
|
||||
0x9c0,
|
||||
@ -7154,7 +7154,7 @@ static const uint16_t L_kyber_aarch64_to_msg_neon_high[] = {
|
||||
0x9c0,
|
||||
};
|
||||
|
||||
static const uint16_t L_kyber_aarch64_to_msg_neon_bits[] = {
|
||||
static const word16 L_kyber_aarch64_to_msg_neon_bits[] = {
|
||||
0x1,
|
||||
0x2,
|
||||
0x4,
|
||||
@ -7398,7 +7398,7 @@ void kyber_to_msg_neon(byte* msg, sword16* p)
|
||||
);
|
||||
}
|
||||
|
||||
static const uint16_t L_kyber_aarch64_from_msg_neon_q1half[] = {
|
||||
static const word16 L_kyber_aarch64_from_msg_neon_q1half[] = {
|
||||
0x681,
|
||||
0x681,
|
||||
0x681,
|
||||
@ -7409,7 +7409,7 @@ static const uint16_t L_kyber_aarch64_from_msg_neon_q1half[] = {
|
||||
0x681,
|
||||
};
|
||||
|
||||
static const uint8_t L_kyber_aarch64_from_msg_neon_bits[] = {
|
||||
static const word8 L_kyber_aarch64_from_msg_neon_bits[] = {
|
||||
0x1,
|
||||
0x2,
|
||||
0x4,
|
||||
@ -7853,10 +7853,10 @@ int kyber_cmp_neon(const byte* a, const byte* b, int sz)
|
||||
: [L_kyber_aarch64_q] "S" (L_kyber_aarch64_q), [L_kyber_aarch64_consts] "S" (L_kyber_aarch64_consts), [L_sha3_aarch64_r] "S" (L_sha3_aarch64_r), [L_kyber_aarch64_zetas] "S" (L_kyber_aarch64_zetas), [L_kyber_aarch64_zetas_qinv] "S" (L_kyber_aarch64_zetas_qinv), [L_kyber_aarch64_zetas_inv] "S" (L_kyber_aarch64_zetas_inv), [L_kyber_aarch64_zetas_inv_qinv] "S" (L_kyber_aarch64_zetas_inv_qinv), [L_kyber_aarch64_zetas_mul] "S" (L_kyber_aarch64_zetas_mul), [L_kyber_aarch64_to_msg_neon_low] "S" (L_kyber_aarch64_to_msg_neon_low), [L_kyber_aarch64_to_msg_neon_high] "S" (L_kyber_aarch64_to_msg_neon_high), [L_kyber_aarch64_to_msg_neon_bits] "S" (L_kyber_aarch64_to_msg_neon_bits), [L_kyber_aarch64_from_msg_neon_q1half] "S" (L_kyber_aarch64_from_msg_neon_q1half), [L_kyber_aarch64_from_msg_neon_bits] "S" (L_kyber_aarch64_from_msg_neon_bits)
|
||||
: "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
static const uint16_t L_kyber_aarch64_rej_uniform_neon_mask[] = {
|
||||
static const word16 L_kyber_aarch64_rej_uniform_neon_mask[] = {
|
||||
0xfff,
|
||||
0xfff,
|
||||
0xfff,
|
||||
@ -7867,7 +7867,7 @@ static const uint16_t L_kyber_aarch64_rej_uniform_neon_mask[] = {
|
||||
0xfff,
|
||||
};
|
||||
|
||||
static const uint16_t L_kyber_aarch64_rej_uniform_neon_bits[] = {
|
||||
static const word16 L_kyber_aarch64_rej_uniform_neon_bits[] = {
|
||||
0x1,
|
||||
0x2,
|
||||
0x4,
|
||||
@ -7878,7 +7878,7 @@ static const uint16_t L_kyber_aarch64_rej_uniform_neon_bits[] = {
|
||||
0x80,
|
||||
};
|
||||
|
||||
static const uint8_t L_kyber_aarch64_rej_uniform_neon_indeces[] = {
|
||||
static const word8 L_kyber_aarch64_rej_uniform_neon_indeces[] = {
|
||||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
@ -12154,7 +12154,7 @@ unsigned int kyber_rej_uniform_neon(sword16* p, unsigned int len, const byte* r,
|
||||
: [L_kyber_aarch64_q] "S" (L_kyber_aarch64_q), [L_kyber_aarch64_consts] "S" (L_kyber_aarch64_consts), [L_sha3_aarch64_r] "S" (L_sha3_aarch64_r), [L_kyber_aarch64_zetas] "S" (L_kyber_aarch64_zetas), [L_kyber_aarch64_zetas_qinv] "S" (L_kyber_aarch64_zetas_qinv), [L_kyber_aarch64_zetas_inv] "S" (L_kyber_aarch64_zetas_inv), [L_kyber_aarch64_zetas_inv_qinv] "S" (L_kyber_aarch64_zetas_inv_qinv), [L_kyber_aarch64_zetas_mul] "S" (L_kyber_aarch64_zetas_mul), [L_kyber_aarch64_to_msg_neon_low] "S" (L_kyber_aarch64_to_msg_neon_low), [L_kyber_aarch64_to_msg_neon_high] "S" (L_kyber_aarch64_to_msg_neon_high), [L_kyber_aarch64_to_msg_neon_bits] "S" (L_kyber_aarch64_to_msg_neon_bits), [L_kyber_aarch64_from_msg_neon_q1half] "S" (L_kyber_aarch64_from_msg_neon_q1half), [L_kyber_aarch64_from_msg_neon_bits] "S" (L_kyber_aarch64_from_msg_neon_bits), [L_kyber_aarch64_rej_uniform_neon_mask] "S" (L_kyber_aarch64_rej_uniform_neon_mask), [L_kyber_aarch64_rej_uniform_neon_bits] "S" (L_kyber_aarch64_rej_uniform_neon_bits), [L_kyber_aarch64_rej_uniform_neon_indeces] "S" (L_kyber_aarch64_rej_uniform_neon_indeces)
|
||||
: "memory", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)p;
|
||||
return (word32)(size_t)p;
|
||||
}
|
||||
|
||||
#ifdef WOLFSSL_ARMASM_CRYPTO_SHA3
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#ifdef WOLFSSL_SHA3
|
||||
#ifdef WOLFSSL_ARMASM_CRYPTO_SHA3
|
||||
static const uint64_t L_SHA3_transform_crypto_r[] = {
|
||||
static const word64 L_SHA3_transform_crypto_r[] = {
|
||||
0x1UL,
|
||||
0x8082UL,
|
||||
0x800000000000808aUL,
|
||||
@ -182,7 +182,7 @@ void BlockSha3(word64* state)
|
||||
}
|
||||
|
||||
#else
|
||||
static const uint64_t L_SHA3_transform_base_r[] = {
|
||||
static const word64 L_SHA3_transform_base_r[] = {
|
||||
0x1UL,
|
||||
0x8082UL,
|
||||
0x800000000000808aUL,
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#ifdef WOLFSSL_SHA512
|
||||
#ifndef WOLFSSL_ARMASM_CRYPTO_SHA512
|
||||
static const uint64_t L_SHA512_transform_neon_len_k[] = {
|
||||
static const word64 L_SHA512_transform_neon_len_k[] = {
|
||||
0x428a2f98d728ae22UL,
|
||||
0x7137449123ef65cdUL,
|
||||
0xb5c0fbcfec4d3b2fUL,
|
||||
@ -119,7 +119,7 @@ static const uint64_t L_SHA512_transform_neon_len_k[] = {
|
||||
0x6c44198c4a475817UL,
|
||||
};
|
||||
|
||||
static const uint64_t L_SHA512_transform_neon_len_ror8[] = {
|
||||
static const word64 L_SHA512_transform_neon_len_ror8[] = {
|
||||
0x7060504030201UL,
|
||||
0x80f0e0d0c0b0a09UL,
|
||||
};
|
||||
@ -1054,7 +1054,7 @@ void Transform_Sha512_Len_neon(wc_Sha512* sha512, const byte* data, word32 len)
|
||||
}
|
||||
|
||||
#else
|
||||
static const uint64_t L_SHA512_transform_crypto_len_k[] = {
|
||||
static const word64 L_SHA512_transform_crypto_len_k[] = {
|
||||
0x428a2f98d728ae22UL,
|
||||
0x7137449123ef65cdUL,
|
||||
0xb5c0fbcfec4d3b2fUL,
|
||||
|
@ -533,7 +533,7 @@ int fe_isnonzero(const fe a)
|
||||
:
|
||||
: "memory", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#ifndef WOLFSSL_NO_VAR_ASSIGN_REG
|
||||
@ -565,7 +565,7 @@ int fe_isnegative(const fe a)
|
||||
:
|
||||
: "memory", "r1", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#if defined(HAVE_ED25519_MAKE_KEY) || defined(HAVE_ED25519_SIGN)
|
||||
@ -3239,7 +3239,7 @@ int curve25519(byte* r, const byte* n, const byte* a)
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r3", "r12", "lr", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -3645,7 +3645,7 @@ int curve25519(byte* r, const byte* n, const byte* a)
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r3", "r12", "lr", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WC_NO_CACHE_RESISTANT */
|
||||
|
@ -3842,7 +3842,7 @@ unsigned int kyber_thumb2_rej_uniform(sword16* p, unsigned int len, const byte*
|
||||
: "memory", "r5", "r6", "r7", "r8", "r9", "r10", "cc"
|
||||
#endif /* WOLFSSL_NO_VAR_ASSIGN_REG */
|
||||
);
|
||||
return (uint32_t)(size_t)p;
|
||||
return (word32)(size_t)p;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_WC_KYBER */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24197,13 +24197,13 @@ static void sp_256_proj_point_add_sub_4(sp_point_256* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_256 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_256;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_4_6[66] = {
|
||||
static const word8 recode_index_4_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -24212,7 +24212,7 @@ static const uint8_t recode_index_4_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_4_6[66] = {
|
||||
static const word8 recode_neg_4_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -24230,7 +24230,7 @@ static void sp_256_ecc_recode_6_4(const sp_digit* k, ecc_recode_256* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -24239,7 +24239,7 @@ static void sp_256_ecc_recode_6_4(const sp_digit* k, ecc_recode_256* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<43; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 64) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -24253,12 +24253,12 @@ static void sp_256_ecc_recode_6_4(const sp_digit* k, ecc_recode_256* v)
|
||||
}
|
||||
else if (++j < 4) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x3f);
|
||||
y |= (word8)((n << (64 - o)) & 0x3f);
|
||||
o -= 58;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_4_6[y];
|
||||
v[i].neg = recode_neg_4_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -24905,7 +24905,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[64];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -24933,7 +24933,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -25335,7 +25335,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -25363,7 +25363,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -27278,7 +27278,7 @@ static int sp_256_ecc_mulmod_base_4(sp_point_256* r, const sp_digit* k,
|
||||
#endif /* WC_NO_CACHE_RESISTANT */
|
||||
#else
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_4_7[130] = {
|
||||
static const word8 recode_index_4_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -27291,7 +27291,7 @@ static const uint8_t recode_index_4_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_4_7[130] = {
|
||||
static const word8 recode_neg_4_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -27313,7 +27313,7 @@ static void sp_256_ecc_recode_7_4(const sp_digit* k, ecc_recode_256* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -27322,7 +27322,7 @@ static void sp_256_ecc_recode_7_4(const sp_digit* k, ecc_recode_256* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<37; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -27336,12 +27336,12 @@ static void sp_256_ecc_recode_7_4(const sp_digit* k, ecc_recode_256* v)
|
||||
}
|
||||
else if (++j < 4) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_4_7[y];
|
||||
v[i].neg = recode_neg_4_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -45159,13 +45159,13 @@ static void sp_384_proj_point_add_sub_6(sp_point_384* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_384 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_384;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_6_6[66] = {
|
||||
static const word8 recode_index_6_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -45174,7 +45174,7 @@ static const uint8_t recode_index_6_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_6_6[66] = {
|
||||
static const word8 recode_neg_6_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -45192,7 +45192,7 @@ static void sp_384_ecc_recode_6_6(const sp_digit* k, ecc_recode_384* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -45201,7 +45201,7 @@ static void sp_384_ecc_recode_6_6(const sp_digit* k, ecc_recode_384* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<65; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 64) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -45215,12 +45215,12 @@ static void sp_384_ecc_recode_6_6(const sp_digit* k, ecc_recode_384* v)
|
||||
}
|
||||
else if (++j < 6) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x3f);
|
||||
y |= (word8)((n << (64 - o)) & 0x3f);
|
||||
o -= 58;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_6_6[y];
|
||||
v[i].neg = recode_neg_6_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -45831,7 +45831,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[64];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -45859,7 +45859,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -46261,7 +46261,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -46289,7 +46289,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -48204,7 +48204,7 @@ static int sp_384_ecc_mulmod_base_6(sp_point_384* r, const sp_digit* k,
|
||||
#endif /* WC_NO_CACHE_RESISTANT */
|
||||
#else
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_6_7[130] = {
|
||||
static const word8 recode_index_6_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -48217,7 +48217,7 @@ static const uint8_t recode_index_6_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_6_7[130] = {
|
||||
static const word8 recode_neg_6_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -48239,7 +48239,7 @@ static void sp_384_ecc_recode_7_6(const sp_digit* k, ecc_recode_384* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -48248,7 +48248,7 @@ static void sp_384_ecc_recode_7_6(const sp_digit* k, ecc_recode_384* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<55; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -48262,12 +48262,12 @@ static void sp_384_ecc_recode_7_6(const sp_digit* k, ecc_recode_384* v)
|
||||
}
|
||||
else if (++j < 6) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_6_7[y];
|
||||
v[i].neg = recode_neg_6_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -73516,13 +73516,13 @@ static void sp_521_proj_point_add_sub_9(sp_point_521* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_521 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_521;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_9_6[66] = {
|
||||
static const word8 recode_index_9_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -73531,7 +73531,7 @@ static const uint8_t recode_index_9_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_9_6[66] = {
|
||||
static const word8 recode_neg_9_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -73549,7 +73549,7 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -73558,7 +73558,7 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<87; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 64) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -73572,12 +73572,12 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
}
|
||||
else if (++j < 9) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x3f);
|
||||
y |= (word8)((n << (64 - o)) & 0x3f);
|
||||
o -= 58;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_9_6[y];
|
||||
v[i].neg = recode_neg_9_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -74233,7 +74233,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[64];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -74261,7 +74261,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -74681,7 +74681,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -74709,7 +74709,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -77260,7 +77260,7 @@ static int sp_521_ecc_mulmod_base_9(sp_point_521* r, const sp_digit* k,
|
||||
#endif /* WC_NO_CACHE_RESISTANT */
|
||||
#else
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_9_7[130] = {
|
||||
static const word8 recode_index_9_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -77273,7 +77273,7 @@ static const uint8_t recode_index_9_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_9_7[130] = {
|
||||
static const word8 recode_neg_9_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -77295,7 +77295,7 @@ static void sp_521_ecc_recode_7_9(const sp_digit* k, ecc_recode_521* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -77304,7 +77304,7 @@ static void sp_521_ecc_recode_7_9(const sp_digit* k, ecc_recode_521* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<75; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -77318,12 +77318,12 @@ static void sp_521_ecc_recode_7_9(const sp_digit* k, ecc_recode_521* v)
|
||||
}
|
||||
else if (++j < 9) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_9_7[y];
|
||||
v[i].neg = recode_neg_9_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -116078,7 +116078,7 @@ SP_NOINLINE static void sp_1024_mont_sqr_16(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
/* Mod-2 for the P1024 curve. */
|
||||
static const uint8_t p1024_mod_minus_2[] = {
|
||||
static const word8 p1024_mod_minus_2[] = {
|
||||
6,0x06, 7,0x0f, 7,0x0b, 6,0x0c, 7,0x1e, 9,0x09, 7,0x0c, 7,0x1f,
|
||||
6,0x16, 6,0x06, 7,0x0e, 8,0x10, 6,0x03, 8,0x11, 6,0x0d, 7,0x14,
|
||||
9,0x12, 6,0x0f, 7,0x04, 9,0x0d, 6,0x00, 7,0x13, 6,0x01, 6,0x07,
|
||||
@ -117595,13 +117595,13 @@ static void sp_1024_proj_point_add_sub_16(sp_point_1024* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_1024 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_1024;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_16_7[130] = {
|
||||
static const word8 recode_index_16_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -117614,7 +117614,7 @@ static const uint8_t recode_index_16_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_16_7[130] = {
|
||||
static const word8 recode_neg_16_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -117636,7 +117636,7 @@ static void sp_1024_ecc_recode_7_16(const sp_digit* k, ecc_recode_1024* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -117645,7 +117645,7 @@ static void sp_1024_ecc_recode_7_16(const sp_digit* k, ecc_recode_1024* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<147; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -117659,12 +117659,12 @@ static void sp_1024_ecc_recode_7_16(const sp_digit* k, ecc_recode_1024* v)
|
||||
}
|
||||
else if (++j < 16) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_16_7[y];
|
||||
v[i].neg = recode_neg_16_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -118133,7 +118133,7 @@ typedef struct sp_cache_1024_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_1024 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_1024_t;
|
||||
@ -118161,7 +118161,7 @@ static void sp_ecc_get_cache_1024(const sp_point_1024* g, sp_cache_1024_t** cach
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_1024_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
|
@ -9528,7 +9528,7 @@ SP_NOINLINE static sp_digit sp_2048_add_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -9616,7 +9616,7 @@ SP_NOINLINE static sp_digit sp_2048_add_word_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -9781,7 +9781,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_in_place_16(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -9940,7 +9940,7 @@ SP_NOINLINE static sp_digit sp_2048_add_16(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -10155,7 +10155,7 @@ SP_NOINLINE static sp_digit sp_2048_add_word_16(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -10464,7 +10464,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_in_place_32(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -10759,7 +10759,7 @@ SP_NOINLINE static sp_digit sp_2048_add_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -11106,7 +11106,7 @@ SP_NOINLINE static sp_digit sp_2048_add_word_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -11703,7 +11703,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_in_place_64(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -12270,7 +12270,7 @@ SP_NOINLINE static sp_digit sp_2048_add_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -19367,7 +19367,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -19560,7 +19560,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_16(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -19889,7 +19889,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -20005,7 +20005,7 @@ SP_NOINLINE static sp_digit sp_2048_add_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -20084,7 +20084,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_in_place_64(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -20881,7 +20881,7 @@ SP_NOINLINE static sp_digit sp_2048_add_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -20954,7 +20954,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_in_place_32(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -21925,7 +21925,7 @@ SP_NOINLINE static sp_digit sp_2048_cond_sub_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#define sp_2048_mont_reduce_order_64 sp_2048_mont_reduce_64
|
||||
@ -23824,7 +23824,7 @@ SP_NOINLINE static sp_digit div_2048_word_32(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* Compare a with b in constant time.
|
||||
@ -23933,7 +23933,7 @@ SP_NOINLINE static sp_int32 sp_2048_cmp_32(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -24397,7 +24397,7 @@ SP_NOINLINE static sp_digit sp_2048_cond_sub_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#define sp_2048_mont_reduce_order_64 sp_2048_mont_reduce_64
|
||||
@ -26122,7 +26122,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -26689,7 +26689,7 @@ SP_NOINLINE static sp_digit sp_2048_sub_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -27306,7 +27306,7 @@ SP_NOINLINE static sp_digit div_2048_word_64(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -27519,7 +27519,7 @@ SP_NOINLINE static sp_int32 sp_2048_cmp_64(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -28105,7 +28105,7 @@ SP_NOINLINE static sp_digit sp_2048_cond_add_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* RSA private key operation.
|
||||
@ -50970,7 +50970,7 @@ SP_NOINLINE static sp_digit sp_3072_add_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -51090,7 +51090,7 @@ SP_NOINLINE static sp_digit sp_3072_add_word_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -51327,7 +51327,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_in_place_24(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -51554,7 +51554,7 @@ SP_NOINLINE static sp_digit sp_3072_add_24(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -51837,7 +51837,7 @@ SP_NOINLINE static sp_digit sp_3072_add_word_24(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -52290,7 +52290,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_in_place_48(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -52721,7 +52721,7 @@ SP_NOINLINE static sp_digit sp_3072_add_48(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -53196,7 +53196,7 @@ SP_NOINLINE static sp_digit sp_3072_add_word_48(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -54081,7 +54081,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_in_place_96(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -54920,7 +54920,7 @@ SP_NOINLINE static sp_digit sp_3072_add_96(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -70307,7 +70307,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -70568,7 +70568,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_24(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -71033,7 +71033,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_48(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -71149,7 +71149,7 @@ SP_NOINLINE static sp_digit sp_3072_add_96(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -71228,7 +71228,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_in_place_96(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -72050,7 +72050,7 @@ SP_NOINLINE static sp_digit sp_3072_add_48(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -72123,7 +72123,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_in_place_48(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -73109,7 +73109,7 @@ SP_NOINLINE static sp_digit sp_3072_cond_sub_48(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#define sp_3072_mont_reduce_order_96 sp_3072_mont_reduce_96
|
||||
@ -75280,7 +75280,7 @@ SP_NOINLINE static sp_digit div_3072_word_48(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* Compare a with b in constant time.
|
||||
@ -75389,7 +75389,7 @@ SP_NOINLINE static sp_int32 sp_3072_cmp_48(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -75853,7 +75853,7 @@ SP_NOINLINE static sp_digit sp_3072_cond_sub_96(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#define sp_3072_mont_reduce_order_96 sp_3072_mont_reduce_96
|
||||
@ -78132,7 +78132,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_96(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -78971,7 +78971,7 @@ SP_NOINLINE static sp_digit sp_3072_sub_96(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -79588,7 +79588,7 @@ SP_NOINLINE static sp_digit div_3072_word_96(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -79806,7 +79806,7 @@ SP_NOINLINE static sp_int32 sp_3072_cmp_96(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -80392,7 +80392,7 @@ SP_NOINLINE static sp_digit sp_3072_cond_add_48(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* RSA private key operation.
|
||||
@ -84040,7 +84040,7 @@ SP_NOINLINE static sp_digit sp_4096_add_word_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -85213,7 +85213,7 @@ SP_NOINLINE static sp_digit sp_4096_sub_in_place_128(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -86324,7 +86324,7 @@ SP_NOINLINE static sp_digit sp_4096_add_128(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Multiply a and b into r. (r = a * b)
|
||||
@ -86477,7 +86477,7 @@ SP_NOINLINE static sp_digit sp_4096_add_128(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -86556,7 +86556,7 @@ SP_NOINLINE static sp_digit sp_4096_sub_in_place_128(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -87581,7 +87581,7 @@ SP_NOINLINE static sp_digit sp_4096_cond_sub_128(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#define sp_4096_mont_reduce_order_128 sp_4096_mont_reduce_128
|
||||
@ -90404,7 +90404,7 @@ SP_NOINLINE static sp_digit sp_4096_sub_128(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -91515,7 +91515,7 @@ SP_NOINLINE static sp_digit sp_4096_sub_128(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -92132,7 +92132,7 @@ SP_NOINLINE static sp_digit div_4096_word_128(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -92351,7 +92351,7 @@ SP_NOINLINE static sp_int32 sp_4096_cmp_128(const sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -92942,7 +92942,7 @@ SP_NOINLINE static sp_digit sp_4096_cond_add_64(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* RSA private key operation.
|
||||
@ -97455,7 +97455,7 @@ SP_NOINLINE static sp_digit sp_256_add_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -97547,7 +97547,7 @@ SP_NOINLINE static sp_digit sp_256_add_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -99039,7 +99039,7 @@ SP_NOINLINE static sp_int32 sp_256_cmp_8(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Normalize the values in each word to 32.
|
||||
@ -99108,7 +99108,7 @@ SP_NOINLINE static sp_digit sp_256_cond_sub_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Map the Montgomery form projective coordinate point to an affine point.
|
||||
@ -101546,7 +101546,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[16];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -101574,7 +101574,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -101967,7 +101967,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -101995,7 +101995,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -104321,7 +104321,7 @@ SP_NOINLINE static sp_digit sp_256_sub_in_place_8(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -104415,7 +104415,7 @@ SP_NOINLINE static sp_digit sp_256_sub_in_place_8(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -105218,7 +105218,7 @@ SP_NOINLINE static sp_digit div_256_word_8(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -105933,7 +105933,7 @@ SP_NOINLINE static sp_digit sp_256_sub_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -106024,7 +106024,7 @@ SP_NOINLINE static sp_digit sp_256_sub_8(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -107206,7 +107206,7 @@ static int sp_256_num_bits_8(sp_digit* a)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Non-constant time modular inversion.
|
||||
@ -109018,7 +109018,7 @@ SP_NOINLINE static sp_digit sp_384_add_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -109144,7 +109144,7 @@ SP_NOINLINE static sp_digit sp_384_add_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -109504,7 +109504,7 @@ SP_NOINLINE static sp_digit sp_384_cond_sub_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#define sp_384_mont_reduce_order_12 sp_384_mont_reduce_12
|
||||
@ -110483,7 +110483,7 @@ SP_NOINLINE static sp_int32 sp_384_cmp_12(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Normalize the values in each word to 32.
|
||||
@ -110645,7 +110645,7 @@ SP_NOINLINE static sp_digit sp_384_sub_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -110770,7 +110770,7 @@ SP_NOINLINE static sp_digit sp_384_sub_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -110840,7 +110840,7 @@ SP_NOINLINE static sp_digit sp_384_cond_add_12(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Subtract two Montgomery form numbers (r = a - b % m).
|
||||
@ -112394,7 +112394,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[16];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -112422,7 +112422,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -112831,7 +112831,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -112859,7 +112859,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -115221,7 +115221,7 @@ SP_NOINLINE static sp_digit sp_384_sub_in_place_12(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -115351,7 +115351,7 @@ SP_NOINLINE static sp_digit sp_384_sub_in_place_12(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -116154,7 +116154,7 @@ SP_NOINLINE static sp_digit div_384_word_12(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -118378,7 +118378,7 @@ static int sp_384_num_bits_12(sp_digit* a)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Non-constant time modular inversion.
|
||||
@ -120236,7 +120236,7 @@ SP_NOINLINE static sp_digit sp_521_add_17(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -120406,7 +120406,7 @@ SP_NOINLINE static sp_digit sp_521_add_17(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -120683,7 +120683,7 @@ SP_NOINLINE static sp_digit sp_521_cond_sub_17(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Reduce the number back to 521 bits using Montgomery reduction.
|
||||
@ -122745,7 +122745,7 @@ SP_NOINLINE static sp_int32 sp_521_cmp_17(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Normalize the values in each word to 32.
|
||||
@ -124328,7 +124328,7 @@ SP_NOINLINE static sp_digit sp_521_cond_add_17(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Right shift a by 1 bit into r. (r = a >> 1)
|
||||
@ -126018,7 +126018,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[16];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -126046,7 +126046,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -126475,7 +126475,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -126503,7 +126503,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -131093,7 +131093,7 @@ SP_NOINLINE static sp_digit sp_521_sub_in_place_17(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -131269,7 +131269,7 @@ SP_NOINLINE static sp_digit sp_521_sub_in_place_17(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -132072,7 +132072,7 @@ SP_NOINLINE static sp_digit div_521_word_17(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -132788,7 +132788,7 @@ SP_NOINLINE static sp_digit sp_521_sub_17(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#else
|
||||
@ -132957,7 +132957,7 @@ SP_NOINLINE static sp_digit sp_521_sub_17(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -135289,7 +135289,7 @@ static int sp_521_num_bits_17(sp_digit* a)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Non-constant time modular inversion.
|
||||
@ -199361,7 +199361,7 @@ SP_NOINLINE static sp_digit sp_1024_add_16(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -199513,7 +199513,7 @@ SP_NOINLINE static sp_digit sp_1024_add_word_16(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Sub b from a into a. (a -= b)
|
||||
@ -199822,7 +199822,7 @@ SP_NOINLINE static sp_digit sp_1024_sub_in_place_32(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Add b to a into r. (r = a + b)
|
||||
@ -200117,7 +200117,7 @@ SP_NOINLINE static sp_digit sp_1024_add_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -200342,7 +200342,7 @@ SP_NOINLINE static sp_digit sp_1024_sub_16(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Square a and put result in r. (r = a * a)
|
||||
@ -201213,7 +201213,7 @@ SP_NOINLINE static sp_digit sp_1024_sub_in_place_32(sp_digit* a,
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -201277,7 +201277,7 @@ SP_NOINLINE static sp_digit sp_1024_cond_sub_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
@ -201351,7 +201351,7 @@ SP_NOINLINE static sp_digit sp_1024_add_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
@ -202154,7 +202154,7 @@ SP_NOINLINE static sp_digit div_1024_word_32(sp_digit d1, sp_digit d0,
|
||||
:
|
||||
: "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)d1;
|
||||
return (word32)(size_t)d1;
|
||||
}
|
||||
|
||||
/* AND m into each word of a and store in r.
|
||||
@ -202293,7 +202293,7 @@ SP_NOINLINE static sp_int32 sp_1024_cmp_32(const sp_digit* a, const sp_digit* b)
|
||||
:
|
||||
: "memory", "r2", "r3", "r4", "r5", "r6", "r7", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)a;
|
||||
return (word32)(size_t)a;
|
||||
}
|
||||
|
||||
/* Divide d in a and put remainder into r (m*d + r = a)
|
||||
@ -203744,7 +203744,7 @@ SP_NOINLINE static void sp_1024_mont_sqr_32(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
/* Mod-2 for the P1024 curve. */
|
||||
static const uint8_t p1024_mod_minus_2[] = {
|
||||
static const word8 p1024_mod_minus_2[] = {
|
||||
6,0x06, 7,0x0f, 7,0x0b, 6,0x0c, 7,0x1e, 9,0x09, 7,0x0c, 7,0x1f,
|
||||
6,0x16, 6,0x06, 7,0x0e, 8,0x10, 6,0x03, 8,0x11, 6,0x0d, 7,0x14,
|
||||
9,0x12, 6,0x0f, 7,0x04, 9,0x0d, 6,0x00, 7,0x13, 6,0x01, 6,0x07,
|
||||
@ -208907,7 +208907,7 @@ SP_NOINLINE static sp_digit sp_1024_cond_add_32(sp_digit* r, const sp_digit* a,
|
||||
:
|
||||
: "memory", "r4", "r5", "r6", "r7", "r8", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)r;
|
||||
return (word32)(size_t)r;
|
||||
}
|
||||
|
||||
/* Right shift a by 1 bit into r. (r = a >> 1)
|
||||
@ -210617,7 +210617,7 @@ typedef struct sp_cache_1024_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_1024 table[16];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_1024_t;
|
||||
@ -210645,7 +210645,7 @@ static void sp_ecc_get_cache_1024(const sp_point_1024* g, sp_cache_1024_t** cach
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_1024_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -210973,7 +210973,7 @@ typedef struct sp_cache_1024_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_1024 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_1024_t;
|
||||
@ -211001,7 +211001,7 @@ static void sp_ecc_get_cache_1024(const sp_point_1024* g, sp_cache_1024_t** cach
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_1024_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
|
@ -22385,13 +22385,13 @@ static void sp_256_proj_point_add_sub_9(sp_point_256* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_256 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_256;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_9_6[66] = {
|
||||
static const word8 recode_index_9_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -22400,7 +22400,7 @@ static const uint8_t recode_index_9_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_9_6[66] = {
|
||||
static const word8 recode_neg_9_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -22418,7 +22418,7 @@ static void sp_256_ecc_recode_6_9(const sp_digit* k, ecc_recode_256* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -22427,7 +22427,7 @@ static void sp_256_ecc_recode_6_9(const sp_digit* k, ecc_recode_256* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<43; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 29) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -22441,12 +22441,12 @@ static void sp_256_ecc_recode_6_9(const sp_digit* k, ecc_recode_256* v)
|
||||
}
|
||||
else if (++j < 9) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (29 - o)) & 0x3f);
|
||||
y |= (word8)((n << (29 - o)) & 0x3f);
|
||||
o -= 23;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_9_6[y];
|
||||
v[i].neg = recode_neg_9_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -23046,7 +23046,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -23074,7 +23074,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -25976,7 +25976,7 @@ static int sp_256_num_bits_29_9(sp_digit v)
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
return sp_256_tab32_9[(uint32_t)(v*0x07C4ACDD) >> 27];
|
||||
return sp_256_tab32_9[(word32)(v*0x07C4ACDD) >> 27];
|
||||
}
|
||||
|
||||
static int sp_256_num_bits_9(const sp_digit* a)
|
||||
@ -29854,13 +29854,13 @@ static void sp_384_proj_point_add_sub_15(sp_point_384* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_384 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_384;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_15_6[66] = {
|
||||
static const word8 recode_index_15_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -29869,7 +29869,7 @@ static const uint8_t recode_index_15_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_15_6[66] = {
|
||||
static const word8 recode_neg_15_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -29887,7 +29887,7 @@ static void sp_384_ecc_recode_6_15(const sp_digit* k, ecc_recode_384* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -29896,7 +29896,7 @@ static void sp_384_ecc_recode_6_15(const sp_digit* k, ecc_recode_384* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<65; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 26) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -29910,12 +29910,12 @@ static void sp_384_ecc_recode_6_15(const sp_digit* k, ecc_recode_384* v)
|
||||
}
|
||||
else if (++j < 15) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (26 - o)) & 0x3f);
|
||||
y |= (word8)((n << (26 - o)) & 0x3f);
|
||||
o -= 20;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_15_6[y];
|
||||
v[i].neg = recode_neg_15_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -30575,7 +30575,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -30603,7 +30603,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -34026,7 +34026,7 @@ static int sp_384_num_bits_26_15(sp_digit v)
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
return sp_384_tab32_15[(uint32_t)(v*0x07C4ACDD) >> 27];
|
||||
return sp_384_tab32_15[(word32)(v*0x07C4ACDD) >> 27];
|
||||
}
|
||||
|
||||
static int sp_384_num_bits_15(const sp_digit* a)
|
||||
@ -37373,13 +37373,13 @@ static void sp_521_proj_point_add_sub_21(sp_point_521* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_521 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_521;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_21_6[66] = {
|
||||
static const word8 recode_index_21_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -37388,7 +37388,7 @@ static const uint8_t recode_index_21_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_21_6[66] = {
|
||||
static const word8 recode_neg_21_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -37406,7 +37406,7 @@ static void sp_521_ecc_recode_6_21(const sp_digit* k, ecc_recode_521* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -37415,7 +37415,7 @@ static void sp_521_ecc_recode_6_21(const sp_digit* k, ecc_recode_521* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<87; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 25) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -37429,12 +37429,12 @@ static void sp_521_ecc_recode_6_21(const sp_digit* k, ecc_recode_521* v)
|
||||
}
|
||||
else if (++j < 21) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (25 - o)) & 0x3f);
|
||||
y |= (word8)((n << (25 - o)) & 0x3f);
|
||||
o -= 19;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_21_6[y];
|
||||
v[i].neg = recode_neg_21_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -38154,7 +38154,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -38182,7 +38182,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -42161,7 +42161,7 @@ static int sp_521_num_bits_25_21(sp_digit v)
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
return sp_521_tab32_21[(uint32_t)(v*0x07C4ACDD) >> 27];
|
||||
return sp_521_tab32_21[(word32)(v*0x07C4ACDD) >> 27];
|
||||
}
|
||||
|
||||
static int sp_521_num_bits_21(const sp_digit* a)
|
||||
@ -44810,7 +44810,7 @@ SP_NOINLINE static void sp_1024_mont_sqr_42(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
/* Mod-2 for the P1024 curve. */
|
||||
static const uint8_t p1024_mod_minus_2[] = {
|
||||
static const word8 p1024_mod_minus_2[] = {
|
||||
6,0x06, 7,0x0f, 7,0x0b, 6,0x0c, 7,0x1e, 9,0x09, 7,0x0c, 7,0x1f,
|
||||
6,0x16, 6,0x06, 7,0x0e, 8,0x10, 6,0x03, 8,0x11, 6,0x0d, 7,0x14,
|
||||
9,0x12, 6,0x0f, 7,0x04, 9,0x0d, 6,0x00, 7,0x13, 6,0x01, 6,0x07,
|
||||
@ -46182,13 +46182,13 @@ static void sp_1024_proj_point_add_sub_42(sp_point_1024* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_1024 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_1024;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_42_7[130] = {
|
||||
static const word8 recode_index_42_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -46201,7 +46201,7 @@ static const uint8_t recode_index_42_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_42_7[130] = {
|
||||
static const word8 recode_neg_42_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -46223,7 +46223,7 @@ static void sp_1024_ecc_recode_7_42(const sp_digit* k, ecc_recode_1024* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -46232,7 +46232,7 @@ static void sp_1024_ecc_recode_7_42(const sp_digit* k, ecc_recode_1024* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<147; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 25) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -46246,12 +46246,12 @@ static void sp_1024_ecc_recode_7_42(const sp_digit* k, ecc_recode_1024* v)
|
||||
}
|
||||
else if (++j < 42) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (25 - o)) & 0x7f);
|
||||
y |= (word8)((n << (25 - o)) & 0x7f);
|
||||
o -= 18;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_42_7[y];
|
||||
v[i].neg = recode_neg_42_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -46714,7 +46714,7 @@ typedef struct sp_cache_1024_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_1024 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_1024_t;
|
||||
@ -46742,7 +46742,7 @@ static void sp_ecc_get_cache_1024(const sp_point_1024* g, sp_cache_1024_t** cach
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_1024_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
|
@ -23321,13 +23321,13 @@ static void sp_256_proj_point_add_sub_5(sp_point_256* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_256 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_256;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_5_6[66] = {
|
||||
static const word8 recode_index_5_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -23336,7 +23336,7 @@ static const uint8_t recode_index_5_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_5_6[66] = {
|
||||
static const word8 recode_neg_5_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -23354,7 +23354,7 @@ static void sp_256_ecc_recode_6_5(const sp_digit* k, ecc_recode_256* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -23363,7 +23363,7 @@ static void sp_256_ecc_recode_6_5(const sp_digit* k, ecc_recode_256* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<43; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 52) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -23377,12 +23377,12 @@ static void sp_256_ecc_recode_6_5(const sp_digit* k, ecc_recode_256* v)
|
||||
}
|
||||
else if (++j < 5) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (52 - o)) & 0x3f);
|
||||
y |= (word8)((n << (52 - o)) & 0x3f);
|
||||
o -= 46;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_5_6[y];
|
||||
v[i].neg = recode_neg_5_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -23942,7 +23942,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -23970,7 +23970,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -26863,7 +26863,7 @@ static int sp_256_num_bits_52_5(sp_digit v)
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
v |= v >> 32;
|
||||
return sp_256_tab64_5[((uint64_t)((v - (v >> 1))*0x07EDD5E59A4E28C2)) >> 58];
|
||||
return sp_256_tab64_5[((word64)((v - (v >> 1))*0x07EDD5E59A4E28C2)) >> 58];
|
||||
}
|
||||
|
||||
static int sp_256_num_bits_5(const sp_digit* a)
|
||||
@ -30257,13 +30257,13 @@ static void sp_384_proj_point_add_sub_7(sp_point_384* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_384 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_384;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_7_6[66] = {
|
||||
static const word8 recode_index_7_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -30272,7 +30272,7 @@ static const uint8_t recode_index_7_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_7_6[66] = {
|
||||
static const word8 recode_neg_7_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -30290,7 +30290,7 @@ static void sp_384_ecc_recode_6_7(const sp_digit* k, ecc_recode_384* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -30299,7 +30299,7 @@ static void sp_384_ecc_recode_6_7(const sp_digit* k, ecc_recode_384* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<65; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 55) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -30313,12 +30313,12 @@ static void sp_384_ecc_recode_6_7(const sp_digit* k, ecc_recode_384* v)
|
||||
}
|
||||
else if (++j < 7) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (55 - o)) & 0x3f);
|
||||
y |= (word8)((n << (55 - o)) & 0x3f);
|
||||
o -= 49;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_7_6[y];
|
||||
v[i].neg = recode_neg_7_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -30898,7 +30898,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -30926,7 +30926,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -34304,7 +34304,7 @@ static int sp_384_num_bits_55_7(sp_digit v)
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
v |= v >> 32;
|
||||
return sp_384_tab64_7[((uint64_t)((v - (v >> 1))*0x07EDD5E59A4E28C2)) >> 58];
|
||||
return sp_384_tab64_7[((word64)((v - (v >> 1))*0x07EDD5E59A4E28C2)) >> 58];
|
||||
}
|
||||
|
||||
static int sp_384_num_bits_7(const sp_digit* a)
|
||||
@ -37654,13 +37654,13 @@ static void sp_521_proj_point_add_sub_9(sp_point_521* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_521 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_521;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_9_6[66] = {
|
||||
static const word8 recode_index_9_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -37669,7 +37669,7 @@ static const uint8_t recode_index_9_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_9_6[66] = {
|
||||
static const word8 recode_neg_9_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -37687,7 +37687,7 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -37696,7 +37696,7 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<87; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 58) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -37710,12 +37710,12 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
}
|
||||
else if (++j < 9) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (58 - o)) & 0x3f);
|
||||
y |= (word8)((n << (58 - o)) & 0x3f);
|
||||
o -= 52;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_9_6[y];
|
||||
v[i].neg = recode_neg_9_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -38315,7 +38315,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -38343,7 +38343,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -41753,7 +41753,7 @@ static int sp_521_num_bits_58_9(sp_digit v)
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
v |= v >> 32;
|
||||
return sp_521_tab64_9[((uint64_t)((v - (v >> 1))*0x07EDD5E59A4E28C2)) >> 58];
|
||||
return sp_521_tab64_9[((word64)((v - (v >> 1))*0x07EDD5E59A4E28C2)) >> 58];
|
||||
}
|
||||
|
||||
static int sp_521_num_bits_9(const sp_digit* a)
|
||||
@ -44236,7 +44236,7 @@ SP_NOINLINE static void sp_1024_mont_sqr_18(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
/* Mod-2 for the P1024 curve. */
|
||||
static const uint8_t p1024_mod_minus_2[] = {
|
||||
static const word8 p1024_mod_minus_2[] = {
|
||||
6,0x06, 7,0x0f, 7,0x0b, 6,0x0c, 7,0x1e, 9,0x09, 7,0x0c, 7,0x1f,
|
||||
6,0x16, 6,0x06, 7,0x0e, 8,0x10, 6,0x03, 8,0x11, 6,0x0d, 7,0x14,
|
||||
9,0x12, 6,0x0f, 7,0x04, 9,0x0d, 6,0x00, 7,0x13, 6,0x01, 6,0x07,
|
||||
@ -45525,13 +45525,13 @@ static void sp_1024_proj_point_add_sub_18(sp_point_1024* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_1024 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_1024;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_18_7[130] = {
|
||||
static const word8 recode_index_18_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -45544,7 +45544,7 @@ static const uint8_t recode_index_18_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_18_7[130] = {
|
||||
static const word8 recode_neg_18_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -45566,7 +45566,7 @@ static void sp_1024_ecc_recode_7_18(const sp_digit* k, ecc_recode_1024* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -45575,7 +45575,7 @@ static void sp_1024_ecc_recode_7_18(const sp_digit* k, ecc_recode_1024* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<147; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 57) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -45589,12 +45589,12 @@ static void sp_1024_ecc_recode_7_18(const sp_digit* k, ecc_recode_1024* v)
|
||||
}
|
||||
else if (++j < 18) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (57 - o)) & 0x7f);
|
||||
y |= (word8)((n << (57 - o)) & 0x7f);
|
||||
o -= 50;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_18_7[y];
|
||||
v[i].neg = recode_neg_18_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -46057,7 +46057,7 @@ typedef struct sp_cache_1024_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_1024 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_1024_t;
|
||||
@ -46085,7 +46085,7 @@ static void sp_ecc_get_cache_1024(const sp_point_1024* g, sp_cache_1024_t** cach
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_1024_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1309,7 +1309,7 @@ static void sp_256_mont_sqr_n_10(sp_digit* r, const sp_digit* a, int n,
|
||||
#endif /* !WOLFSSL_SP_SMALL || HAVE_COMP_KEY */
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
/* Mod-2 for the P256 curve. */
|
||||
static const uint32_t p256_mod_2[8] = {
|
||||
static const word32 p256_mod_2[8] = {
|
||||
0xfffffffdU,0xffffffffU,0xffffffffU,0x00000000U,0x00000000U,0x00000000U,
|
||||
0x00000001U,0xffffffffU
|
||||
};
|
||||
@ -2607,7 +2607,7 @@ typedef struct sp_cache_t {
|
||||
sp_digit x[10] __attribute__((aligned(128)));
|
||||
sp_digit y[10] __attribute__((aligned(128)));
|
||||
sp_table_entry table[256] __attribute__((aligned(128)));
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
int set;
|
||||
} sp_cache_t;
|
||||
|
||||
@ -2625,7 +2625,7 @@ static THREAD_LS_T int sp_cache_inited = 0;
|
||||
static void sp_ecc_get_cache(const sp_point* g, sp_cache_t** cache)
|
||||
{
|
||||
int i, j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -4251,13 +4251,13 @@ static int sp_256_mod_10(sp_digit* r, const sp_digit* a, const sp_digit* m)
|
||||
#if defined(HAVE_ECC_SIGN) || defined(HAVE_ECC_VERIFY)
|
||||
#ifdef WOLFSSL_SP_SMALL
|
||||
/* Order-2 for the P256 curve. */
|
||||
static const uint32_t p256_order_2[8] = {
|
||||
static const word32 p256_order_2[8] = {
|
||||
0xfc63254fU,0xf3b9cac2U,0xa7179e84U,0xbce6faadU,0xffffffffU,0xffffffffU,
|
||||
0x00000000U,0xffffffffU
|
||||
};
|
||||
#else
|
||||
/* The low half of the order-2 of the P256 curve. */
|
||||
static const uint32_t p256_order_low[4] = {
|
||||
static const word32 p256_order_low[4] = {
|
||||
0xfc63254fU,0xf3b9cac2U,0xa7179e84U,0xbce6faadU
|
||||
};
|
||||
#endif /* WOLFSSL_SP_SMALL */
|
||||
|
@ -3458,7 +3458,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo,
|
||||
:
|
||||
: "r3", "r4", "r5", "r6", "r7", "r8", "r9", "cc"
|
||||
);
|
||||
return (uint32_t)(size_t)hi;
|
||||
return (sp_uint32)(size_t)hi;
|
||||
}
|
||||
|
||||
#define SP_ASM_DIV_WORD
|
||||
|
@ -9374,13 +9374,13 @@ static void sp_256_proj_point_add_sub_4(sp_point_256* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_256 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_256;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_4_6[66] = {
|
||||
static const word8 recode_index_4_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -9389,7 +9389,7 @@ static const uint8_t recode_index_4_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_4_6[66] = {
|
||||
static const word8 recode_neg_4_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -9407,7 +9407,7 @@ static void sp_256_ecc_recode_6_4(const sp_digit* k, ecc_recode_256* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -9416,7 +9416,7 @@ static void sp_256_ecc_recode_6_4(const sp_digit* k, ecc_recode_256* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<43; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 64) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -9430,12 +9430,12 @@ static void sp_256_ecc_recode_6_4(const sp_digit* k, ecc_recode_256* v)
|
||||
}
|
||||
else if (++j < 4) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x3f);
|
||||
y |= (word8)((n << (64 - o)) & 0x3f);
|
||||
o -= 58;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_4_6[y];
|
||||
v[i].neg = recode_neg_4_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -10976,7 +10976,7 @@ typedef struct sp_cache_256_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_256 table[64];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_256_t;
|
||||
@ -11004,7 +11004,7 @@ static void sp_ecc_get_cache_256(const sp_point_256* g, sp_cache_256_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_256_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -12047,7 +12047,7 @@ static int sp_256_ecc_mulmod_base_avx2_4(sp_point_256* r, const sp_digit* k,
|
||||
#endif /* HAVE_INTEL_AVX2 */
|
||||
#else /* WOLFSSL_SP_SMALL */
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_4_7[130] = {
|
||||
static const word8 recode_index_4_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -12060,7 +12060,7 @@ static const uint8_t recode_index_4_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_4_7[130] = {
|
||||
static const word8 recode_neg_4_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -12082,7 +12082,7 @@ static void sp_256_ecc_recode_7_4(const sp_digit* k, ecc_recode_256* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -12091,7 +12091,7 @@ static void sp_256_ecc_recode_7_4(const sp_digit* k, ecc_recode_256* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<37; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -12105,12 +12105,12 @@ static void sp_256_ecc_recode_7_4(const sp_digit* k, ecc_recode_256* v)
|
||||
}
|
||||
else if (++j < 4) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_4_7[y];
|
||||
v[i].neg = recode_neg_4_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -28535,13 +28535,13 @@ static void sp_384_proj_point_add_sub_6(sp_point_384* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_384 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_384;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_6_6[66] = {
|
||||
static const word8 recode_index_6_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -28550,7 +28550,7 @@ static const uint8_t recode_index_6_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_6_6[66] = {
|
||||
static const word8 recode_neg_6_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -28568,7 +28568,7 @@ static void sp_384_ecc_recode_6_6(const sp_digit* k, ecc_recode_384* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -28577,7 +28577,7 @@ static void sp_384_ecc_recode_6_6(const sp_digit* k, ecc_recode_384* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<65; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 64) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -28591,12 +28591,12 @@ static void sp_384_ecc_recode_6_6(const sp_digit* k, ecc_recode_384* v)
|
||||
}
|
||||
else if (++j < 6) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x3f);
|
||||
y |= (word8)((n << (64 - o)) & 0x3f);
|
||||
o -= 58;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_6_6[y];
|
||||
v[i].neg = recode_neg_6_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -30193,7 +30193,7 @@ typedef struct sp_cache_384_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_384 table[64];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_384_t;
|
||||
@ -30221,7 +30221,7 @@ static void sp_ecc_get_cache_384(const sp_point_384* g, sp_cache_384_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_384_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -31267,7 +31267,7 @@ static int sp_384_ecc_mulmod_base_avx2_6(sp_point_384* r, const sp_digit* k,
|
||||
#endif /* HAVE_INTEL_AVX2 */
|
||||
#else /* WOLFSSL_SP_SMALL */
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_6_7[130] = {
|
||||
static const word8 recode_index_6_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -31280,7 +31280,7 @@ static const uint8_t recode_index_6_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_6_7[130] = {
|
||||
static const word8 recode_neg_6_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -31302,7 +31302,7 @@ static void sp_384_ecc_recode_7_6(const sp_digit* k, ecc_recode_384* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -31311,7 +31311,7 @@ static void sp_384_ecc_recode_7_6(const sp_digit* k, ecc_recode_384* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<55; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -31325,12 +31325,12 @@ static void sp_384_ecc_recode_7_6(const sp_digit* k, ecc_recode_384* v)
|
||||
}
|
||||
else if (++j < 6) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_6_7[y];
|
||||
v[i].neg = recode_neg_6_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -53465,13 +53465,13 @@ static void sp_521_proj_point_add_sub_9(sp_point_521* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_521 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_521;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_9_6[66] = {
|
||||
static const word8 recode_index_9_6[66] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
|
||||
@ -53480,7 +53480,7 @@ static const uint8_t recode_index_9_6[66] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_9_6[66] = {
|
||||
static const word8 recode_neg_9_6[66] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@ -53498,7 +53498,7 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -53507,7 +53507,7 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<87; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 6 < 64) {
|
||||
y &= 0x3f;
|
||||
n >>= 6;
|
||||
@ -53521,12 +53521,12 @@ static void sp_521_ecc_recode_6_9(const sp_digit* k, ecc_recode_521* v)
|
||||
}
|
||||
else if (++j < 9) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x3f);
|
||||
y |= (word8)((n << (64 - o)) & 0x3f);
|
||||
o -= 58;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_9_6[y];
|
||||
v[i].neg = recode_neg_9_6[y];
|
||||
carry = (y >> 6) + v[i].neg;
|
||||
@ -55100,7 +55100,7 @@ typedef struct sp_cache_521_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_521 table[64];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_521_t;
|
||||
@ -55128,7 +55128,7 @@ static void sp_ecc_get_cache_521(const sp_point_521* g, sp_cache_521_t** cache)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_521_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
@ -56300,7 +56300,7 @@ static int sp_521_ecc_mulmod_base_avx2_9(sp_point_521* r, const sp_digit* k,
|
||||
#endif /* HAVE_INTEL_AVX2 */
|
||||
#else /* WOLFSSL_SP_SMALL */
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_9_7[130] = {
|
||||
static const word8 recode_index_9_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -56313,7 +56313,7 @@ static const uint8_t recode_index_9_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_9_7[130] = {
|
||||
static const word8 recode_neg_9_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -56335,7 +56335,7 @@ static void sp_521_ecc_recode_7_9(const sp_digit* k, ecc_recode_521* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -56344,7 +56344,7 @@ static void sp_521_ecc_recode_7_9(const sp_digit* k, ecc_recode_521* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<75; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -56358,12 +56358,12 @@ static void sp_521_ecc_recode_7_9(const sp_digit* k, ecc_recode_521* v)
|
||||
}
|
||||
else if (++j < 9) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_9_7[y];
|
||||
v[i].neg = recode_neg_9_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -93842,7 +93842,7 @@ SP_NOINLINE static void sp_1024_mont_sqr_16(sp_digit* r, const sp_digit* a,
|
||||
}
|
||||
|
||||
/* Mod-2 for the P1024 curve. */
|
||||
static const uint8_t p1024_mod_minus_2[] = {
|
||||
static const word8 p1024_mod_minus_2[] = {
|
||||
6,0x06, 7,0x0f, 7,0x0b, 6,0x0c, 7,0x1e, 9,0x09, 7,0x0c, 7,0x1f,
|
||||
6,0x16, 6,0x06, 7,0x0e, 8,0x10, 6,0x03, 8,0x11, 6,0x0d, 7,0x14,
|
||||
9,0x12, 6,0x0f, 7,0x04, 9,0x0d, 6,0x00, 7,0x13, 6,0x01, 6,0x07,
|
||||
@ -94751,13 +94751,13 @@ static void sp_1024_proj_point_add_sub_16(sp_point_1024* ra,
|
||||
/* Structure used to describe recoding of scalar multiplication. */
|
||||
typedef struct ecc_recode_1024 {
|
||||
/* Index into pre-computation table. */
|
||||
uint8_t i;
|
||||
word8 i;
|
||||
/* Use the negative of the point. */
|
||||
uint8_t neg;
|
||||
word8 neg;
|
||||
} ecc_recode_1024;
|
||||
|
||||
/* The index into pre-computation table to use. */
|
||||
static const uint8_t recode_index_16_7[130] = {
|
||||
static const word8 recode_index_16_7[130] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
@ -94770,7 +94770,7 @@ static const uint8_t recode_index_16_7[130] = {
|
||||
};
|
||||
|
||||
/* Whether to negate y-ordinate. */
|
||||
static const uint8_t recode_neg_16_7[130] = {
|
||||
static const word8 recode_neg_16_7[130] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@ -94792,7 +94792,7 @@ static void sp_1024_ecc_recode_7_16(const sp_digit* k, ecc_recode_1024* v)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint8_t y;
|
||||
word8 y;
|
||||
int carry = 0;
|
||||
int o;
|
||||
sp_digit n;
|
||||
@ -94801,7 +94801,7 @@ static void sp_1024_ecc_recode_7_16(const sp_digit* k, ecc_recode_1024* v)
|
||||
n = k[j];
|
||||
o = 0;
|
||||
for (i=0; i<147; i++) {
|
||||
y = (uint8_t)(int8_t)n;
|
||||
y = (word8)(int8_t)n;
|
||||
if (o + 7 < 64) {
|
||||
y &= 0x7f;
|
||||
n >>= 7;
|
||||
@ -94815,12 +94815,12 @@ static void sp_1024_ecc_recode_7_16(const sp_digit* k, ecc_recode_1024* v)
|
||||
}
|
||||
else if (++j < 16) {
|
||||
n = k[j];
|
||||
y |= (uint8_t)((n << (64 - o)) & 0x7f);
|
||||
y |= (word8)((n << (64 - o)) & 0x7f);
|
||||
o -= 57;
|
||||
n >>= o;
|
||||
}
|
||||
|
||||
y += (uint8_t)carry;
|
||||
y += (word8)carry;
|
||||
v[i].i = recode_index_16_7[y];
|
||||
v[i].neg = recode_neg_16_7[y];
|
||||
carry = (y >> 7) + v[i].neg;
|
||||
@ -96329,7 +96329,7 @@ typedef struct sp_cache_1024_t {
|
||||
/* Precomputation table for point. */
|
||||
sp_table_entry_1024 table[256];
|
||||
/* Count of entries in table. */
|
||||
uint32_t cnt;
|
||||
word32 cnt;
|
||||
/* Point and table set in entry. */
|
||||
int set;
|
||||
} sp_cache_1024_t;
|
||||
@ -96357,7 +96357,7 @@ static void sp_ecc_get_cache_1024(const sp_point_1024* g, sp_cache_1024_t** cach
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
uint32_t least;
|
||||
word32 least;
|
||||
|
||||
if (sp_cache_1024_inited == 0) {
|
||||
for (i=0; i<FP_ENTRIES; i++) {
|
||||
|
Reference in New Issue
Block a user