Skip to main content

bash_prg_hash/
variants.rs

1use crate::BashPrgHash;
2use digest::{
3    CollisionResistance,
4    consts::{U16, U24, U32},
5};
6
7/// `bash-prg-hash` with ℓ = 128 and d = 1
8pub type BashPrgHash1281 = BashPrgHash<160, 1>;
9/// `bash-prg-hash` with ℓ = 128 and d = 2
10pub type BashPrgHash1282 = BashPrgHash<128, 2>;
11/// `bash-prg-hash` with ℓ = 192 and d = 1
12pub type BashPrgHash1921 = BashPrgHash<144, 1>;
13/// `bash-prg-hash` with ℓ = 192 and d = 2
14pub type BashPrgHash1922 = BashPrgHash<96, 2>;
15/// `bash-prg-hash` with ℓ = 256 and d = 1
16pub type BashPrgHash2561 = BashPrgHash<128, 1>;
17/// `bash-prg-hash`` with ℓ = 256 and d = 2
18pub type BashPrgHash2562 = BashPrgHash<64, 2>;
19
20impl CollisionResistance for BashPrgHash1281 {
21    type CollisionResistance = U16;
22}
23impl CollisionResistance for BashPrgHash1282 {
24    type CollisionResistance = U16;
25}
26impl CollisionResistance for BashPrgHash1921 {
27    type CollisionResistance = U24;
28}
29impl CollisionResistance for BashPrgHash1922 {
30    type CollisionResistance = U24;
31}
32impl CollisionResistance for BashPrgHash2561 {
33    type CollisionResistance = U32;
34}
35impl CollisionResistance for BashPrgHash2562 {
36    type CollisionResistance = U32;
37}
38
39#[cfg(feature = "oid")]
40mod oids {
41    use digest::const_oid::{AssociatedOid, ObjectIdentifier};
42
43    impl AssociatedOid for super::BashPrgHash1281 {
44        const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.112.0.2.0.34.101.77.21");
45    }
46
47    impl AssociatedOid for super::BashPrgHash1282 {
48        const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.112.0.2.0.34.101.77.22");
49    }
50
51    impl AssociatedOid for super::BashPrgHash1921 {
52        const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.112.0.2.0.34.101.77.23");
53    }
54
55    impl AssociatedOid for super::BashPrgHash1922 {
56        const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.112.0.2.0.34.101.77.24");
57    }
58
59    impl AssociatedOid for super::BashPrgHash2561 {
60        const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.112.0.2.0.34.101.77.25");
61    }
62
63    impl AssociatedOid for super::BashPrgHash2562 {
64        const OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.112.0.2.0.34.101.77.26");
65    }
66}