MCPcopy Create free account
hub / github.com/RustCrypto/RSA / PaddingScheme

Interface PaddingScheme

src/traits/padding.rs:11–31  ·  view source on GitHub ↗

Padding scheme used for encryption.

Source from the content-addressed store, hash-verified

9
10/// Padding scheme used for encryption.
11pub trait PaddingScheme {
12 /// Decrypt the given message using the given private key.
13 ///
14 /// If an `rng` is passed, it uses RSA blinding to help mitigate timing side-channel attacks.
15 #[allow(clippy::missing_errors_doc, reason = "TODO")]
16 fn decrypt<Rng: TryCryptoRng + ?Sized>(
17 self,
18 rng: Option<&mut Rng>,
19 priv_key: &PrivateKey,
20 ciphertext: &[u8],
21 ) -> Result<Vec<u8>>;
22
23 /// Encrypt the given message using the given public key.
24 #[allow(clippy::missing_errors_doc, reason = "TODO")]
25 fn encrypt<Rng: TryCryptoRng + ?Sized>(
26 self,
27 rng: &mut Rng,
28 pub_key: &PublicKey,
29 msg: &[u8],
30 ) -> Result<Vec<u8>>;
31}
32
33/// Digital signature scheme.
34pub trait SignatureScheme {

Callers

nothing calls this directly

Implementers 2

pkcs1v15.rssrc/pkcs1v15.rs
oaep.rssrc/oaep.rs

Calls

no outgoing calls

Tested by

no test coverage detected