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

Function random_fe_non_zero

src/secp256k1/src/tests.c:3005–3016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3003}
3004
3005static void random_fe_non_zero(secp256k1_fe *nz) {
3006 int tries = 10;
3007 while (--tries >= 0) {
3008 random_fe(nz);
3009 secp256k1_fe_normalize(nz);
3010 if (!secp256k1_fe_is_zero(nz)) {
3011 break;
3012 }
3013 }
3014 /* Infinitesimal probability of spurious failure here */
3015 CHECK(tries >= 0);
3016}
3017
3018static void random_fe_non_square(secp256k1_fe *ns) {
3019 secp256k1_fe r;

Callers 3

random_fe_non_squareFunction · 0.70
run_field_miscFunction · 0.70
test_geFunction · 0.70

Calls 3

random_feFunction · 0.70
secp256k1_fe_normalizeFunction · 0.70
secp256k1_fe_is_zeroFunction · 0.70

Tested by

no test coverage detected