#[repr(C)]pub struct Keypair(/* private fields */);
Implementations§
§impl Keypair
impl Keypair
pub fn cmp_fast_unstable(&self, other: &Keypair) -> Ordering
pub fn cmp_fast_unstable(&self, other: &Keypair) -> Ordering
Like cmp::Ord
but faster and with no guarantees across library versions.
The inner byte array of Self
is passed across the FFI boundry, as such there are
no guarantees on its layout and it is subject to change across library versions,
even minor versions. For this reason comparison function implementations (e.g.
Ord
, PartialEq
) take measures to ensure the data will remain constant (e.g., by
serializing it to a guaranteed format). This means they may be slow, this function
provides a faster comparison if you know that your types come from the same library
version.
pub fn eq_fast_unstable(&self, other: &Keypair) -> bool
pub fn eq_fast_unstable(&self, other: &Keypair) -> bool
Like cmp::Eq
but faster and with no guarantees across library versions.
The inner byte array of Self
is passed across the FFI boundry, as such there are
no guarantees on its layout and it is subject to change across library versions,
even minor versions. For this reason comparison function implementations (e.g.
Ord
, PartialEq
) take measures to ensure the data will remain constant (e.g., by
serializing it to a guaranteed format). This means they may be slow, this function
provides a faster equality check if you know that your types come from the same
library version.
§impl Keypair
impl Keypair
pub unsafe fn new() -> Keypair
pub unsafe fn new() -> Keypair
Creates an “uninitialized” FFI keypair which is zeroed out
§Safety
If you pass this to any FFI functions, except as an out-pointer, the result is likely to be an assertation failure and process termination.
pub unsafe fn from_array_unchecked(data: [u8; 96]) -> Keypair
pub unsafe fn from_array_unchecked(data: [u8; 96]) -> Keypair
Create a new keypair usable for the FFI interface from raw bytes
§Safety
Does not check the validity of the underlying representation. If it is invalid the result may be assertation failures (and process aborts) from the underlying library. You should not use this method except with data that you obtained from the FFI interface of the same version of this library.
pub fn underlying_bytes(self) -> [u8; 96]
pub fn underlying_bytes(self) -> [u8; 96]
Returns the underlying FFI opaque representation of the x-only public key
You should not use this unless you really know what you are doing. It is essentially only useful for extending the FFI interface itself.
pub fn non_secure_erase(&mut self)
pub fn non_secure_erase(&mut self)
Attempts to erase the contents of the underlying array.
Note, however, that the compiler is allowed to freely copy or move the
contents of this array to other places in memory. Preventing this behavior
is very subtle. For more discussion on this, please see the documentation
of the zeroize
crate.
Trait Implementations§
§impl Ord for Keypair
impl Ord for Keypair
§impl PartialOrd for Keypair
impl PartialOrd for Keypair
§fn partial_cmp(&self, other: &Keypair) -> Option<Ordering>
fn partial_cmp(&self, other: &Keypair) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more