]> git.lizzy.rs Git - PAKEs.git/blob - srp/src/groups.rs
Switch from num to num-traits and num-bigint (#31)
[PAKEs.git] / srp / src / groups.rs
1 //! Groups from [RFC 5054](https://tools.ietf.org/html/rfc5054)
2 //!
3 //! It is strongly recommended to use them instead of custom generated
4 //! groups. Additionally it is not recommended to use `G_1024` and `G_1536`,
5 //! they are provided only for compatibility with the legacy software.
6 use crate::types::SrpGroup;
7 use lazy_static::lazy_static;
8 use num_bigint::BigUint;
9
10 lazy_static! {
11     pub static ref G_1024: SrpGroup = SrpGroup {
12         n: BigUint::from_bytes_be(include_bytes!("groups/1024.bin")),
13         g: BigUint::from_bytes_be(&[2]),
14     };
15 }
16
17 lazy_static! {
18     pub static ref G_1536: SrpGroup = SrpGroup {
19         n: BigUint::from_bytes_be(include_bytes!("groups/1536.bin")),
20         g: BigUint::from_bytes_be(&[2]),
21     };
22 }
23
24 lazy_static! {
25     pub static ref G_2048: SrpGroup = SrpGroup {
26         n: BigUint::from_bytes_be(include_bytes!("groups/2048.bin")),
27         g: BigUint::from_bytes_be(&[2]),
28     };
29 }
30
31 lazy_static! {
32     pub static ref G_3072: SrpGroup = SrpGroup {
33         n: BigUint::from_bytes_be(include_bytes!("groups/3072.bin")),
34         g: BigUint::from_bytes_be(&[5]),
35     };
36 }
37
38 lazy_static! {
39     pub static ref G_4096: SrpGroup = SrpGroup {
40         n: BigUint::from_bytes_be(include_bytes!("groups/4096.bin")),
41         g: BigUint::from_bytes_be(&[5]),
42     };
43 }
44
45 lazy_static! {
46     pub static ref G_6144: SrpGroup = SrpGroup {
47         n: BigUint::from_bytes_be(include_bytes!("groups/6144.bin")),
48         g: BigUint::from_bytes_be(&[5]),
49     };
50 }
51
52 lazy_static! {
53     pub static ref G_8192: SrpGroup = SrpGroup {
54         n: BigUint::from_bytes_be(include_bytes!("groups/8192.bin")),
55         g: BigUint::from_bytes_be(&[19]),
56     };
57 }