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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Copyright (c) Silence Laboratories Pte. Ltd. All Rights Reserved.
// This software is licensed under the Silence Laboratories License Agreement.
//! This module defines all the constants used throughout the DKG protocol,
//! including message tags, labels for cryptographic operations, and protocol-specific
//! identifiers. These constants ensure consistent message handling and cryptographic
//! operations across all protocol participants.
use crateVERSION;
use MessageTag;
use Label;
/// Label used for the key generation protocol.
/// This label is used to derive protocol-specific keys and nonces.
pub const DKG_LABEL: Label = new;
/// Label used for the first commitment in the protocol.
/// This commitment is used to ensure participants are bound to their initial values.
pub const COMMITMENT_1_LABEL: Label = new;
/// Label used for the second commitment in the protocol.
/// This commitment is used to ensure participants are bound to their final values.
pub const COMMITMENT_2_LABEL: Label = new;
/// Label used for the first discrete logarithm proof.
/// This proof ensures the validity of certain cryptographic operations.
pub const DLOG_PROOF1_LABEL: Label = new;
/// Label used for the second discrete logarithm proof.
/// This proof ensures the validity of certain cryptographic operations.
pub const DLOG_PROOF2_LABEL: Label = new;
/// Label used to create a discrete logarithm session ID from the final session ID and root chain code.
/// This is used to ensure proper session management and key derivation.
pub const DLOG_SESSION_ID_WITH_CHAIN_CODE: Label = new;
/// Label used for the quorum change protocol.
/// This label is used to derive protocol-specific keys and nonces for quorum changes.
pub const QC_LABEL: Label = new;
/// Label used for the first commitment in the quorum change protocol.
/// This commitment is used to ensure participants are bound to their initial values.
pub const QC_COMMITMENT_1_LABEL: Label = new;
/// Label used for the second commitment in the quorum change protocol.
/// This commitment is used to ensure participants are bound to their final values.
pub const QC_COMMITMENT_2_LABEL: Label = new;
/// Message tag for the first round of the DKG protocol.
/// This message contains initial commitments and setup information.
pub const DKG_MSG_R1: MessageTag = tag;
/// Message tag for the second round of the DKG protocol.
/// This message contains responses to the initial commitments.
pub const DKG_MSG_R2: MessageTag = tag;
/// Message tag for the first round of oblivious transfer in the DKG protocol.
/// This message is sent peer-to-peer between participants.
pub const DKG_MSG_OT1: MessageTag = tag;
/// Message tag for the third round of the DKG protocol.
/// This message contains final commitments and proofs.
pub const DKG_MSG_R3: MessageTag = tag;
/// Message tag for the fourth round of the DKG protocol.
/// This message contains the final key shares and verification information.
pub const DKG_MSG_R4: MessageTag = tag;
/// Message tag for the initial round of the quorum change protocol.
/// This message contains the request to change the quorum.
pub const QC_MSG_R0: MessageTag = tag;
/// Message tag for the first round of the quorum change protocol.
/// This message contains initial commitments for the quorum change.
pub const QC_MSG_R1: MessageTag = tag;
/// Message tag for the second round of the quorum change protocol.
/// This message contains responses to the quorum change commitments.
pub const QC_MSG_R2: MessageTag = tag;
/// Message tag for the first peer-to-peer message in the quorum change protocol.
/// This message is sent directly between participants.
pub const QC_MSG_P2P_1: MessageTag = tag;
/// Message tag for the second peer-to-peer message in the quorum change protocol.
/// This message is sent directly between participants.
pub const QC_MSG_P2P_2: MessageTag = tag;
/// Message tag for the first oblivious transfer message in the quorum change protocol.
/// This message is used for secure information exchange.
pub const QC_MSG_OT1: MessageTag = tag;
/// Message tag for the second oblivious transfer message in the quorum change protocol.
/// This message is used for secure information exchange.
pub const QC_MSG_OT2: MessageTag = tag;
/// Message tag used to communicate the final result of a keyshare creation or update operation.
/// This message is sent after all protocol rounds are complete.
pub const DKG_RECONCILE: MessageTag = tag;
/// First available message tag for user applications.
///
/// Applications should use `MessageTag::tag2(DKG_MSG_APP, app-specific-value)` to create
/// application-specific message tags. This ensures tags don't conflict with protocol messages.
///
/// The value is set to `u32::MAX - 1` to avoid potential conflicts with `ABORT_MESSAGE_TAG`
/// which is equal to `MessageTag::tag2(u32::MAX, u32::MAX)`.
pub const DKG_MSG_APP: u32 = u32MAX - 1;