Struct rsa_cortex_m4::PrivateKey [−][src]
RSA private key.
Fundamentally, this consists of two different primes p
and q
, which should
both have bit length 8L (i.e., L4 bytes).
Additionally, d_p = e^{-1} (mod p)
and d_q = e^{-1} (mod q)
are stored.
It's quite sad, but we can't enforce the bound L2 = 2*L
.
Implementations
impl<const D: usize> PrivateKey<D>
[src]
pub fn decryption_primitive(&self, ciphertext: &[u8]) -> Result<Long<D>>
[src]
pub fn classic_decryption_primitive(&self, ciphertext: &[u8]) -> Result<Long<D>>
[src]
pub fn inversion_free_decryption(&self, ciphertext: &[u8]) -> Result<Long<D>>
[src]
This saves calculating and storing the inverse $q^{-1}\text{ mod }p$.
pub fn blinded_inversion_free_decryption(
&self,
rng: impl CryptoRng + RngCore,
ciphertext: &[u8]
) -> Result<Long<D>>
[src]
&self,
rng: impl CryptoRng + RngCore,
ciphertext: &[u8]
) -> Result<Long<D>>
As also explained in Improvements..., it is easy to blind the factors.
pub fn signature_primitive(&self, msg: &[u8]) -> Result<Long<D>>
[src]
pub fn sign<P, R>(&self, msg: &[u8], _padding: P, rng: R) -> Result<Long<D>> where
P: SignaturePadding<D>,
R: CryptoRng + RngCore,
[src]
P: SignaturePadding<D>,
R: CryptoRng + RngCore,
Sign a message with respect to a padding method.
pub fn decrypt<P>(&self, ciphertext: &[u8], _: P) -> Result<Unpadded<D>> where
P: EncryptionPadding<D>,
[src]
P: EncryptionPadding<D>,
Decrypt a ciphertext with respect to a padding method.
impl<const L: usize> PrivateKey<L>
[src]
Trait Implementations
impl<const D: usize> Bits for PrivateKey<D>
[src]
impl<const D: usize> From<(Prime<D, 0_usize>, Prime<D, 0_usize>)> for PrivateKey<D>
[src]
fn from(prime_pair: (ShortPrime<D>, ShortPrime<D>)) -> Self
[src]
impl<const D: usize> Zeroize for PrivateKey<D>
[src]
Auto Trait Implementations
impl<const D: usize> Send for PrivateKey<D>
[src]
impl<const D: usize> Sync for PrivateKey<D>
[src]
impl<const D: usize> Unpin for PrivateKey<D>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,