1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(doc, forbid(warnings))]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/xaynetwork/xaynet/master/assets/xaynet_banner.png",
html_favicon_url = "https://raw.githubusercontent.com/xaynetwork/xaynet/master/assets/favicon.png",
issue_tracker_base_url = "https://github.com/xaynetwork/xaynet/issues"
)]
pub mod common;
pub mod crypto;
pub mod mask;
pub mod message;
#[cfg(any(feature = "testutils", test))]
#[cfg_attr(docsrs, doc(cfg(feature = "testutils")))]
pub mod testutils;
use std::collections::HashMap;
use thiserror::Error;
use self::crypto::{
encrypt::{PublicEncryptKey, SecretEncryptKey},
sign::{PublicSigningKey, SecretSigningKey, Signature},
};
#[derive(Error, Debug)]
#[error("initialization failed: insufficient system entropy to generate secrets")]
pub struct InitError;
pub type CoordinatorPublicKey = PublicEncryptKey;
pub type CoordinatorSecretKey = SecretEncryptKey;
pub type ParticipantPublicKey = PublicSigningKey;
pub type ParticipantSecretKey = SecretSigningKey;
pub type SumParticipantPublicKey = ParticipantPublicKey;
pub type SumParticipantSecretKey = ParticipantSecretKey;
pub type SumParticipantEphemeralPublicKey = PublicEncryptKey;
pub type SumParticipantEphemeralSecretKey = SecretEncryptKey;
pub type UpdateParticipantPublicKey = ParticipantPublicKey;
pub type UpdateParticipantSecretKey = ParticipantSecretKey;
pub type ParticipantTaskSignature = Signature;
pub type SumDict = HashMap<SumParticipantPublicKey, SumParticipantEphemeralPublicKey>;
pub type LocalSeedDict = HashMap<SumParticipantPublicKey, mask::seed::EncryptedMaskSeed>;
pub type SeedDict = HashMap<SumParticipantPublicKey, UpdateSeedDict>;
pub type UpdateSeedDict = HashMap<UpdateParticipantPublicKey, mask::seed::EncryptedMaskSeed>;