MPHELL
5.0.0
|
Tutorial for eddsa signature and verification using mphell. More...
#include <stdio.h>
#include <time.h>
#include "mphell/mphell.h"
Go to the source code of this file.
Data Structures | |
struct | eddsa_sig |
Define an EdDSA signature. More... | |
struct | ecdsa_precomp |
Precomputation structure. More... | |
Macros | |
#define | PRECOMP_WIN_SIZE 9 |
#define | PRECOMP_SIZE 256 |
#define | HASH_SIZE 64 |
Typedefs | |
typedef struct eddsa_sig | eddsa_sig_t |
Define the EdDSA signature type. | |
typedef eddsa_sig_t | eddsa_sig[1] |
Pointer on an allocated eddsa_sig_t structure. | |
typedef struct ecdsa_precomp | ecdsa_precomp_t |
typedef ecdsa_precomp_t | ecdsa_precomp[1] |
Functions | |
void | eddsa_sign_alloc (eddsa_sig *sig, ec_curve_srcptr E, uint8_t size) |
void | eddsa_sign_free (eddsa_sig *sig, ec_curve_srcptr E) |
Free a used signature structure. More... | |
void | ecdsa_precal (ecdsa_precomp *precomp, ec_point *key, ec_curve_ptr E) |
void | ecdsa_precal_free (ecdsa_precomp *precomp, ec_curve_ptr E) |
void | ec_point_mul_ecdsa (ec_point dst, number_srcptr u1, ec_point_srcptr G, number_srcptr u2, ec_point_srcptr key, ec_curve_srcptr E) |
void | eddsa_sign (unsigned char *hash, eddsa_sig *sig, number priv_key, ec_point *pub_key, ec_curve *curve) |
int8_t | eddsa_verify (unsigned char *hash, eddsa_sig *sig, ec_point *pub_key, ec_curve *curve, ecdsa_precomp precomp) |
int8_t | eddsa_pub_key_validation (ec_point *pub_key, ec_curve *curve) |
Verify that the public key is valid (id est check taht pub_key belongs to the curve, that pub_key is not the neutral element and that pub_key is of ordre n) More... | |
int | main (int argc, char **argv) |
Tutorial for eddsa signature and verification using mphell.
Definition in file mphell_tuto_eddsa-448+25519.c.
Verify that the public key is valid (id est check taht pub_key belongs to the curve, that pub_key is not the neutral element and that pub_key is of ordre n)
hash | H(m) where H is a cryptographic hash function and m the message to sign. Must be written under hexadecimal form. ex: 64 hexadecimal characters for sha256. |
pub_key | Public key |
curve | Elliptic curve |
Definition at line 633 of file mphell_tuto_eddsa-448+25519.c.
void eddsa_sign_free | ( | eddsa_sig * | sig, |
ec_curve_srcptr | E | ||
) |
Free a used signature structure.
sig | Signature |
Definition at line 125 of file mphell_tuto_eddsa-448+25519.c.