Browse Source

decaf no longer needs sqrt(-d) etc; may simplify port to other curves

master
Mike Hamburg 10 years ago
parent
commit
34a2931789
2 changed files with 19 additions and 19 deletions
  1. +1
    -1
      Makefile
  2. +18
    -18
      src/ec_point.c

+ 1
- 1
Makefile View File

@@ -99,7 +99,7 @@ ifeq ($(UNAME),Darwin)
else
$(LD) -shared -Wl,-soname,goldilocks.so.1 -Wl,--gc-sections -o $@ $(LIBCOMPONENTS)
strip --discard-all $@
ln -sf $@ build/goldilocks.so.1
ln -sf `basename $@` build/goldilocks.so.1
endif

build/timestamp:


+ 18
- 18
src/ec_point.c View File

@@ -479,18 +479,18 @@ decaf_serialize_extensible (
field_mul ( L3, L2, a->t );
field_mul ( L2, L3, a->u );
field_mul ( L0, a->x, a->z );
field_sub ( L3, L2, L0 );
field_sub ( L3, L0, L2 );
field_add ( L0, a->y, a->z );
field_sub ( L1, a->y, a->z );
field_mul ( L2, L1, L0 );
field_isr ( L2, L2 );
field_sqr ( L1, L2 );
field_mul ( L0, L1, L3 );
field_mul ( L1, L2, sqrt_d_minus_1 );
field_add ( L3, L1, L1 );
field_neg ( L3, L3 );
field_sub ( L1, a->z, a->y );
field_mul ( L2, L1, L0 );
field_mulw_scc ( L1, L2, 1-EDWARDS_D );
field_isr ( L0, L1 );
field_mulw_scc ( L1, L0, 1-EDWARDS_D );
field_mul ( L2, L1, L0 );
field_mul ( L0, L2, L3 );
field_add ( L3, L1, L1 );
field_mul ( L2, L3, a->z );
field_cond_neg ( L1, field_low_bit(L2) );
field_cond_neg ( L1, ~field_low_bit(L2) );
field_mul ( L2, L1, a->y );
field_add ( b, L0, L2 );
decaf_make_even ( b );
@@ -509,15 +509,15 @@ decaf_serialize_tw_extensible (
field_sub ( L3, L2, L0 );
field_add ( L0, a->z, a->y );
field_sub ( L1, a->z, a->y );
field_mul ( L2, L1, L0 );
field_isr ( L2, L2 );
field_sqr ( L1, L2 );
field_mul ( L0, L1, L3 );
field_mul ( L1, L2, sqrt_minus_d );
field_add ( L3, L1, L1 );
field_neg ( L3, L3 );
field_mul ( L2, L1, L0 );
field_mulw_scc ( L1, L2, -EDWARDS_D );
field_isr ( L0, L1 );
field_mulw_scc ( L1, L0, -EDWARDS_D );
field_mul ( L2, L1, L0 );
field_mul ( L0, L2, L3 );
field_add ( L3, L1, L1 );
field_mul ( L2, L3, a->z );
field_cond_neg ( L1, field_low_bit(L2) );
field_cond_neg ( L1, ~field_low_bit(L2) );
field_mul ( L2, L1, a->y );
field_add ( b, L0, L2 );
decaf_make_even ( b );


Loading…
Cancel
Save