Commit 34a29317 authored by Mike Hamburg's avatar Mike Hamburg

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

parent 4333b7c1
......@@ -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:
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment