Struct ring::rsa::public_key::Inner
source · pub(crate) struct Inner {
n: PublicModulus,
e: PublicExponent,
}
Expand description
PublicKey
but without any superfluous allocations, optimized for one-shot
RSA signature verification.
Fields§
§n: PublicModulus
§e: PublicExponent
Implementations§
source§impl Inner
impl Inner
pub(super) fn from_modulus_and_exponent( n: Input<'_>, e: Input<'_>, n_min_bits: BitLength, n_max_bits: BitLength, e_min_value: PublicExponent, cpu_features: Features, ) -> Result<Self, KeyRejected>
sourcepub(super) fn n(&self) -> &PublicModulus
pub(super) fn n(&self) -> &PublicModulus
The public modulus.
sourcepub(super) fn e(&self) -> PublicExponent
pub(super) fn e(&self) -> PublicExponent
The public exponent.
sourcepub(super) fn exponentiate<'out>(
&self,
base: Input<'_>,
out_buffer: &'out mut [u8; 1024],
cpu_features: Features,
) -> Result<&'out [u8], Unspecified>
pub(super) fn exponentiate<'out>( &self, base: Input<'_>, out_buffer: &'out mut [u8; 1024], cpu_features: Features, ) -> Result<&'out [u8], Unspecified>
Calculates base**e (mod n), filling the first part of out_buffer
with
the result.
This is constant-time with respect to the value in base
(only).
The result will be a slice of the encoded bytes of the result within
out_buffer
, if successful.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Inner
impl RefUnwindSafe for Inner
impl Send for Inner
impl Sync for Inner
impl Unpin for Inner
impl UnwindSafe for Inner
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