summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/rust.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-05-11 13:29:08 +0200
committerJustus Winter <justus@sequoia-pgp.org>2022-05-11 15:55:59 +0200
commit119b59a2c8403ee69f788106f8192949e3b40c34 (patch)
tree4c583be724a5e61b60c2199c7e5acc4584c56e53 /openpgp/src/crypto/backend/rust.rs
parent523cfd7845fd8141293b5dbe63e630428e9ac90d (diff)
openpgp: Add crypto::backend that identifies the backend.
- This returns a short, human-readable description of the cryptographic backend for use in version strings to improve bug reports. - Fixes #818.
Diffstat (limited to 'openpgp/src/crypto/backend/rust.rs')
-rw-r--r--openpgp/src/crypto/backend/rust.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/rust.rs b/openpgp/src/crypto/backend/rust.rs
index 06b1da03..dc4773ed 100644
--- a/openpgp/src/crypto/backend/rust.rs
+++ b/openpgp/src/crypto/backend/rust.rs
@@ -9,6 +9,12 @@ pub mod ecdh;
pub mod hash;
pub mod symmetric;
+/// Returns a short, human-readable description of the backend.
+pub fn backend() -> String {
+ // XXX: can we include features and the version?
+ "RustCrypto".to_string()
+}
+
/// Fills the given buffer with random data.
pub fn random(buf: &mut [u8]) {
use rand07::rngs::OsRng;