PolarSSL v1.3.1
ecdsa.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_ECDSA_H
28 #define POLARSSL_ECDSA_H
29 
30 #include "ecp.h"
31 
37 typedef struct
38 {
40  mpi d;
42  mpi r;
43  mpi s;
44 }
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
66 int ecdsa_sign( ecp_group *grp, mpi *r, mpi *s,
67  const mpi *d, const unsigned char *buf, size_t blen,
68  int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
69 
84 int ecdsa_verify( ecp_group *grp,
85  const unsigned char *buf, size_t blen,
86  const ecp_point *Q, const mpi *r, const mpi *s);
87 
110  const unsigned char *hash, size_t hlen,
111  unsigned char *sig, size_t *slen,
112  int (*f_rng)(void *, unsigned char *, size_t),
113  void *p_rng );
114 
129  const unsigned char *hash, size_t hlen,
130  const unsigned char *sig, size_t slen );
131 
144  int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
145 
154 int ecdsa_from_keypair( ecdsa_context *ctx, const ecp_keypair *key );
155 
161 void ecdsa_init( ecdsa_context *ctx );
162 
168 void ecdsa_free( ecdsa_context *ctx );
169 
175 int ecdsa_self_test( int verbose );
176 
177 #ifdef __cplusplus
178 }
179 #endif
180 
181 #endif