Browse Source

fix warning due to MACRO?4:3 in elligator.c

master
Michael Hamburg 7 years ago
parent
commit
1c8b8cb77d
3 changed files with 15 additions and 3 deletions
  1. +5
    -1
      src/GENERATED/c/curve25519/elligator.c
  2. +5
    -1
      src/GENERATED/c/ed448goldilocks/elligator.c
  3. +5
    -1
      src/per_curve/elligator.tmpl.c

+ 5
- 1
src/GENERATED/c/curve25519/elligator.c View File

@@ -180,7 +180,11 @@ API_NS(invert_elligator_nonuniform) (
gf_serialize(recovered_hash,b,1);
#if PKP_MASK != 0
/* Add a multiple of p to make the result either almost-onto or completely onto. */
succ &= plus_k_p(recovered_hash, (hint >> ((COFACTOR==8)?4:3)) & PKP_MASK);
#if COFACTOR == 8
succ &= plus_k_p(recovered_hash, (hint >> 4) & PKP_MASK);
#else
succ &= plus_k_p(recovered_hash, (hint >> 3) & PKP_MASK);
#endif
#endif
#endif
return decaf_succeed_if(mask_to_bool(succ));


+ 5
- 1
src/GENERATED/c/ed448goldilocks/elligator.c View File

@@ -180,7 +180,11 @@ API_NS(invert_elligator_nonuniform) (
gf_serialize(recovered_hash,b,1);
#if PKP_MASK != 0
/* Add a multiple of p to make the result either almost-onto or completely onto. */
succ &= plus_k_p(recovered_hash, (hint >> ((COFACTOR==8)?4:3)) & PKP_MASK);
#if COFACTOR == 8
succ &= plus_k_p(recovered_hash, (hint >> 4) & PKP_MASK);
#else
succ &= plus_k_p(recovered_hash, (hint >> 3) & PKP_MASK);
#endif
#endif
#endif
return decaf_succeed_if(mask_to_bool(succ));


+ 5
- 1
src/per_curve/elligator.tmpl.c View File

@@ -169,7 +169,11 @@ API_NS(invert_elligator_nonuniform) (
gf_serialize(recovered_hash,b,1);
#if PKP_MASK != 0
/* Add a multiple of p to make the result either almost-onto or completely onto. */
succ &= plus_k_p(recovered_hash, (hint >> ((COFACTOR==8)?4:3)) & PKP_MASK);
#if COFACTOR == 8
succ &= plus_k_p(recovered_hash, (hint >> 4) & PKP_MASK);
#else
succ &= plus_k_p(recovered_hash, (hint >> 3) & PKP_MASK);
#endif
#endif
#endif
return decaf_succeed_if(mask_to_bool(succ));


||||||
x
 
000:0
Loading…
Cancel
Save