Browse Source

clear a couple todos. still have to rename the clear cofactor fns

master
Michael Hamburg 7 years ago
parent
commit
0c60af55fe
2 changed files with 5 additions and 4 deletions
  1. +2
    -2
      src/generator/curve_data.py
  2. +3
    -2
      src/per_curve/eddsa.tmpl.c

+ 2
- 2
src/generator/curve_data.py View File

@@ -137,8 +137,8 @@ for curve,data in curve_data.items():
# This is a HACK. The real problem is that iso-Ed25519
# has points at infinity unless you IMAGINE_TWIST.
#
# Also there are lots of bugs when cofactor=8 && !IMAGINE_TWIST.
# (FIXME, eventually)
# Also there are lots of bugs when cofactor=8 != IMAGINE_TWIST.
# (FUTURE: fix all this to support other curves, eventually)
if data["modulus"]%4 == 3: data["imagine_twist"] = 0
else: data["imagine_twist"] = 1
# data["imagine_twist"] = 0


+ 3
- 2
src/per_curve/eddsa.tmpl.c View File

@@ -22,6 +22,7 @@
#define NO_CONTEXT DECAF_EDDSA_$(gf_shortname)_SUPPORTS_CONTEXTLESS_SIGS
#define EDDSA_USE_SIGMA_ISOGENY $(eddsa_sigma_iso)
#define COFACTOR $(cofactor)
#define EDDSA_PREHASH_BYTES 64

#if NO_CONTEXT
const uint8_t NO_CONTEXT_POINTS_HERE = 0;
@@ -228,7 +229,7 @@ void decaf_ed$(gf_shortname)_sign_prehash (
const uint8_t *context,
uint8_t context_len
) {
uint8_t hash_output[64]; /* MAGIC but true for all existing schemes */
uint8_t hash_output[EDDSA_PREHASH_BYTES];
{
decaf_ed$(gf_shortname)_prehash_ctx_t hash_too;
memcpy(hash_too,hash,sizeof(hash_too));
@@ -303,7 +304,7 @@ decaf_error_t decaf_ed$(gf_shortname)_verify_prehash (
) {
decaf_error_t ret;
uint8_t hash_output[64]; /* MAGIC but true for all existing schemes */
uint8_t hash_output[EDDSA_PREHASH_BYTES];
{
decaf_ed$(gf_shortname)_prehash_ctx_t hash_too;
memcpy(hash_too,hash,sizeof(hash_too));


Loading…
Cancel
Save