Skip to content

Missing multiplies_x(k=2) for some curves #8

@garlonicon

Description

@garlonicon

For secp256k1, it is easy to spot, that the generator was picked in a special way, if you halve that point:

multiplies_x(k=2)
+-------------+----------------------------------------------+
| Hx:         | 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63 |
| bits:       | 0xa6                                         |
| difference: | 0x5a                                         |
| ratio:      | 0.64844                                      |
+-------------+----------------------------------------------+

However, for some other curves, it is also the case, but the data is missing for some reason:

Sage code for sect163k1

F.<x> = GF(2)[]
K = GF(2^163, name="x", modulus= x^163 +  x^7 +  x^6 +  x^3 + 1)
E = EllipticCurve(K, (1, K.from_integer(0x000000000000000000000000000000000000000001), 0, 0, K.from_integer(0x000000000000000000000000000000000000000001)))
E.set_order(0x04000000000000000000020108a2e0cc0d99f8a5ef * 0x2)
G = E(K.from_integer(0x02fe13c0537bbc11acaa07d793de4e6d5e5c94eee8), K.from_integer(0x0289070fb05d38ff58321f2e800536d538ccdaa3d9))
private_key = 0x200000000000000000001008451706606ccfc52f7
P = private_key*G
print(hex(P[0].to_integer()),hex(P[1].to_integer()))

output:

0x23e21d6019e1211f6bd47ec180256e97 0x1055096ab0cce03fdb8ba9bf2d02e94a1205eee5e

Sage code for sect113r1

F.<x> = GF(2)[]
K = GF(2^113, name="x", modulus= x^113 +  x^9 + 1)
E = EllipticCurve(K, (1, K.from_integer(0x003088250ca6e7c7fe649ce85820f7), 0, 0, K.from_integer(0x00e8bee4d3e2260744188be0e9c723)))
E.set_order(0x0100000000000000d9ccec8a39e56f * 0x2)
G = E(K.from_integer(0x009d73616f35f4ab1407d73562c10f), K.from_integer(0x00a52830277958ee84d1315ed31886))
private_key = 0x800000000000006ce676451cf2b8
P = private_key*G
print(hex(P[0].to_integer()),hex(P[1].to_integer()))

output:

0x3 0x1a7078c5d29ee7ea6e8ff326518f5

Here, in sect163k1, half of the generator gives us some 128-bit number (instead of expected 163-bit), which sounds like "x=MD5(something)" or a similar way of picking the generator. And in case of sect113r1, there is "x=3", which is probably the lowest x-value, which resulted in a valid point on this curve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions