multiversx_sc_snippets::imports

Struct EllipticCurve

Source
pub struct EllipticCurve<M>
where M: ManagedTypeApi,
{ /* private fields */ }

Implementations§

Source§

impl<M> EllipticCurve<M>
where M: ManagedTypeApi,

Source

pub fn from_name(name: &ManagedBuffer<M>) -> EllipticCurve<M>

Source

pub fn from_name_str(name: &str) -> EllipticCurve<M>

Source

pub fn from_bitsize(bitsize: u32) -> Option<EllipticCurve<M>>

Source

pub fn get_values( &self, ) -> (BigUint<M>, BigUint<M>, BigUint<M>, BigUint<M>, BigUint<M>, u32)

Source

pub fn get_curve_length(&self) -> u32

Source

pub fn get_priv_key_byte_length(&self) -> u32

Source

pub fn add( &self, x_first_point: BigUint<M>, y_first_point: BigUint<M>, x_second_point: BigUint<M>, y_second_point: BigUint<M>, ) -> (BigUint<M>, BigUint<M>)

Source

pub fn double( &self, x_point: BigUint<M>, y_point: BigUint<M>, ) -> (BigUint<M>, BigUint<M>)

Source

pub fn is_on_curve(&self, x_point: BigUint<M>, y_point: BigUint<M>) -> bool

Source

pub fn scalar_mult_legacy( &self, x_point: BigUint<M>, y_point: BigUint<M>, data: &[u8], ) -> (BigUint<M>, BigUint<M>)

👎Deprecated since 0.41.0: Please use method scalar_mult instead.
Source

pub fn scalar_mult( &self, x_point: BigUint<M>, y_point: BigUint<M>, data: &ManagedBuffer<M>, ) -> (BigUint<M>, BigUint<M>)

Source

pub fn scalar_base_mult_legacy(&self, data: &[u8]) -> (BigUint<M>, BigUint<M>)

👎Deprecated since 0.41.0: Please use method scalar_base_mult instead.
Source

pub fn scalar_base_mult( &self, data: &ManagedBuffer<M>, ) -> (BigUint<M>, BigUint<M>)

Source

