c – What’s level addition in secp256k1 and mathematical addition when it comes to consequence?

0
64


I’ve seen solutions from HERE. They offered extra understanding of the formulation:

P = ok*G 

They mentioned add G ok occasions to get P, would not this imply realizing variety of additions is realizing ok?

however anyway, here’s a factor, I’ve seen a bit of code that satisfies the consequence P with out having to make use of ok, which made surprise if some extent A(6,9) was added with level B(4,8) what would it not produce?

static void gen_pub_key(uint8_t *pub_key, size_t n, uint160_t x)
{
    size_t idx = get_bits(n, x.i16, 0);

    secp256k1_gej_t r = bases[idx];

    for (size_t i = 1; i < NUM_PARTS(n); i++)
    {
        size_t col = i - 1;

        size_t row = get_bits(n, x.i16, i);

        secp256k1_gej_add_ge(&r, &r, &offsets[row][col]);
    }

    secp256k1_ge_t s;

    secp256k1_ge_set_gej(&s, &r);
    pub_key[0] = 0x02 | (secp256k1_fe_is_odd(&s.y) ? 0x01 : 0x00);
    secp256k1_fe_get_b32(pub_key+1, &s.x);
}

In elementary math i’d say level AB is (10,17) due to this fact conserving the worth of x and parity of y to get compressed P.

In my understanding the above code produces P utilizing level additions of 1 worth from bases array and a number of values from 2D array offsets relying on n which cannot be 0 or better than 9.
So to would not be potential to calculate or reconstruct uint160_t x on condition that n is thought and P additionally?

LEAVE A REPLY

Please enter your comment!
Please enter your name here