summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9242b82)
ECCKiila Changes from
https://gitlab.com/nisec/ecckiila/-/issues/2
https://gitlab.com/nisec/ecckiila/-/commit/
7445ecabef77965743e0ae8d39d7433b07820be6
* X3 -> X1
* eliminate a temp variable
X3 = X1 as pointers is the reason this was still passing unit tests.
But that might not hold in future versions of ECCKiila, so fix it now.
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
- const limb_t *T = const_T;
const limb_t *S = const_S;
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;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
const limb_t *Z1 = P->Z;
limb_t *Z3 = Q->Z;
/* the curve arith formula */
limb_t *Z3 = Q->Z;
/* the curve arith formula */
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(t0, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_sub(t1, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(T3, S, t0);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(T3, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_sub(t0, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(T3, S, T3);
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Y3, Z1, T3);
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Y3, Z1, T3);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Z3, X3, t1);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(t1, t1, T);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(t0, T3, t1);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Z3, X1, t0);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(t0, t0, T);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(t0, T3, t0);
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(X3, X1, t0);
}
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(X3, X1, t0);
}
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
*/
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 *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;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
/* constants */
const limb_t *T = const_T;
const limb_t *S = const_S;
/* constants */
const limb_t *T = const_T;
const limb_t *S = const_S;
limb_t *Z3 = Q->Z;
/* the curve arith formula */
limb_t *Z3 = Q->Z;
/* the curve arith formula */
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(t0, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_sub(t1, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(T3, S, t0);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(T3, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_sub(t0, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(T3, S, T3);
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Y3, Z1, T3);
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Y3, Z1, T3);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Z3, X3, t1);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(t1, t1, T);
- fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(t0, T3, t1);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(Z3, X1, t0);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(t0, t0, T);
+ fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_add(t0, T3, t0);
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(X3, X1, t0);
}
fiat_id_tc26_gost_3410_2012_256_paramSetA_carry_mul(X3, X1, t0);
}
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
/* constants */
const limb_t *S = const_S;
const limb_t *T = const_T;
/* constants */
const limb_t *S = const_S;
const limb_t *T = const_T;
limb_t *Z3 = Q->Z;
/* the curve arith formula */
limb_t *Z3 = Q->Z;
/* the curve arith formula */
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(t0, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_sub(t1, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(T3, S, t0);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(T3, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_sub(t0, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(T3, S, T3);
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Y3, Z1, T3);
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Y3, Z1, T3);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Z3, X3, t1);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(t1, t1, T);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(t0, T3, t1);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Z3, X1, t0);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(t0, t0, T);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(t0, T3, t0);
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(X3, X1, t0);
}
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(X3, X1, t0);
}
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
*/
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 *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;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
*/
static void point_edwards2legacy(pt_prj_t *Q, const pt_prj_t *P) {
/* temporary variables */
- const limb_t *T = const_T;
const limb_t *S = const_S;
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;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
const limb_t *Z1 = P->Z;
limb_t *Z3 = Q->Z;
/* the curve arith formula */
limb_t *Z3 = Q->Z;
/* the curve arith formula */
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(t0, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_sub(t1, Z1, Y1);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(T3, S, t0);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(T3, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_sub(t0, Z1, Y1);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(T3, S, T3);
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Y3, Z1, T3);
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Y3, Z1, T3);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Z3, X3, t1);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(t1, t1, T);
- fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(t0, T3, t1);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(Z3, X1, t0);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(t0, t0, T);
+ fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_add(t0, T3, t0);
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(X3, X1, t0);
}
fiat_id_tc26_gost_3410_2012_512_paramSetC_carry_mul(X3, X1, t0);
}
*/
static void point_legacy2edwards(pt_prj_t *Q, const pt_aff_t *P) {
/* constants */
*/
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 *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;
const limb_t *X1 = P->X;
const limb_t *Y1 = P->Y;
limb_t *X3 = Q->X;