OpenSSL  1.0.1c
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
ecs_sign.c File Reference
#include "ecs_locl.h"
#include <openssl/engine.h>
#include <openssl/rand.h>

Go to the source code of this file.

Functions

ECDSA_SIGECDSA_do_sign (const unsigned char *dgst, int dlen, EC_KEY *eckey)
 
ECDSA_SIGECDSA_do_sign_ex (const unsigned char *dgst, int dlen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey)
 
int ECDSA_sign (int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, EC_KEY *eckey)
 
int ECDSA_sign_ex (int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey)
 
int ECDSA_sign_setup (EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
 

Function Documentation

ECDSA_SIG* ECDSA_do_sign ( const unsigned char *  dgst,
int  dgst_len,
EC_KEY eckey 
)

Computes the ECDSA signature of the given hash value using the supplied private key and returns the created signature.

Parameters
dgstpointer to the hash value
dgst_lenlength of the hash value
eckeyEC_KEY object containing a private EC key
Returns
pointer to a ECDSA_SIG structure or NULL if an error occurred

Definition at line 62 of file ecs_sign.c.

ECDSA_SIG* ECDSA_do_sign_ex ( const unsigned char *  dgst,
int  dgstlen,
const BIGNUM kinv,
const BIGNUM rp,
EC_KEY eckey 
)

Computes ECDSA signature of a given hash value using the supplied private key (note: sig must point to ECDSA_size(eckey) bytes of memory).

Parameters
dgstpointer to the hash value to sign
dgstlenlength of the hash value
kinvBIGNUM with a pre-computed inverse k (optional)
rpBIGNUM with a pre-computed rp value (optioanl), see ECDSA_sign_setup
eckeyEC_KEY object containing a private EC key
Returns
pointer to a ECDSA_SIG structure or NULL if an error occurred

Definition at line 67 of file ecs_sign.c.

int ECDSA_sign ( int  type,
const unsigned char *  dgst,
int  dgstlen,
unsigned char *  sig,
unsigned int *  siglen,
EC_KEY eckey 
)

Computes ECDSA signature of a given hash value using the supplied private key (note: sig must point to ECDSA_size(eckey) bytes of memory).

Parameters
typethis parameter is ignored
dgstpointer to the hash value to sign
dgstlenlength of the hash value
sigmemory for the DER encoded created signature
siglenpointer to the length of the returned signature
eckeyEC_KEY object containing a private EC key
Returns
1 on success and 0 otherwise

Definition at line 76 of file ecs_sign.c.

int ECDSA_sign_ex ( int  type,
const unsigned char *  dgst,
int  dgstlen,
unsigned char *  sig,
unsigned int *  siglen,
const BIGNUM kinv,
const BIGNUM rp,
EC_KEY eckey 
)

Computes ECDSA signature of a given hash value using the supplied private key (note: sig must point to ECDSA_size(eckey) bytes of memory).

Parameters
typethis parameter is ignored
dgstpointer to the hash value to sign
dgstlenlength of the hash value
sigbuffer to hold the DER encoded signature
siglenpointer to the length of the returned signature
kinvBIGNUM with a pre-computed inverse k (optional)
rpBIGNUM with a pre-computed rp value (optioanl), see ECDSA_sign_setup
eckeyEC_KEY object containing a private EC key
Returns
1 on success and 0 otherwise

Definition at line 82 of file ecs_sign.c.

int ECDSA_sign_setup ( EC_KEY eckey,
BN_CTX ctx,
BIGNUM **  kinv,
BIGNUM **  rp 
)

Precompute parts of the signing operation

Parameters
eckeyEC_KEY object containing a private EC key
ctxBN_CTX object (optional)
kinvBIGNUM pointer for the inverse of k
rpBIGNUM pointer for x coordinate of k * generator
Returns
1 on success and 0 otherwise

Definition at line 99 of file ecs_sign.c.