char defaults to signed on x86/x64, but unsigned on ARM.
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_CryptoPro_A_ParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_CryptoPro_A_ParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_CryptoPro_B_ParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_CryptoPro_B_ParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_CryptoPro_C_ParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_CryptoPro_C_ParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
/* temporary variables */
fe_t t0, t1, t2, t3, t4;
/* constants */
- const limb_t *b3 = const_b3;
const limb_t *a = const_a;
+ const limb_t *b3 = const_b3;
/* set pointers for legacy curve arith */
const limb_t *X = P->X;
const limb_t *Y = P->Y;
/* temporary variables */
fe_t t0, t1, t2, t3, t4, t5;
/* constants */
- const limb_t *b3 = const_b3;
const limb_t *a = const_a;
+ const limb_t *b3 = const_b3;
/* set pointers for legacy curve arith */
const limb_t *X1 = Q->X;
const limb_t *Y1 = Q->Y;
/* temporary variables */
fe_t t0, t1, t2, t3, t4, t5;
/* constants */
- const limb_t *b3 = const_b3;
const limb_t *a = const_a;
+ const limb_t *b3 = const_b3;
/* set pointers for legacy curve arith */
const limb_t *X1 = Q->X;
const limb_t *Y1 = Q->Y;
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_TestParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
/* temporary variables */
fe_t t0, t1, t2, t3, t4;
/* constants */
- const limb_t *a = const_a;
const limb_t *b3 = const_b3;
+ const limb_t *a = const_a;
/* set pointers for legacy curve arith */
const limb_t *X = P->X;
const limb_t *Y = P->Y;
/* temporary variables */
fe_t t0, t1, t2, t3, t4, t5;
/* constants */
- const limb_t *a = const_a;
const limb_t *b3 = const_b3;
+ const limb_t *a = const_a;
/* set pointers for legacy curve arith */
const limb_t *X1 = Q->X;
const limb_t *Y1 = Q->Y;
/* temporary variables */
fe_t t0, t1, t2, t3, t4, t5;
/* constants */
- const limb_t *a = const_a;
const limb_t *b3 = const_b3;
+ const limb_t *a = const_a;
/* set pointers for legacy curve arith */
const limb_t *X1 = Q->X;
const limb_t *Y1 = Q->Y;
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_GostR3410_2001_TestParamSet_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
/* temporary variables */
fe_t t0, t1;
/* constants */
- const limb_t *S = const_S;
const limb_t *T = const_T;
+ const limb_t *S = const_S;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
const limb_t *Z1 = P->Z;
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
- const limb_t *S = const_S;
const limb_t *T = const_T;
+ const limb_t *S = const_S;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_256_paramSetA_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
/* temporary variables */
fe_t t0, t1;
/* constants */
- const limb_t *S = const_S;
const limb_t *T = const_T;
+ const limb_t *S = const_S;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
const limb_t *Z1 = P->Z;
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
- const limb_t *S = const_S;
const limb_t *T = const_T;
+ const limb_t *S = const_S;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[52], const unsigned char in[32]) {
+static void scalar_rwnaf(int8_t out[52], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 51; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[257], const unsigned char in[32]) {
+static void scalar_wnaf(int8_t out[257], const unsigned char in[32]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 257; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[32],
const unsigned char b[32], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[257] = {0};
- char bnaf[257] = {0};
+ int8_t anaf[257] = {0};
+ int8_t bnaf[257] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[32],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[32]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[52] = {0};
+ int8_t rnaf[52] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_256_paramSetA_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[32] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[103], const unsigned char in[64]) {
+static void scalar_rwnaf(int8_t out[103], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 102; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[513], const unsigned char in[64]) {
+static void scalar_wnaf(int8_t out[513], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 513; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[64],
const unsigned char b[64], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[513] = {0};
- char bnaf[513] = {0};
+ int8_t anaf[513] = {0};
+ int8_t bnaf[513] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[64],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[64]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_512_paramSetA_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[64] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[103], const unsigned char in[64]) {
+static void scalar_rwnaf(int8_t out[103], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 102; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[513], const unsigned char in[64]) {
+static void scalar_wnaf(int8_t out[513], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 513; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[64],
const unsigned char b[64], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[513] = {0};
- char bnaf[513] = {0};
+ int8_t anaf[513] = {0};
+ int8_t bnaf[513] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[64],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[64]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_512_paramSetA_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[64] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[103], const unsigned char in[64]) {
+static void scalar_rwnaf(int8_t out[103], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 102; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[513], const unsigned char in[64]) {
+static void scalar_wnaf(int8_t out[513], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 513; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[64],
const unsigned char b[64], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[513] = {0};
- char bnaf[513] = {0};
+ int8_t anaf[513] = {0};
+ int8_t bnaf[513] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[64],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[64]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_512_paramSetB_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[64] = {0};
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[103], const unsigned char in[64]) {
+static void scalar_rwnaf(int8_t out[103], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 102; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[513], const unsigned char in[64]) {
+static void scalar_wnaf(int8_t out[513], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 513; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[64],
const unsigned char b[64], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[513] = {0};
- char bnaf[513] = {0};
+ int8_t anaf[513] = {0};
+ int8_t bnaf[513] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[64],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[64]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_512_paramSetB_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[64] = {0};
/* temporary variables */
fe_t t0, t1;
/* constants */
- const limb_t *T = const_T;
const limb_t *S = const_S;
+ const limb_t *T = const_T;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
const limb_t *Z1 = P->Z;
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
- const limb_t *T = const_T;
const limb_t *S = const_S;
+ const limb_t *T = const_T;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[103], const unsigned char in[64]) {
+static void scalar_rwnaf(int8_t out[103], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 102; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[513], const unsigned char in[64]) {
+static void scalar_wnaf(int8_t out[513], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 513; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[64],
const unsigned char b[64], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[513] = {0};
- char bnaf[513] = {0};
+ int8_t anaf[513] = {0};
+ int8_t bnaf[513] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[64],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[64]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_512_paramSetC_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[64] = {0};
/* temporary variables */
fe_t t0, t1;
/* constants */
- const limb_t *S = const_S;
const limb_t *T = const_T;
+ const limb_t *S = const_S;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
const limb_t *Z1 = P->Z;
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
- const limb_t *S = const_S;
const limb_t *T = const_T;
+ const limb_t *S = const_S;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;
* {\pm 1, \pm 3, \pm 5, \pm 7, \pm 9, ...}
* i.e. signed odd digits with _no zeroes_ -- that makes it "regular".
*/
-static void scalar_rwnaf(char out[103], const unsigned char in[64]) {
+static void scalar_rwnaf(int8_t out[103], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = (in[0] & (DRADIX_WNAF - 1)) | 1;
for (i = 0; i < 102; i++) {
* Compute "textbook" wnaf representation of a scalar.
* NB: not constant time
*/
-static void scalar_wnaf(char out[513], const unsigned char in[64]) {
+static void scalar_wnaf(int8_t out[513], const unsigned char in[64]) {
int i;
- char window, d;
+ int8_t window, d;
window = in[0] & (DRADIX_WNAF - 1);
for (i = 0; i < 513; i++) {
static void var_smul_wnaf_two(pt_aff_t *out, const unsigned char a[64],
const unsigned char b[64], const pt_aff_t *P) {
int i, d, is_neg, is_inf = 1, flipped = 0;
- char anaf[513] = {0};
- char bnaf[513] = {0};
+ int8_t anaf[513] = {0};
+ int8_t bnaf[513] = {0};
pt_prj_t Q;
pt_prj_t precomp[DRADIX / 2];
static void var_smul_rwnaf(pt_aff_t *out, const unsigned char scalar[64],
const pt_aff_t *P) {
int i, j, d, diff, is_neg;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, lut;
pt_prj_t precomp[DRADIX / 2];
*/
static void fixed_smul_cmb(pt_aff_t *out, const unsigned char scalar[64]) {
int i, j, k, d, diff, is_neg = 0;
- char rnaf[103] = {0};
+ int8_t rnaf[103] = {0};
pt_prj_t Q, R;
pt_aff_t lut;
fiat_id_tc26_gost_3410_2012_512_paramSetC_to_bytes(outy, P.Y);
}
+
#include <openssl/ec.h>
static const unsigned char const_zb[64] = {0};