Browse Source

ED25519_NO_CONTEXT -> DECAF_ED25519_NO_CONTEXT; DECAF_ED25519_NO_CONTEXT -> DECAF_EDDSA_25519_SUPPORTS_CONTEXTLESS_SIGS

master
Michael Hamburg 8 years ago
parent
commit
875d2b2251
10 changed files with 23 additions and 23 deletions
  1. +3
    -3
      src/GENERATED/c/curve25519/eddsa.c
  2. +3
    -3
      src/GENERATED/c/ed448goldilocks/eddsa.c
  3. +2
    -2
      src/GENERATED/include/decaf/ed255.h
  4. +2
    -2
      src/GENERATED/include/decaf/ed255.hxx
  5. +1
    -1
      src/GENERATED/include/decaf/ed448.h
  6. +2
    -2
      src/GENERATED/include/decaf/ed448.hxx
  7. +3
    -3
      src/per_curve/eddsa.tmpl.c
  8. +2
    -2
      src/per_curve/eddsa.tmpl.h
  9. +2
    -2
      src/per_curve/eddsa.tmpl.hxx
  10. +3
    -3
      test/vectors.inc.cxx

+ 3
- 3
src/GENERATED/c/curve25519/eddsa.c View File

@@ -28,13 +28,13 @@
#define hash_destroy decaf_sha512_destroy
#define hash_hash decaf_sha512_hash

#define NO_CONTEXT DECAF_EDDSA_25519_NO_CONTEXT
#define NO_CONTEXT DECAF_EDDSA_25519_SUPPORTS_CONTEXTLESS_SIGS
#define EDDSA_USE_SIGMA_ISOGENY 1
#define COFACTOR 8

#if NO_CONTEXT
const uint8_t NO_CONTEXT_POINTS_HERE = 0;
const uint8_t * const ED25519_NO_CONTEXT = &NO_CONTEXT_POINTS_HERE;
const uint8_t * const DECAF_ED25519_NO_CONTEXT = &NO_CONTEXT_POINTS_HERE;
#endif

/* EDDSA_BASE_POINT_RATIO = 1 or 2
@@ -68,7 +68,7 @@ static void hash_init_with_dom(
hash_init(hash);

#if NO_CONTEXT
if (context_len == 0 && context == ED25519_NO_CONTEXT) {
if (context_len == 0 && context == DECAF_ED25519_NO_CONTEXT) {
(void)prehashed;
(void)for_prehash;
(void)context;


+ 3
- 3
src/GENERATED/c/ed448goldilocks/eddsa.c View File

@@ -28,13 +28,13 @@
#define hash_destroy decaf_shake256_destroy
#define hash_hash decaf_shake256_hash

#define NO_CONTEXT DECAF_EDDSA_448_NO_CONTEXT
#define NO_CONTEXT DECAF_EDDSA_448_SUPPORTS_CONTEXTLESS_SIGS
#define EDDSA_USE_SIGMA_ISOGENY 0
#define COFACTOR 4

#if NO_CONTEXT
const uint8_t NO_CONTEXT_POINTS_HERE = 0;
const uint8_t * const ED448_NO_CONTEXT = &NO_CONTEXT_POINTS_HERE;
const uint8_t * const DECAF_ED448_NO_CONTEXT = &NO_CONTEXT_POINTS_HERE;
#endif

/* EDDSA_BASE_POINT_RATIO = 1 or 2
@@ -68,7 +68,7 @@ static void hash_init_with_dom(
hash_init(hash);

#if NO_CONTEXT
if (context_len == 0 && context == ED448_NO_CONTEXT) {
if (context_len == 0 && context == DECAF_ED448_NO_CONTEXT) {
(void)prehashed;
(void)for_prehash;
(void)context;


+ 2
- 2
src/GENERATED/include/decaf/ed255.h View File

@@ -33,8 +33,8 @@ extern "C" {
#define DECAF_EDDSA_25519_SIGNATURE_BYTES (DECAF_EDDSA_25519_PUBLIC_BYTES + DECAF_EDDSA_25519_PRIVATE_BYTES)

/** Does EdDSA support non-contextual signatures? */
#define DECAF_EDDSA_25519_NO_CONTEXT 1
extern const uint8_t * const ED25519_NO_CONTEXT API_VIS;
#define DECAF_EDDSA_25519_SUPPORTS_CONTEXTLESS_SIGS 1
extern const uint8_t * const DECAF_ED25519_NO_CONTEXT API_VIS;

/** Prehash context renaming macros. */
#define decaf_ed25519_prehash_ctx_s decaf_sha512_ctx_s


+ 2
- 2
src/GENERATED/include/decaf/ed255.hxx View File

@@ -56,8 +56,8 @@ typedef class PublicKeyBase PublicKey, PublicKeyPure, PublicKeyPh;
/** @endcond */


#if DECAF_EDDSA_25519_NO_CONTEXT
static inline const Block NO_CONTEXT() { return Block(ED25519_NO_CONTEXT,0); }
#if DECAF_EDDSA_25519_SUPPORTS_CONTEXTLESS_SIGS
static inline const Block NO_CONTEXT() { return Block(DECAF_ED25519_NO_CONTEXT,0); }
#else
static inline const Block NO_CONTEXT() { return Block(NULL,0); }
#endif


+ 1
- 1
src/GENERATED/include/decaf/ed448.h View File

