1pub mod encryption;
4pub mod provider_bridge;
5pub mod said;
6pub mod signer;
7pub mod ssh;
8
9#[cfg(feature = "crypto-secp256k1")]
10pub mod secp256k1;
11
12pub use said::{compute_next_commitment, compute_said, verify_commitment};
13pub use signer::SignerKey;
14
15#[cfg(feature = "crypto-secp256k1")]
16pub use secp256k1::Secp256k1KeyPair;
17
18#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20pub enum EncryptionAlgorithm {
21 AesGcm256,
23 ChaCha20Poly1305,
25}
26
27impl EncryptionAlgorithm {
28 pub fn tag(&self) -> u8 {
30 match self {
31 EncryptionAlgorithm::AesGcm256 => 1,
32 EncryptionAlgorithm::ChaCha20Poly1305 => 2,
33 }
34 }
35
36 pub fn from_tag(tag: u8) -> Option<Self> {
38 match tag {
39 1 => Some(EncryptionAlgorithm::AesGcm256),
40 2 => Some(EncryptionAlgorithm::ChaCha20Poly1305),
41 _ => None,
42 }
43 }
44}