aboutsummaryrefslogtreecommitdiff
path: root/srp/src/groups.rs
diff options
context:
space:
mode:
authorАртём Павлов [Artyom Pavlov] <newpavlov@gmail.com>2017-08-14 07:37:17 +0300
committerАртём Павлов [Artyom Pavlov] <newpavlov@gmail.com>2017-08-14 07:37:17 +0300
commit331727194c231a10dc2e296922e09aa0e888f4bd (patch)
tree46e2a32679f399a7584b3b33d3986611195a395c /srp/src/groups.rs
parentdefd41c0ee00cf06930b733e9ab06163bc6ad1cf (diff)
downloadPAKEs-331727194c231a10dc2e296922e09aa0e888f4bd.tar.xz
PAKE repository reorganization
Diffstat (limited to 'srp/src/groups.rs')
-rw-r--r--srp/src/groups.rs56
1 files changed, 56 insertions, 0 deletions
diff --git a/srp/src/groups.rs b/srp/src/groups.rs
new file mode 100644
index 0000000..246134e
--- /dev/null
+++ b/srp/src/groups.rs
@@ -0,0 +1,56 @@
+//! Groups from [RFC 5054](https://tools.ietf.org/html/rfc5054)
+//!
+//! It is strongly recommended to use them instead of custom generated
+//! groups. Additionally it is not recommended to use `G_1024` and `G_1536`,
+//! they are provided only for compatability with the legacy software.
+use types::SrpGroup;
+use num::BigUint;
+
+lazy_static! {
+ pub static ref G_1024: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/1024.bin")),
+ g: BigUint::from_bytes_be(&[2]),
+ };
+}
+
+lazy_static! {
+ pub static ref G_1536: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/1536.bin")),
+ g: BigUint::from_bytes_be(&[2]),
+ };
+}
+
+lazy_static! {
+ pub static ref G_2048: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/2048.bin")),
+ g: BigUint::from_bytes_be(&[2]),
+ };
+}
+
+lazy_static! {
+ pub static ref G_3072: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/3072.bin")),
+ g: BigUint::from_bytes_be(&[5]),
+ };
+}
+
+lazy_static! {
+ pub static ref G_4096: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/4096.bin")),
+ g: BigUint::from_bytes_be(&[5]),
+ };
+}
+
+lazy_static! {
+ pub static ref G_6144: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/6144.bin")),
+ g: BigUint::from_bytes_be(&[5]),
+ };
+}
+
+lazy_static! {
+ pub static ref G_8192: SrpGroup = SrpGroup {
+ n: BigUint::from_bytes_be(include_bytes!("groups/8192.bin")),
+ g: BigUint::from_bytes_be(&[19]),
+ };
+}