MPHELL
5.0.0
|
Tutorial for ecdsa signature and verification using mphell. More...
#include <stdio.h>
#include "mphell/mphell.h"
Go to the source code of this file.
Data Structures | |
struct | ecdsa_sig |
Define an ECDSA signature. More... | |
Typedefs | |
typedef struct ecdsa_sig | ecdsa_sig_t |
typedef ecdsa_sig_t | ecdsa_sig[1] |
Functions | |
void | ecdsa_sign_alloc (ecdsa_sig *sig, uint8_t size) |
void | ecdsa_sign_free (ecdsa_sig *sig) |
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) |
Compute u1 * G + u2 * key. More... | |
void | ecdsa_sign (unsigned char *hash, ecdsa_sig *sig, number_ptr priv_key, ec_curve *curve) |
int8_t | ecdsa_verify (unsigned char *hash, ecdsa_sig *sig, ec_point *pub_key, ec_curve *curve) |
Verify the signature "sig" of hash "hash" using public key "pub_key" and the EC "curve". More... | |
int8_t | ecdsa_pub_key_validation (ec_point *pub_key, ec_curve *curve) |
int | main () |
Tutorial for ecdsa signature and verification using mphell.
Definition in file mphell_tuto_ecdsa_fips.c.
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 | ||
) |
Compute u1 * G + u2 * key.
dst | Destination point |
u1 | Number |
G | Base point |
u2 | Number |
key | Public key |
E | Elliptic curve |
Definition at line 118 of file mphell_tuto_ecdsa_fips.c.
Verify the signature "sig" of hash "hash" using public key "pub_key" and the EC "curve".
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. |
sig | Signature of hash |
pub_key | Public key |
curve | Elliptic curve |
Definition at line 242 of file mphell_tuto_ecdsa_fips.c.