pub(crate) mod encryption;
pub(crate) mod hash;
pub(crate) mod key_exchange;
pub(crate) mod mac;
pub(crate) mod public_key;
use strum_macros::{AsRefStr, EnumString};
use self::{hash::HashCtx, key_exchange::KeyExchange};
#[derive(Copy, Clone, PartialEq, Eq, AsRefStr, EnumString)]
pub enum Enc {
#[strum(serialize = "chacha20-poly1305@openssh.com")]
Chacha20Poly1305Openssh,
#[strum(serialize = "aes128-ctr")]
Aes128Ctr,
#[strum(serialize = "aes192-ctr")]
Aes192Ctr,
#[strum(serialize = "aes256-ctr")]
Aes256Ctr,
}
#[derive(Copy, Clone, PartialEq, Eq, AsRefStr, EnumString)]
pub enum Kex {
#[strum(serialize = "curve25519-sha256")]
Curve25519Sha256,
#[strum(serialize = "ecdh-sha2-nistp256")]
EcdhSha2Nistrp256,
#[cfg(feature = "dangerous-dh-group1-sha1")]
#[strum(serialize = "diffie-hellman-group1-sha1")]
DiffieHellmanGroup1Sha1,
#[strum(serialize = "diffie-hellman-group14-sha1")]
DiffieHellmanGroup14Sha1,
#[strum(serialize = "diffie-hellman-group14-sha256")]
DiffieHellmanGroup14Sha256,
}
#[derive(Copy, Clone, PartialEq, Eq, AsRefStr, EnumString)]
pub enum PubKey {
#[strum(serialize = "ssh-ed25519")]
SshEd25519,
#[cfg(feature = "dangerous-rsa-sha1")]
#[strum(serialize = "ssh-rsa")]
SshRsa,
#[strum(serialize = "rsa-sha2-256")]
RsaSha2_256,
#[strum(serialize = "rsa-sha2-512")]
RsaSha2_512,
}
#[derive(Copy, Clone, PartialEq, Eq, AsRefStr, EnumString)]
pub enum Mac {
#[strum(serialize = "hmac-sha1")]
HmacSha1,
#[strum(serialize = "hmac-sha2-256")]
HmacSha2_256,
#[strum(serialize = "hmac-sha2-512")]
HmacSha2_512,
}
#[derive(Copy, Clone, PartialEq, Eq, AsRefStr, EnumString)]
pub enum Compress {
#[strum(serialize = "none")]
None,
}
#[derive(Default)]
pub(crate) struct Digest {
pub hash_ctx: HashCtx,
pub key_exchange: Option<Box<dyn KeyExchange>>,
}
impl Digest {
pub fn new() -> Self {
Self {
..Default::default()
}
}
}