Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/scalar_low_impl.h
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | static void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) { | ||||
*r1 = *a; | *r1 = *a; | ||||
*r2 = 0; | *r2 = 0; | ||||
} | } | ||||
SECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) { | SECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) { | ||||
return *a == *b; | return *a == *b; | ||||
} | } | ||||
static SECP256K1_INLINE void secp256k1_scalar_cmov(secp256k1_scalar *r, const secp256k1_scalar *a, int flag) { | |||||
uint32_t mask0, mask1; | |||||
mask0 = flag + ~((uint32_t)0); | |||||
mask1 = ~mask0; | |||||
*r = (*r & mask0) | (*a & mask1); | |||||
} | |||||
#endif /* SECP256K1_SCALAR_REPR_IMPL_H */ | #endif /* SECP256K1_SCALAR_REPR_IMPL_H */ |