@@ -33,7 +33,7 @@ extern "C" {
#define DECAF_EDDSA_448_SIGNATURE_BYTES (DECAF_EDDSA_448_PUBLIC_BYTES + DECAF_EDDSA_448_PRIVATE_BYTES)

/** Does EdDSA support non-contextual signatures? */
#define DECAF_EDDSA_448_NO_CONTEXT 0
#define DECAF_EDDSA_448_SUPPORTS_CONTEXTLESS_SIGS 0

/** Prehash context renaming macros. */
#define decaf_ed448_prehash_ctx_s decaf_shake256_ctx_s


+ 2
- 2
src/GENERATED/include/decaf/ed448.hxx View File

@@ -56,8 +56,8 @@ typedef class PublicKeyBase PublicKey, PublicKeyPure, PublicKeyPh;
/** @endcond */


#if DECAF_EDDSA_448_NO_CONTEXT
static inline const Block NO_CONTEXT() { return Block(ED448_NO_CONTEXT,0); }
#if DECAF_EDDSA_448_SUPPORTS_CONTEXTLESS_SIGS
static inline const Block NO_CONTEXT() { return Block(DECAF_ED448_NO_CONTEXT,0); }
#else
static inline const Block NO_CONTEXT() { return Block(NULL,0); }
#endif


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

@@ -19,13 +19,13 @@
#define hash_destroy decaf_$(eddsa_hash)_destroy
#define hash_hash decaf_$(eddsa_hash)_hash

#define NO_CONTEXT DECAF_EDDSA_$(gf_shortname)_NO_CONTEXT
#define NO_CONTEXT DECAF_EDDSA_$(gf_shortname)_SUPPORTS_CONTEXTLESS_SIGS
#define EDDSA_USE_SIGMA_ISOGENY $(eddsa_sigma_iso)
#define COFACTOR $(cofactor)

#if NO_CONTEXT
const uint8_t NO_CONTEXT_POINTS_HERE = 0;
$("const uint8_t * const ED" + gf_shortname + "_NO_CONTEXT") = &NO_CONTEXT_POINTS_HERE;
const uint8_t * const DECAF_ED$(gf_shortname)_NO_CONTEXT = &NO_CONTEXT_POINTS_HERE;
#endif

/* EDDSA_BASE_POINT_RATIO = 1 or 2
@@ -59,7 +59,7 @@ static void hash_init_with_dom(
hash_init(hash);

#if NO_CONTEXT
if (context_len == 0 && context == ED$(gf_shortname)_NO_CONTEXT) {
if (context_len == 0 && context == DECAF_ED$(gf_shortname)_NO_CONTEXT) {
(void)prehashed;
(void)for_prehash;
(void)context;


+ 2
- 2
src/per_curve/eddsa.tmpl.h View File

@@ -18,8 +18,8 @@ extern "C" {
#define DECAF_EDDSA_$(gf_shortname)_SIGNATURE_BYTES (DECAF_EDDSA_$(gf_shortname)_PUBLIC_BYTES + DECAF_EDDSA_$(gf_shortname)_PRIVATE_BYTES)

/** Does EdDSA support non-contextual signatures? */
#define DECAF_EDDSA_$(gf_shortname)_NO_CONTEXT $(eddsa_no_context)
$("extern const uint8_t * const ED" + gf_shortname + "_NO_CONTEXT API_VIS;\n" if eddsa_no_context else "")
#define DECAF_EDDSA_$(gf_shortname)_SUPPORTS_CONTEXTLESS_SIGS $(eddsa_no_context)
$("extern const uint8_t * const DECAF_ED" + gf_shortname + "_NO_CONTEXT API_VIS;\n" if eddsa_no_context else "")
/** Prehash context renaming macros. */
#define decaf_ed$(gf_shortname)_prehash_ctx_s decaf_$(eddsa_hash)_ctx_s
#define decaf_ed$(gf_shortname)_prehash_ctx_t decaf_$(eddsa_hash)_ctx_t


+ 2
- 2
src/per_curve/eddsa.tmpl.hxx View File

@@ -40,8 +40,8 @@ typedef class PublicKeyBase PublicKey, PublicKeyPure, PublicKeyPh;
/** @endcond */


#if DECAF_EDDSA_$(gf_shortname)_NO_CONTEXT
static inline const Block NO_CONTEXT() { return Block(ED$(gf_shortname)_NO_CONTEXT,0); }
#if DECAF_EDDSA_$(gf_shortname)_SUPPORTS_CONTEXTLESS_SIGS
static inline const Block NO_CONTEXT() { return Block(DECAF_ED$(gf_shortname)_NO_CONTEXT,0); }
#else
static inline const Block NO_CONTEXT() { return Block(NULL,0); }
#endif


+ 3
- 3
test/vectors.inc.cxx View File

@@ -507,9 +507,9 @@ template<> const Block Tests<IsoEd25519>::eddsa_pk[] = {
Block(ed25519_eddsa_pk[4],32)
};
template<> const Block Tests<IsoEd25519>::eddsa_context[] = {
Block(ED25519_NO_CONTEXT,0),
Block(ED25519_NO_CONTEXT,0),
Block(ED25519_NO_CONTEXT,0),
EdDSA<IsoEd25519>::NO_CONTEXT(),
EdDSA<IsoEd25519>::NO_CONTEXT(),
EdDSA<IsoEd25519>::NO_CONTEXT(),
Block(NULL,0),
Block(ed25519_eddsa_context[0],3),
Block(ed25519_eddsa_context[1],3)


Loading…
Cancel
Save