package weistrass_tools import secec "core:crypto/_weierstrass" import "core:fmt" import path "core:path/filepath" import "core:os" import "core:strings" // Yes this leaks memory, fite me IRL. GENERATED :: `/* ------ GENERATED ------ DO NOT EDIT ------ GENERATED ------ DO NOT EDIT ------ GENERATED ------ */` main :: proc() { gen_tables("p256r1") gen_tables("p384r1") } gen_tables :: proc($CURVE: string) { when CURVE == "p256r1" { Affine_Point_p256r1 :: struct { x: secec.Field_Element_p256r1, y: secec.Field_Element_p256r1, } Multiply_Table_hi: [32][15]Affine_Point_p256r1 Multiply_Table_lo: [32][15]Affine_Point_p256r1 SC_LEN :: 32 g, p: secec.Point_p256r1 } else when CURVE == "p384r1" { Affine_Point_p384r1 :: struct { x: secec.Field_Element_p384r1, y: secec.Field_Element_p384r1, } Multiply_Table_hi: [48][15]Affine_Point_p384r1 Multiply_Table_lo: [48][15]Affine_Point_p384r1 SC_LEN :: 48 g, p: secec.Point_p384r1 } else { #panic("weistrass/tools: invalid curve") } secec.pt_generator(&g) // Precompute ([1,15] << n) * G multiples of G, MSB->LSB for i in 0..