Bitcoin Core 32.99.0
P2P Digital Currency
eckey_impl.h
Go to the documentation of this file.
1/***********************************************************************
2 * Copyright (c) 2013, 2014 Pieter Wuille *
3 * Distributed under the MIT software license, see the accompanying *
4 * file COPYING or https://www.opensource.org/licenses/mit-license.php.*
5 ***********************************************************************/
6
7#ifndef SECP256K1_ECKEY_IMPL_H
8#define SECP256K1_ECKEY_IMPL_H
9
10#include "eckey.h"
11
12#include "util.h"
13#include "scalar.h"
14#include "field.h"
15#include "group.h"
16#include "ecmult_gen.h"
17
19 secp256k1_scalar_add(key, key, tweak);
20 return !secp256k1_scalar_is_zero(key);
21}
22
25 secp256k1_gej_set_ge(&pt, key);
27
29 return 0;
30 }
31 secp256k1_ge_set_gej(key, &pt);
32 return 1;
33}
34
36 int ret;
38
39 secp256k1_scalar_mul(key, key, tweak);
40 return ret;
41}
42
46 return 0;
47 }
48
49 secp256k1_gej_set_ge(&pt, key);
50 secp256k1_ecmult(&pt, &pt, tweak, NULL);
51 secp256k1_ge_set_gej(key, &pt);
52 return 1;
53}
54
55#endif /* SECP256K1_ECKEY_IMPL_H */
int ret
static int secp256k1_eckey_pubkey_tweak_mul(secp256k1_ge *key, const secp256k1_scalar *tweak)
Definition: eckey_impl.h:43
static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak)
Definition: eckey_impl.h:23
static int secp256k1_eckey_seckey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak)
Definition: eckey_impl.h:35
static int secp256k1_eckey_seckey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak)
Definition: eckey_impl.h:18
static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng)
Double multiply: R = na*A + ng*G.
static int secp256k1_gej_is_infinity(const secp256k1_gej *a)
Check whether a group element is the point at infinity.
static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a)
Set a group element equal to another which is given in jacobian coordinates.
static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a)
Set a group element (jacobian) equal to another which is given in affine coordinates.
static int tweak(const secp256k1_context *ctx, secp256k1_xonly_pubkey *agg_pk, secp256k1_musig_keyagg_cache *cache)
Definition: musig.c:64
static int secp256k1_scalar_is_zero(const secp256k1_scalar *a)
Check whether a scalar equals zero.
static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b)
Add two scalars together (modulo the group order).
static void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b)
Multiply two scalars (modulo the group order).
static const secp256k1_scalar secp256k1_scalar_one
Definition: scalar_impl.h:27
A group element in affine coordinates on the secp256k1 curve, or occasionally on an isomorphic curve ...
Definition: group.h:16
A group element of the secp256k1 curve, in jacobian coordinates.
Definition: group.h:28
A scalar modulo the group order of the secp256k1 curve.
Definition: scalar_4x64.h:13