libzpc 1.5
IBM Z Protected-key Crypto library
Loading...
Searching...
No Matches
ecdsa_ctx.h
Go to the documentation of this file.
1/*
2 * Copyright IBM Corp. 2022
3 *
4 * libzpc is free software; you can redistribute it and/or modify
5 * it under the terms of the MIT license. See LICENSE for details.
6 */
7
8#ifndef ZPC_ECDSA_CTX_H
9# define ZPC_ECDSA_CTX_H
10# ifdef __cplusplus
11/* *INDENT-OFF* */
12extern "C" {
13/* *INDENT-ON* */
14# endif
15
24
25# include <zpc/ecc_key.h>
26# include <stddef.h>
27
28struct zpc_ecdsa_ctx;
29
35__attribute__((visibility("default")))
36int zpc_ecdsa_ctx_alloc(struct zpc_ecdsa_ctx **ctx);
37
44__attribute__((visibility("default")))
45int zpc_ecdsa_ctx_set_key(struct zpc_ecdsa_ctx *ctx, struct zpc_ec_key *key);
46
59__attribute__((visibility("default")))
60int zpc_ecdsa_sign(struct zpc_ecdsa_ctx *ctx,
61 const unsigned char *hash, unsigned int hash_len,
62 unsigned char *signature, unsigned int *sig_len);
63
73__attribute__((visibility("default")))
74int zpc_ecdsa_verify(struct zpc_ecdsa_ctx *ctx,
75 const unsigned char *hash, unsigned int hash_len,
76 const unsigned char *signature, unsigned int sig_len);
77
82__attribute__((visibility("default")))
83void zpc_ecdsa_ctx_free(struct zpc_ecdsa_ctx **ctx);
84
85# ifdef __cplusplus
86/* *INDENT-OFF* */
87}
88/* *INDENT-ON* */
89# endif
90#endif
ECC key API.
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)
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_ctx_alloc(struct zpc_ecdsa_ctx **ctx)
void zpc_ecdsa_ctx_free(struct zpc_ecdsa_ctx **ctx)
int zpc_ecdsa_ctx_set_key(struct zpc_ecdsa_ctx *ctx, struct zpc_ec_key *key)