MCPcopy Create free account
hub / github.com/ElementsProject/elements / uint16_to_signed30

Function uint16_to_signed30

src/secp256k1/src/tests.c:1006–1012  ·  view source on GitHub ↗

Convert a 256-bit number represented as 16 uint16_t's to signed30 notation. */

Source from the content-addressed store, hash-verified

1004
1005/* Convert a 256-bit number represented as 16 uint16_t's to signed30 notation. */
1006static void uint16_to_signed30(secp256k1_modinv32_signed30* out, const uint16_t* in) {
1007 int i;
1008 memset(out->v, 0, sizeof(out->v));
1009 for (i = 0; i < 256; ++i) {
1010 out->v[i / 30] |= (int32_t)(((in[i >> 4]) >> (i & 15)) & 1) << (i % 30);
1011 }
1012}
1013
1014/* Convert a 256-bit number in signed30 notation to a representation as 16 uint16_t's. */
1015static void signed30_to_uint16(uint16_t* out, const secp256k1_modinv32_signed30* in) {

Callers 1

test_modinv32_uint16Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected