pub struct EllipticCurve<M>where
M: ManagedTypeApi,{ /* private fields */ }
Implementations§
Source§impl<M> EllipticCurve<M>where
M: ManagedTypeApi,
impl<M> EllipticCurve<M>where
M: ManagedTypeApi,
pub fn from_name(name: &ManagedBuffer<M>) -> EllipticCurve<M>
pub fn from_name_str(name: &str) -> EllipticCurve<M>
pub fn from_bitsize(bitsize: u32) -> Option<EllipticCurve<M>>
pub fn get_values( &self, ) -> (BigUint<M>, BigUint<M>, BigUint<M>, BigUint<M>, BigUint<M>, u32)
pub fn get_curve_length(&self) -> u32
pub fn get_priv_key_byte_length(&self) -> u32
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>)
pub fn double( &self, x_point: BigUint<M>, y_point: BigUint<M>, ) -> (BigUint<M>, BigUint<M>)
pub fn is_on_curve(&self, x_point: BigUint<M>, y_point: BigUint<M>) -> bool
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.pub fn scalar_mult( &self, x_point: BigUint<M>, y_point: BigUint<M>, data: &ManagedBuffer<M>, ) -> (BigUint<M>, BigUint<M>)
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.pub fn scalar_base_mult( &self, data: &ManagedBuffer<M>, ) -> (BigUint<M>, BigUint<M>)
pub fn marshal_legacy( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> BoxedBytes
👎Deprecated since 0.41.0: Please use method
marshal
instead.pub fn marshal( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> ManagedBuffer<M>
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.pub fn marshal_compressed( &self, x_pair: BigUint<M>, y_pair: BigUint<M>, ) -> ManagedBuffer<M>
pub fn unmarshal_legacy(&self, data: &[u8]) -> (BigUint<M>, BigUint<M>)
👎Deprecated since 0.41.0: Please use method
unmarshal
instead.pub fn unmarshal(&self, data: &ManagedBuffer<M>) -> (BigUint<M>, BigUint<M>)
pub fn unmarshal_compressed_legacy( &self, data: &[u8], ) -> (BigUint<M>, BigUint<M>)
👎Deprecated since 0.41.0: Please use method
unmarshal_compressed
instead.pub fn unmarshal_compressed( &self, data: &ManagedBuffer<M>, ) -> (BigUint<M>, BigUint<M>)
pub fn generate_key_legacy(&self) -> (BigUint<M>, BigUint<M>, BoxedBytes)
👎Deprecated since 0.41.0: Please use method
generate_key
instead.pub fn generate_key(&self) -> (BigUint<M>, BigUint<M>, ManagedBuffer<M>)
Trait Implementations§
Source§impl<M> Debug for EllipticCurve<M>
impl<M> Debug for EllipticCurve<M>
Source§impl<M> ManagedType<M> for EllipticCurve<M>where
M: ManagedTypeApi,
impl<M> ManagedType<M> for EllipticCurve<M>where
M: ManagedTypeApi,
type OwnHandle = <M as HandleTypeInfo>::EllipticCurveHandle
fn get_handle(&self) -> <M as HandleTypeInfo>::EllipticCurveHandle
Source§unsafe fn forget_into_handle(
self,
) -> <EllipticCurve<M> as ManagedType<M>>::OwnHandle
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>
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.
fn transmute_from_handle_ref_mut( handle_ref: &mut <M as HandleTypeInfo>::EllipticCurveHandle, ) -> &mut EllipticCurve<M>
fn get_raw_handle(&self) -> i32
fn as_ref(&self) -> ManagedRef<'_, M, Self>
Source§impl<M> ManagedVecItem for EllipticCurve<M>where
M: ManagedTypeApi,
impl<M> ManagedVecItem for EllipticCurve<M>where
M: ManagedTypeApi,
Source§const SKIPS_RESERIALIZATION: bool = false
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 PAYLOAD = ManagedVecItemPayloadBuffer<4>
Type managing the underlying binary representation in a ManagedVec..
Source§type Ref<'a> = ManagedRef<'a, M, EllipticCurve<M>>
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>
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>
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,
)
fn save_to_payload( self, payload: &mut <EllipticCurve<M> as ManagedVecItem>::PAYLOAD, )
Converts the object into bytes. Read more
fn payload_size() -> usize
Source§impl<M> NestedEncode for EllipticCurve<M>where
M: ManagedTypeApi,
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>where
O: NestedEncodeOutput,
H: EncodeErrorHandler,
fn dep_encode_or_handle_err<O, H>(
&self,
dest: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: NestedEncodeOutput,
H: EncodeErrorHandler,
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>where
O: NestedEncodeOutput,
fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>where
O: NestedEncodeOutput,
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,
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>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
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,
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,
impl<M> TypeAbi for EllipticCurve<M>where
M: ManagedTypeApi,
type Unmanaged = EllipticCurve<M>
fn type_name() -> String
fn type_name_rust() -> String
fn type_names() -> TypeNames
Source§fn provide_type_descriptions<TDC>(accumulator: &mut TDC)where
TDC: TypeDescriptionContainer,
fn provide_type_descriptions<TDC>(accumulator: &mut TDC)where
TDC: TypeDescriptionContainer,
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.
impl<M> TypeAbiFrom<EllipticCurve<M>> for EllipticCurve<M>where
M: ManagedTypeApi,
Auto Trait Implementations§
impl<M> Freeze for EllipticCurve<M>
impl<M> RefUnwindSafe for EllipticCurve<M>
impl<M> Send for EllipticCurve<M>
impl<M> Sync for EllipticCurve<M>
impl<M> Unpin for EllipticCurve<M>
impl<M> UnwindSafe for EllipticCurve<M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> ReconstructableFrom<T> for T
impl<T> ReconstructableFrom<T> for T
fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T
Source§impl<T> SCCodec for Twhere
T: TopEncode,
impl<T> SCCodec for Twhere
T: TopEncode,
fn fmt<F>(&self, f: &mut F)where
F: FormatByteReceiver,
Source§impl<T> TopEncodeMulti for Twhere
T: TopEncode,
impl<T> TopEncodeMulti for Twhere
T: TopEncode,
Source§fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
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>where
O: TopEncodeMultiOutput,
fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
Attempt to serialize the value to ouput.