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
mod newhope;
pub use self::newhope::{ NewHope, PrivateKey, PublicKey, Reconciliation };
pub trait KeyExchange {
type PrivateKey;
type PublicKey;
type Reconciliation;
fn sk_length() -> usize;
fn pk_length() -> usize;
fn rec_length() -> usize;
fn keygen() -> (Self::PrivateKey, Self::PublicKey);
fn exchange(sharedkey: &mut [u8], pk: &Self::PublicKey) -> Self::Reconciliation;
fn exchange_from(sharedkey: &mut [u8], sk: &Self::PrivateKey, rec: &Self::Reconciliation);
}