EcStateImpl
Fully qualified path: core::ec::EcStateImpl
pub impl EcStateImpl of EcStateTrait
Impl functions
init
Initializes an EC computation with the zero point. # Examples
let mut state = EcStateTrait::init();
Fully qualified path: core::ec::EcStateImpl::init
fn init() -> EcState nopanic
add
Adds a point to the computation. # Argumentsp
- The non-zero point to add
Fully qualified path: core::ec::EcStateImpl::add
fn add(ref self: EcState, p: NonZeroEcPoint) nopanic
sub
Subtracts a point to the computation. # Argumentsp
- The non-zero point to subtract
Fully qualified path: core::ec::EcStateImpl::sub
fn sub(ref self: EcState, p: NonZeroEcPoint)
add_mul
Adds the product p * scalar
to the state. # Argumentsscalar
- The scalar to multiply the point by * p
- The non-zero point to multiply and add
Fully qualified path: core::ec::EcStateImpl::add_mul
fn add_mul(ref self: EcState, scalar: felt252, p: NonZeroEcPoint) nopanic
finalize_nz
Finalizes the EC computation and returns the result as a non-zero point. # ReturnsOption<NonZeroEcPoint>
- The resulting point, or None if the result is the zero point # PanicsPanics if the result is the point at infinity.
Fully qualified path: core::ec::EcStateImpl::finalize_nz
fn finalize_nz(self: EcState) -> Option<NonZeroEcPoint> nopanic
finalize
Finalizes the EC computation and returns the result.Returns the zero point if the computation results in the point at infinity.
Fully qualified path: core::ec::EcStateImpl::finalize
fn finalize(self: EcState) -> EcPoint