Browse Source

condswap is the main remaining bottleneck on monty ladder. comment in a pragma but dont actually use it yet...

master
Mike Hamburg 9 years ago
parent
commit
edd2883e59
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      src/decaf_fast.c

+ 6
- 3
src/decaf_fast.c View File

@@ -181,12 +181,15 @@ sv cond_neg(gf x, decaf_bool_t neg) {
}

/** Constant time, if (swap) (x,y) = (y,x); */
sv cond_swap(gf x, gf y, decaf_bool_t swap) {
FOR_LIMB(i, {
static inline void cond_swap(gf x, gf y, decaf_bool_t swap) {
int i;
/* PERF */
//_Pragma("clang loop unroll(disable) vectorize(enable) vectorize_width(4) interleave_count(2)")
for (i=0; i<DECAF_448_LIMBS; i++) {
decaf_word_t s = (x[i] ^ y[i]) & swap;
x[i] ^= s;
y[i] ^= s;
});
}
}

/**


Loading…
Cancel
Save