This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
struct.go
58 lines (50 loc) · 1.73 KB
/
struct.go
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
package dpcc
import (
"go.dedis.ch/kyber/v3"
"go.dedis.ch/onet/v3"
"go.dedis.ch/onet/v3/network"
)
// We need to register all messages so the network knows how to handle them.
func init() {
network.RegisterMessages(HashPublicRequest{}, HashPublicResponse{})
network.RegisterMessages(HashPrivateRequest{}, HashPrivateResponse{})
}
// HashPublicRequest is used by the client to send a request of a hash public
// protocol to the leader of the roster
type HashPublicRequest struct {
Roster *onet.Roster
URL string
Nonce []byte
}
// HashPublicSingleResponse is a helper for HashPublicResponse and stores the
// response of a single worker in the roster for the hash public protocol
type HashPublicSingleResponse struct {
PubliKey kyber.Point
Hash []byte
Signature []byte
}
// HashPublicResponse is used by the leader of the protocol to send the results
// of the hash public protocol to the client
type HashPublicResponse struct {
Responses map[string]*HashPublicSingleResponse
}
// HashPrivateRequest is used by the client to send a request of a hash private
// protocol to the leader of the roster
type HashPrivateRequest struct {
Roster *onet.Roster
URL string
ClientPublicKeys map[string]kyber.Point
}
// HashPrivateSingleResponse is a helper for HashPrivateResponse and stores the
// response of a single worker in the roster of the hash private protocol
type HashPrivateSingleResponse struct {
PublicKey kyber.Point
EncryptedHash []byte
Nonce []byte
}
// HashPrivateResponse is used by the leader of the protocol to send the
// results of the hash private protocol back to the client
type HashPrivateResponse struct {
Hashes map[string][]byte
Responses map[string]*HashPrivateSingleResponse
}