libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
ecdsa_ctx.h File Reference

ECDSA-CTX API. More...

Go to the source code of this file.

Functions

int zpc_ecdsa_ctx_alloc (struct zpc_ecdsa_ctx **ctx)
int zpc_ecdsa_ctx_set_key (struct zpc_ecdsa_ctx *ctx, struct zpc_ec_key *key)
int zpc_ecdsa_sign (struct zpc_ecdsa_ctx *ctx, const unsigned char *hash, unsigned int hash_len, unsigned char *signature, unsigned int *sig_len)
int zpc_ecdsa_verify (struct zpc_ecdsa_ctx *ctx, const unsigned char *hash, unsigned int hash_len, const unsigned char *signature, unsigned int sig_len)
void zpc_ecdsa_ctx_free (struct zpc_ecdsa_ctx **ctx)

Detailed Description

ECDSA-CTX API.

Sign/verify API for elliptic curve cryptography (ECDSA) algorithms. [5] sign/verify

Definition in file ecdsa_ctx.h.

Function Documentation

◆ zpc_ecdsa_ctx_alloc()

int zpc_ecdsa_ctx_alloc ( struct zpc_ecdsa_ctx ** ctx)

Allocate a new context for an ECDSA sign/verify operation.

Parameters
[in,out]ctxECDSA context
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_ecdsa_ctx_set_key()

int zpc_ecdsa_ctx_set_key ( struct zpc_ecdsa_ctx * ctx,
struct zpc_ec_key * key )

Set the key to be used in the context of an ECDSA sign/verify operation.

Parameters
[in,out]ctxECDSA context
[in]keyEC key
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_ecdsa_sign()

int zpc_ecdsa_sign ( struct zpc_ecdsa_ctx * ctx,
const unsigned char * hash,
unsigned int hash_len,
unsigned char * signature,
unsigned int * sig_len )

Do an ECDSA sign operation.

Parameters
[in,out]ctxECDSA context
[in]hashinput message to sign
[in]hash_leninput message length [bytes]
[out]signaturesignature
[in,out]*sig_lenaddress of signature length field [bytes] On input, the application must specify the buffer length to receive the signature [bytes]. If signature is NULL, only the length of the signature is returned.
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_ecdsa_verify()

int zpc_ecdsa_verify ( struct zpc_ecdsa_ctx * ctx,
const unsigned char * hash,
unsigned int hash_len,
const unsigned char * signature,
unsigned int sig_len )

Do an ECDSA verify operation.

Parameters
[in,out]ctxECDSA context
[in]hashinput message to verify
[in]hash_leninput message length [bytes]
[in]signaturesignature to verify
[in]sig_lensignature length
Returns
0 on success. Otherwise, a non-zero error code is returned.

◆ zpc_ecdsa_ctx_free()

void zpc_ecdsa_ctx_free ( struct zpc_ecdsa_ctx ** ctx)

Free an ECDSA context.

Parameters
[in,out]ctxECDSA context