MCPcopy Create free account
hub / github.com/JeanLucPons/VanitySearch / Init

Method Init

SECP256K1.cpp:28–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void Secp256K1::Init() {
29
30 // Prime for the finite field
31 Int P;
32 P.SetBase16("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F");
33
34 // Set up field
35 Int::SetupField(&P);
36
37 // Generator point and order
38 G.x.SetBase16("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798");
39 G.y.SetBase16("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8");
40 G.z.SetInt32(1);
41 order.SetBase16("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141");
42
43 Int::InitK1(&order);
44
45 // Compute Generator table
46 Point N(G);
47 for(int i = 0; i < 32; i++) {
48 GTable[i * 256] = N;
49 N = DoubleDirect(N);
50 for (int j = 1; j < 255; j++) {
51 GTable[i * 256 + j] = N;
52 N = AddDirect(N, GTable[i * 256]);
53 }
54 GTable[i * 256 + 255] = N; // Dummy point for check function
55 }
56
57}
58
59Secp256K1::~Secp256K1() {
60}

Callers

nothing calls this directly

Calls 2

SetBase16Method · 0.80
SetInt32Method · 0.80

Tested by

no test coverage detected