P256
The P256 guest library uses openvm-ecc-guest
to provide elliptic curve operations over the Secp256r1 curve. It is intended as a patch for the p256
rust crate and can be swapped in for accelerated signature verification usage. Note that signing from a private key is not supported.
Config parameters
For the guest program to build successfully, all used moduli and curves must be declared in the .toml
config file in the following format:
[app_vm_config.modular]
supported_moduli = ["115792089210356248762697446949407573530086143415290314195533631308867097853951", "115792089210356248762697446949407573529996955224135760342422259061068512044369"]
[[app_vm_config.ecc.supported_curves]]
struct_name = "P256Point"
modulus = "115792089210356248762697446949407573530086143415290314195533631308867097853951"
scalar = "115792089210356248762697446949407573529996955224135760342422259061068512044369"
a = "115792089210356248762697446949407573530086143415290314195533631308867097853948"
b = "41058363725152142129326129780047268409114441015993725554835256314039467401291"
The supported_moduli
parameter is a list of moduli that the guest program will use. As mentioned in the algebra extension chapter, the order of moduli in [app_vm_config.modular]
must match the order in the moduli_init!
macro.
The ecc.supported_curves
parameter is a list of supported curves that the guest program will use. They must be provided in decimal format in the .toml
file. For multiple curves create multiple [[app_vm_config.ecc.supported_curves]]
sections. The order of curves in [[app_vm_config.ecc.supported_curves]]
must match the order in the sw_init!
macro.
Also, the struct_name
field must be the name of the elliptic curve struct created by sw_declare!
.