pub trait Secp256Trait
use starknet::secp256k1::Secp256k1Point;
use starknet::secp256_trait::Secp256Trait;
use starknet::SyscallResultTrait;
assert!(
Secp256Trait::::get_curve_size() == 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141,
);
let generator = Secp256Trait::::get_generator_point();
let generator = Secp256Trait::::secp256_ec_new_syscall(
0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,
0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8,
)
.unwrap_syscall();
let random_point = Secp256Trait::::secp256_ec_get_point_from_x_syscall(
0x4aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff3, true,
);
fn get_curve_size() -> u256
fn get_generator_point() -> Secp256Point
None
if the provided coordinates don’t represent a valid point on the curve.
fn secp256_ec_new_syscall(
x: u256, y: u256,
) -> Result, Array>
x
- The x coordinate of the pointy_parity
- If true, choose the odd y value; if false, choose the even y valueSome(point)
if a point exists with the given x coordinate,
None
otherwise.
fn secp256_ec_get_point_from_x_syscall(
x: u256, y_parity: bool,
) -> Result, Array>