quantcrypt/kdf/common/
kdf_type.rs1use crate::kdf::common::config::oids::Oid;
2use strum::IntoEnumIterator;
3use strum_macros::EnumIter;
4
5#[derive(Clone, Debug, PartialEq, EnumIter)]
7pub enum KdfType {
8 HkdfWithSha256,
10 HkdfWithSha384,
12 HkdfWithSha512,
14 Kmac128,
16 Kmac256,
18}
19
20impl KdfType {
21 pub fn all() -> Vec<KdfType> {
23 KdfType::iter().collect()
24 }
25
26 pub fn from_oid(oid: &str) -> Option<KdfType> {
28 let all_kdf_types = KdfType::all();
29 all_kdf_types
30 .into_iter()
31 .find(|kdf_type| kdf_type.get_oid() == oid)
32 }
33}