7 #ifndef SECP256K1_SCALAR_REPR_IMPL_H
8 #define SECP256K1_SCALAR_REPR_IMPL_H
24 return ((*a >> offset) & ((((uint32_t)1) << count) - 1));
30 return secp256k1_scalar_get_bits(a, offset, count);
40 static void secp256k1_scalar_cadd_bit(
secp256k1_scalar *
r,
unsigned int bit,
int flag) {
48 static void secp256k1_scalar_set_b32(
secp256k1_scalar *
r,
const unsigned char *b32,
int *overflow) {
52 for (i = 0; i < 32; i++) {
56 if (overflow) *overflow = 0;
59 static void secp256k1_scalar_get_b32(
unsigned char *bin,
const secp256k1_scalar* a) {
61 bin[28] = *a >> 24; bin[29] = *a >> 16; bin[30] = *a >> 8; bin[31] = *a;
85 if (flag) secp256k1_scalar_negate(
r,
r);
97 ret = *
r & ((1 << n) - 1);