/
Token.cs
60 lines (54 loc) · 1.98 KB
/
Token.cs
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
namespace Noise
{
/// <summary>
/// The smallest unit of the Noise handshake language.
/// </summary>
public enum Token
{
/// <summary>
/// The sender generates a new ephemeral key pair and stores
/// it in the e variable, writes the ephemeral public key as
/// cleartext into the message buffer, and hashes the public
/// key along with the old h to derive a new h.
/// </summary>
E,
/// <summary>
/// The sender writes its static public key from the s variable
/// into the message buffer, encrypting it if k is non-empty,
/// and hashes the output along with the old h to derive a new h.
/// </summary>
S,
/// <summary>
/// A DH is performed between the initiator's ephemeral private key and
/// the responder's ephemeral public key. The result is hashed along
/// with the old ck to derive a new ck and k, and n is set to zero.
/// </summary>
EE,
/// <summary>
/// A DH is performed between the initiator's static private key and
/// the responder's ephemeral public key. The result is hashed along
/// with the old ck to derive a new ck and k, and n is set to zero.
/// </summary>
SE,
/// <summary>
/// A DH is performed between the initiator's ephemeral private key and
/// the responder's static public key. The result is hashed along
/// with the old ck to derive a new ck and k, and n is set to zero.
/// </summary>
ES,
/// <summary>
/// A DH is performed between the initiator's static private key and
/// the responder's static public key. The result is hashed along
/// with the old ck to derive a new ck and k, and n is set to zero.
/// </summary>
SS,
/// <summary>
/// Noise provides a pre-shared symmetric key or PSK mode to support
/// protocols where both parties have a 32-byte shared secret key.
/// In a PSK handshake, a "psk" token is allowed to appear one or
/// more times in a handshake pattern. This token can only appear
/// in message patterns (not pre-message patterns).
/// </summary>
PSK
}
}