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

Function run_gej

src/secp256k1/src/tests.c:4118–4152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4116}
4117
4118static void run_gej(void) {
4119 int i;
4120 secp256k1_gej a, b;
4121
4122 /* Tests for secp256k1_gej_cmov */
4123 for (i = 0; i < COUNT; i++) {
4124 secp256k1_gej_set_infinity(&a);
4125 secp256k1_gej_set_infinity(&b);
4126 test_gej_cmov(&a, &b);
4127
4128 random_gej_test(&a);
4129 test_gej_cmov(&a, &b);
4130 test_gej_cmov(&b, &a);
4131
4132 b = a;
4133 test_gej_cmov(&a, &b);
4134
4135 random_gej_test(&b);
4136 test_gej_cmov(&a, &b);
4137 test_gej_cmov(&b, &a);
4138 }
4139
4140 /* Tests for secp256k1_gej_eq_var */
4141 for (i = 0; i < COUNT; i++) {
4142 secp256k1_fe fe;
4143 random_gej_test(&a);
4144 random_gej_test(&b);
4145 CHECK(!secp256k1_gej_eq_var(&a, &b));
4146
4147 b = a;
4148 random_fe_non_zero_test(&fe);
4149 secp256k1_gej_rescale(&a, &fe);
4150 CHECK(secp256k1_gej_eq_var(&a, &b));
4151 }
4152}
4153
4154static void test_ec_combine(void) {
4155 secp256k1_scalar sum = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0);

Callers 1

mainFunction · 0.85

Calls 6

test_gej_cmovFunction · 0.85
random_gej_testFunction · 0.85
random_fe_non_zero_testFunction · 0.85
secp256k1_gej_eq_varFunction · 0.70
secp256k1_gej_rescaleFunction · 0.70

Tested by

no test coverage detected