pub fn marshal_legacy( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> BoxedBytes

👎Deprecated since 0.41.0: Please use method marshal instead.
Source

pub fn marshal( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> ManagedBuffer<M>

Source

pub fn marshal_compressed_legacy( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> BoxedBytes

👎Deprecated since 0.41.0: Please use method marshal_compressed instead.
Source

pub fn marshal_compressed( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> ManagedBuffer<M>

Source

pub fn unmarshal_legacy(&self, data: &[u8]) -> (BigUint<M>, BigUint<M>)

👎Deprecated since 0.41.0: Please use method unmarshal instead.
Source

pub fn unmarshal(&self, data: &ManagedBuffer<M>) -> (BigUint<M>, BigUint<M>)

Source

pub fn unmarshal_compressed_legacy( &self, data: &[u8], ) -> (BigUint<M>, BigUint<M>)

👎Deprecated since 0.41.0: Please use method unmarshal_compressed instead.
Source

pub fn unmarshal_compressed( &self, data: &ManagedBuffer<M>, ) -> (BigUint<M>, BigUint<M>)

Source

pub fn generate_key_legacy(&self) -> (BigUint<M>, BigUint<M>, BoxedBytes)

👎Deprecated since 0.41.0: Please use method generate_key instead.
Source

pub fn generate_key(&self) -> (BigUint<M>, BigUint<M>, ManagedBuffer<M>)

Trait Implementations§

Source§

impl<M> Debug for EllipticCurve<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<M> ManagedType<M> for EllipticCurve<M>
where M: ManagedTypeApi,

Source§

type OwnHandle = <M as HandleTypeInfo>::EllipticCurveHandle

Source§

fn get_handle(&self) -> <M as HandleTypeInfo>::EllipticCurveHandle

Source§

unsafe fn forget_into_handle( self, ) -> <EllipticCurve<M> as ManagedType<M>>::OwnHandle

Forgets current object (does not run destructor), but extracts the handle. Read more
Source§

fn transmute_from_handle_ref( handle_ref: &<M as HandleTypeInfo>::EllipticCurveHandle, ) -> &EllipticCurve<M>

Implement carefully, since the underlying transmutation is an unsafe operation. For types that wrap a handle to some VM-managed data, make sure the type only contains the handle (plus ZSTs if necessary). For types that just wrap another managed type it is easier, call for the wrapped object.
Source§

fn transmute_from_handle_ref_mut( handle_ref: &mut <M as HandleTypeInfo>::EllipticCurveHandle, ) -> &mut EllipticCurve<M>

Source§

fn get_raw_handle(&self) -> i32

Source§

fn as_ref(&self) -> ManagedRef<'_, M, Self>

Source§

impl<M> ManagedVecItem for EllipticCurve<M>
where M: ManagedTypeApi,

Source§

const SKIPS_RESERIALIZATION: bool = false

If true, then the encoding of the item is identical to the payload, and no further conversion is necessary (the underlying buffer can be used as-is during serialization). False for all managed types, but true for basic types (like u32).
Source§

type PAYLOAD = ManagedVecItemPayloadBuffer<4>

Type managing the underlying binary representation in a ManagedVec..
Source§

type Ref<'a> = ManagedRef<'a, M, EllipticCurve<M>>

Reference representation of the ManagedVec item. Read more
Source§

fn read_from_payload( payload: &<EllipticCurve<M> as ManagedVecItem>::PAYLOAD, ) -> EllipticCurve<M>

Parses given bytes as a an owned object.
Source§

unsafe fn borrow_from_payload<'a>( payload: &<EllipticCurve<M> as ManagedVecItem>::PAYLOAD, ) -> <EllipticCurve<M> as ManagedVecItem>::Ref<'a>

Parses given bytes as a representation of the object, either owned, or a reference. Read more
Source§

fn save_to_payload( self, payload: &mut <EllipticCurve<M> as ManagedVecItem>::PAYLOAD, )

Converts the object into bytes. Read more
Source§

fn payload_size() -> usize

Source§

impl<M> NestedEncode for EllipticCurve<M>
where M: ManagedTypeApi,

Source§

fn dep_encode_or_handle_err<O, H>( &self, dest: &mut O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Version of dep_encode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode.
Source§

fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>

NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version.
Source§

impl<M> TopEncode for EllipticCurve<M>
where M: ManagedTypeApi,

Source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Version of top_encode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode.
Source§

fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>
where O: TopEncodeOutput,

Attempt to serialize the value to ouput.
Source§

impl<M> TypeAbi for EllipticCurve<M>
where M: ManagedTypeApi,

Source§

type Unmanaged = EllipticCurve<M>

Source§

fn type_name() -> String

Source§

fn type_name_rust() -> String

Source§

fn type_names() -> TypeNames

Source§

fn provide_type_descriptions<TDC>(accumulator: &mut TDC)

A type can provide more than its own name. For instance, a struct can also provide the descriptions of the type of its fields. TypeAbi doesn’t care for the exact accumulator type, which is abstracted by the TypeDescriptionContainer trait.
Source§

impl<M> TypeAbiFrom<EllipticCurve<M>> for EllipticCurve<M>
where M: ManagedTypeApi,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> InterpretableFrom<T> for T

Source§

fn interpret_from(from: T, _context: &InterpreterContext) -> T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ReconstructableFrom<T> for T

Source§

fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T

Source§

impl<T> SCCodec for T
where T: TopEncode,

Source§

fn fmt<F>(&self, f: &mut F)

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> TopEncodeMulti for T
where T: TopEncode,

Source§

fn multi_encode_or_handle_err<O, H>( &self, output: &mut O, h: H, ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

Version of top_encode that can handle errors as soon as they occur. For instance in can exit immediately and make sure that if it returns, it is a success. By not deferring error handling, this can lead to somewhat smaller bytecode.
Source§

fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>

Attempt to serialize the value to ouput.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T

Source§

impl<O, T> ProxyArg<O> for T
where O: TypeAbiFrom<T>, T: TopEncodeMulti,