2013-05-09 15:24:32 +02:00
|
|
|
// Copyright (c) 2013 Pieter Wuille
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2013-03-10 05:34:04 +01:00
|
|
|
#ifndef _SECP256K1_ECDSA_
|
|
|
|
#define _SECP256K1_ECDSA_
|
|
|
|
|
2013-04-01 07:21:05 +02:00
|
|
|
#include "num.h"
|
2013-03-10 05:34:04 +01:00
|
|
|
|
2013-04-01 07:21:05 +02:00
|
|
|
typedef struct {
|
|
|
|
secp256k1_num_t r, s;
|
|
|
|
} secp256k1_ecdsa_sig_t;
|
2013-03-24 10:38:35 +01:00
|
|
|
|
2013-04-01 07:21:05 +02:00
|
|
|
void static secp256k1_ecdsa_sig_init(secp256k1_ecdsa_sig_t *r);
|
|
|
|
void static secp256k1_ecdsa_sig_free(secp256k1_ecdsa_sig_t *r);
|
|
|
|
|
|
|
|
int static secp256k1_ecdsa_sig_parse(secp256k1_ecdsa_sig_t *r, const unsigned char *sig, int size);
|
|
|
|
int static secp256k1_ecdsa_sig_serialize(unsigned char *sig, int *size, const secp256k1_ecdsa_sig_t *a);
|
2013-05-05 01:18:23 +02:00
|
|
|
int static secp256k1_ecdsa_sig_verify(const secp256k1_ecdsa_sig_t *sig, const secp256k1_ge_t *pubkey, const secp256k1_num_t *message);
|
2014-10-28 04:08:15 -07:00
|
|
|
int static secp256k1_ecdsa_sig_sign(secp256k1_ecdsa_sig_t *sig, const secp256k1_scalar_t *seckey, const secp256k1_scalar_t *message, const secp256k1_scalar_t *nonce, int *recid);
|
2013-05-05 02:46:07 +02:00
|
|
|
int static secp256k1_ecdsa_sig_recover(const secp256k1_ecdsa_sig_t *sig, secp256k1_ge_t *pubkey, const secp256k1_num_t *message, int recid);
|
2013-04-01 07:21:05 +02:00
|
|
|
void static secp256k1_ecdsa_sig_set_rs(secp256k1_ecdsa_sig_t *sig, const secp256k1_num_t *r, const secp256k1_num_t *s);
|
2013-03-10 05:34:04 +01:00
|
|
|
|
|
|
|
#endif
|