Permalink
Browse files

scalar_add_b32

  • Loading branch information...
ryancdotorg committed Jan 11, 2017
1 parent a18b9c7 commit 660c20dc6426f2d19c067cfefb96a0a5f6a54873
Showing with 13 additions and 0 deletions.
  1. +11 −0 ec_pubkey_fast.c
  2. +2 −0 ec_pubkey_fast.h
View
@@ -392,6 +392,17 @@ int secp256k1_ec_pubkey_batch_create(unsigned int num, unsigned char (*pub)[65],
return 0;
}
int secp256k1_scalar_add_b32(void * out, void * a, void *b) {
secp256k1_scalar_t tmp_a, tmp_b;
secp256k1_scalar_set_b32(&tmp_a, a, NULL);
secp256k1_scalar_set_b32(&tmp_b, b, NULL);
secp256k1_scalar_add(&tmp_a, &tmp_a, &tmp_b);
secp256k1_scalar_get_b32(out, &tmp_a);
return 0;
}
inline static void _priv_add(unsigned char *priv, unsigned char add, int p) {
priv[p] += add;
if (priv[p] < add) {
View
@@ -8,6 +8,8 @@ int secp256k1_ec_pubkey_create_precomp(unsigned char *, int *, const unsigned ch
int secp256k1_ec_pubkey_incr_init(unsigned char *, unsigned int);
int secp256k1_ec_pubkey_incr(unsigned char *, int *, unsigned char *);
int secp256k1_scalar_add_b32(void *, void *, void *);
void priv_add_uint8(unsigned char *, unsigned char);
void priv_add_uint32(unsigned char *, unsigned int);

0 comments on commit 660c20d

Please sign in to comment.