Skip to content

fe_sqr tests could be improved #1472

@Coding-Enthusiast

Description

@Coding-Enthusiast

secp256k1/src/tests.c

Lines 3289 to 3303 in efe85c7

static void run_sqr(void) {
secp256k1_fe x, s;
{
int i;
secp256k1_fe_set_int(&x, 1);
secp256k1_fe_negate(&x, &x, 1);
for (i = 1; i <= 512; ++i) {
secp256k1_fe_mul_int(&x, 2);
secp256k1_fe_normalize(&x);
secp256k1_fe_sqr(&s, &x);
}
}
}

This method doesn't test anything and after looking through commits it was added in 59447da and got removed in the next commit 21f81a8. I'm not sure what the "problem" mentioned in the first commit is but if it is checking it using the SECP256K1_FE_VERIFY method, it is pointless to call run_sqr without this build configuration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions