-
Notifications
You must be signed in to change notification settings - Fork 7
/
proofs.proto
122 lines (96 loc) · 3.27 KB
/
proofs.proto
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
option java_outer_classname = "Serialization";
option java_package = "edu.rice.historytree.generated";
// A configuration message for an aggregator. An aggobj generates a config blob, which
// is placed in this message along with its name.
/*
message AggConfig {
required string name = 1;
optional bytes configblob =2;
}
message Config {
required AggConfig aggconfig = 1;
required string valtype = 2;
}
*/
// For serializing a pruned tree.
message HistNode {
optional HistNode left = 1;
optional HistNode right = 2;
// Leaves must include either a value or an agg.
// Interior non-frozen never include a value or agg.
// Interior non-stubs never include a value or an agg.
// Interior frozen stubs include an agg.
optional bytes val = 3;
optional bytes agg = 4;
}
message PrunedTree {
optional int32 version = 1; // Optional for merkle tree, required for the history tree
required HistNode root = 2; // Root node.
}
/* What is the type of the tree in the signature?
Its either Merkle or History.
*/
enum SigTreeType {MESSAGE = 1; HISTORY_TREE = 2; MERKLE_TREE = 3; };
/* What is the type of proof blob that we have? At present, a merkle tree, history tree (containing a proof of ONE blob), or a single message.
*/
enum SignatureType {SINGLE_MESSAGE = 1;
SINGLE_HISTORY_TREE = 2;
SINGLE_MERKLE_TREE = 3;
};
// What is signed. (but is not sent)
message TreeSigMessage {
required SigTreeType treetype = 1;
optional int32 version = 3;
optional bytes roothash = 4; // Or datahash
}
// What is sent.
message TreeSigBlob {
// Overall type of this signature.
required SignatureType signature_type = 5;
// Borrowed from ProtocolSignature (google wave) for the low-level signature.
// Indicate how the 'TreeSigMessage' is signed.
enum SignatureAlgorithm {
UNKNOWN = 1; // Illegal
TEST_DIGEST = 2;
SHA1_RSA = 3;
SHA1_DSA = 4;
SHA256_RSA = 5;
SHA256_DSA = 6;
}
optional bytes signature_bytes = 1;
optional bytes signer_id = 2;
required SignatureAlgorithm signature_algorithm = 3 [default = UNKNOWN];
// Stuff set by bundled signatures.
optional PrunedTree tree = 6;
optional int32 leaf = 4; //Point out specific leafs.
// For a history tree, used to demultiplex
optional sfixed64 tree_id = 16;
repeated int32 splice_hint = 17;
}
// Denotes a message data being signed.
message MessageData {
// What is the timestamp on this message?
required int64 timestamp = 1;
// WHich users just started buffering (IE, don't authenticate?)
repeated int32 start_buffering_users = 2;
// WHich users just ended buffering (IE, authenticate em all NOW!!)
repeated int32 end_buffering_users = 3;
// Actual contents of the message. (The signature comes next *IF* this field exists
optional bytes message =4;
optional int32 recipient_user = 5;
}
////////////////
//////////////// Stream signature design.
////////////////
/*
message StreamBundle {
repeated int32 splicepoints=2; // Includes the end of the last epoch.
required Commitment commitment=3;
required bytes signature = 4;
}
// Represents a signature over a single version.
message SigBlob {
repeated int32 messageversion = 1;
required Commitment commitment = 2;
}
*/