2014-11-15 15:28:10 +00:00
|
|
|
/**********************************************************************
|
|
|
|
* Copyright (c) 2013, 2014 Pieter Wuille *
|
|
|
|
* Distributed under the MIT software license, see the accompanying *
|
|
|
|
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
|
|
|
|
**********************************************************************/
|
2014-10-27 02:57:27 -07:00
|
|
|
|
|
|
|
#ifndef _SECP256K1_ECKEY_
|
|
|
|
#define _SECP256K1_ECKEY_
|
|
|
|
|
|
|
|
#include "group.h"
|
2014-10-28 04:08:15 -07:00
|
|
|
#include "scalar.h"
|
2015-02-03 17:27:00 -08:00
|
|
|
#include "ecmult.h"
|
|
|
|
#include "ecmult_gen.h"
|
2014-10-27 02:57:27 -07:00
|
|
|
|
2014-11-12 12:57:35 -08:00
|
|
|
static int secp256k1_eckey_pubkey_parse(secp256k1_ge_t *elem, const unsigned char *pub, int size);
|
2014-11-18 12:32:53 +01:00
|
|
|
static int secp256k1_eckey_pubkey_serialize(secp256k1_ge_t *elem, unsigned char *pub, int *size, int compressed);
|
2014-10-27 03:27:55 -07:00
|
|
|
|
2014-11-12 12:57:35 -08:00
|
|
|
static int secp256k1_eckey_privkey_parse(secp256k1_scalar_t *key, const unsigned char *privkey, int privkeylen);
|
2015-02-03 17:27:00 -08:00
|
|
|
static int secp256k1_eckey_privkey_serialize(const secp256k1_ecmult_gen_context_t *ctx, unsigned char *privkey, int *privkeylen, const secp256k1_scalar_t *key, int compressed);
|
2014-10-27 02:57:27 -07:00
|
|
|
|
2014-11-12 12:57:35 -08:00
|
|
|
static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar_t *key, const secp256k1_scalar_t *tweak);
|
2015-02-03 17:27:00 -08:00
|
|
|
static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context_t *ctx, secp256k1_ge_t *key, const secp256k1_scalar_t *tweak);
|
2014-11-12 12:57:35 -08:00
|
|
|
static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar_t *key, const secp256k1_scalar_t *tweak);
|
2015-02-03 17:27:00 -08:00
|
|
|
static int secp256k1_eckey_pubkey_tweak_mul(const secp256k1_ecmult_context_t *ctx, secp256k1_ge_t *key, const secp256k1_scalar_t *tweak);
|
2014-10-27 03:27:55 -07:00
|
|
|
|
2014-10-27 02:57:27 -07:00
|
|
|
#endif
|