Browse Source

fix(?) perf regression in monty_aux_step

master
Mike Hamburg 10 years ago
parent
commit
1b4072de53
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      src/ec_point.c

+ 10
- 8
src/ec_point.c View File

@@ -258,21 +258,23 @@ void
montgomery_aux_step (
struct montgomery_aux_t* a
) {
field_add ( a->xs, a->xa, a->za );
field_sub ( a->zs, a->xa, a->za );
field_add ( a->xa, a->xd, a->zd );
field_sub ( a->za, a->xd, a->zd );
ANALYZE_THIS_ROUTINE_CAREFULLY;
field_add_nr ( a->xs, a->xa, a->za );
field_subx_nr ( a->zs, a->xa, a->za );
field_add_nr ( a->xa, a->xd, a->zd );
field_subx_nr ( a->za, a->xd, a->zd );
field_mul ( a->xd, a->xa, a->zs );
field_mul ( a->zd, a->xs, a->za );
field_add ( a->xs, a->xd, a->zd );
field_sub ( a->zd, a->xd, a->zd );
field_add_nr ( a->xs, a->xd, a->zd );
field_subx_nr ( a->zd, a->xd, a->zd );
field_mul ( a->zs, a->zd, a->s0 );
field_sqr ( a->zd, a->xa );
field_sqr ( a->xa, a->za );
field_sub ( a->za, a->zd, a->xa );
field_subx_nr ( a->za, a->zd, a->xa );
IF32( field_weak_reduce( a->za ) );
field_mul ( a->xd, a->xa, a->zd );
field_mulw_scc_wr ( a->zd, a->xa, 1-EDWARDS_D );
field_add ( a->xa, a->za, a->zd );
field_add_nr ( a->xa, a->za, a->zd );
field_mul ( a->zd, a->xa, a->za );
field_sqr ( a->xa, a->xs );
field_sqr ( a->za, a->zs );


Loading…
Cancel
Save