summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/crypto/backend')
-rw-r--r--openpgp/src/crypto/backend/cng.rs6
-rw-r--r--openpgp/src/crypto/backend/nettle.rs7
-rw-r--r--openpgp/src/crypto/backend/rust.rs6
3 files changed, 19 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/cng.rs b/openpgp/src/crypto/backend/cng.rs
index f964756a..89f56e31 100644
--- a/openpgp/src/crypto/backend/cng.rs
+++ b/openpgp/src/crypto/backend/cng.rs
@@ -10,6 +10,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?
+ "Windows CNG".to_string()
+}
+
/// Fills the given buffer with random data.
pub fn random(buf: &mut [u8]) {
RandomNumberGenerator::system_preferred()
diff --git a/openpgp/src/crypto/backend/nettle.rs b/openpgp/src/crypto/backend/nettle.rs
index 79497a66..3de8a6a9 100644
--- a/openpgp/src/crypto/backend/nettle.rs
+++ b/openpgp/src/crypto/backend/nettle.rs
@@ -10,6 +10,13 @@ pub mod ecdh;
pub mod hash;
pub mod symmetric;
+/// Returns a short, human-readable description of the backend.
+pub fn backend() -> String {
+ // XXX: Once we depend on nettle-rs 7.1, add cv448 feature
+ // XXX: Once we depend on nettle-rs 7.2, add nettle::version
+ "Nettle".to_string()
+}
+
/// Fills the given buffer with random data.
pub fn random(buf: &mut [u8]) {
Yarrow::default().random(buf);
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;