srp/
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.
6use crate::types::SrpGroup;
7use lazy_static::lazy_static;
8use num_bigint::BigUint;
9
10lazy_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
17lazy_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
24lazy_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
31lazy_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
38lazy_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
45lazy_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
52lazy_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}