Add benchmark for message decryption

This commit is contained in:
Hocuri
2025-08-04 20:59:18 +02:00
parent ad0e3179dd
commit d431f2ebd3
5 changed files with 108 additions and 0 deletions

View File

@@ -75,7 +75,10 @@ mod mimefactory;
pub mod mimeparser;
pub mod oauth2;
mod param;
#[cfg(not(feature = "internals"))]
mod pgp;
#[cfg(feature = "internals")]
pub mod pgp;
pub mod provider;
pub mod qr;
pub mod qr_code_generator;

View File

@@ -149,6 +149,11 @@ pub(crate) fn create_keypair(addr: EmailAddress) -> Result<KeyPair> {
Ok(key_pair)
}
#[cfg(feature = "internals")]
pub fn create_dummy_keypair(addr: &str) -> Result<KeyPair> {
create_keypair(EmailAddress::new(addr)?)
}
/// Selects a subkey of the public key to use for encryption.
///
/// Returns `None` if the public key cannot be used for encryption.

View File

@@ -319,6 +319,11 @@ pub(crate) fn create_broadcast_shared_secret() -> String {
res
}
#[cfg(feature = "internals")]
pub fn create_broadcast_shared_secret_pub() -> String {
create_broadcast_shared_secret()
}
/// Returns true if given string is a valid ID.
///
/// All IDs generated with `create_id()` should be considered valid.