MPHELL  5.0.0
Data Structures | Typedefs | Functions
mphell_tuto_eckcdsa.c File Reference

Tutorial for EC Korean Certificate DSA signature and verification using mphell. More...

#include <stdio.h>
#include "mphell/mphell.h"
Include dependency graph for mphell_tuto_eckcdsa.c:

Go to the source code of this file.

Data Structures

struct  eckcdsa_sig
 Define an ECKCDSA signature. More...
 

Typedefs

typedef struct eckcdsa_sig eckcdsa_sig_t
 Define the ECKCDSA signature type.
 
typedef eckcdsa_sig_t eckcdsa_sig[1]
 Pointer on an allocated eckcdsa_sig_t structure.
 

Functions

void eckcdsa_sign_alloc (eckcdsa_sig *sig, uint8_t size)
 Allocate a signature structure. More...
 
void eckcdsa_sign_free (eckcdsa_sig *sig)
 Free a used signature structure. More...
 
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 eckcdsa_sign (unsigned char *hash, unsigned char *cert, eckcdsa_sig *sig, number priv_key, ec_curve *curve)
 
int8_t eckcdsa_verify (unsigned char *hash, unsigned char *cert, eckcdsa_sig *sig, ec_point *pub_key, ec_curve *curve)
 
int8_t eckcdsa_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 ()
 

Detailed Description

Tutorial for EC Korean Certificate DSA signature and verification using mphell.

Definition in file mphell_tuto_eckcdsa.c.

Function Documentation

◆ eckcdsa_pub_key_validation()

int8_t eckcdsa_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)

Parameters
hashH(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_keyPublic key
curveElliptic curve
Returns
1 on success, 0 on failure

Definition at line 414 of file mphell_tuto_eckcdsa.c.

◆ eckcdsa_sign_alloc()

void eckcdsa_sign_alloc ( eckcdsa_sig sig,
uint8_t  size 
)

Allocate a signature structure.

Parameters
sigSignature
sizeSize (in block) of the signature

Definition at line 78 of file mphell_tuto_eckcdsa.c.

◆ eckcdsa_sign_free()

void eckcdsa_sign_free ( eckcdsa_sig sig)

Free a used signature structure.

Parameters
sigSignature

Definition at line 98 of file mphell_tuto_eckcdsa.c.