aboutsummaryrefslogtreecommitdiff
path: root/type.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-28 14:56:38 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-28 14:56:38 +0100
commitffe6e49220648a0b847e47e1072cf0b8d1b1f803 (patch)
tree52949a55f3d8b1ad1f214aa6e408c194ecf1eaba /type.go
parentcaca215c9516e8dc236a8510a6a5467c267d2331 (diff)
go fmt
Diffstat (limited to 'type.go')
-rw-r--r--type.go48
1 files changed, 24 insertions, 24 deletions
diff --git a/type.go b/type.go
index 729f54f..663ae3d 100644
--- a/type.go
+++ b/type.go
@@ -25,32 +25,32 @@ const (
// StItem references a versioned item based on a given format specifier.
type StItem struct {
- Format StFormat `tls:"maxval:65535"`
- SignedTreeHeadV1 *SignedTreeHeadV1 `tls:"selector:Format,val:1"`
- SignedDebugInfoV1 *SignedDebugInfoV1 `tls:"selector:Format,val:2"`
+ Format StFormat `tls:"maxval:65535"`
+ SignedTreeHeadV1 *SignedTreeHeadV1 `tls:"selector:Format,val:1"`
+ SignedDebugInfoV1 *SignedDebugInfoV1 `tls:"selector:Format,val:2"`
ConsistencyProofV1 *ConsistencyProofV1 `tls:"selector:Format,val:3"`
- InclusionProofV1 *InclusionProofV1 `tls:"selector:Format,val:4"`
- ChecksumV1 *ChecksumV1 `tls:"selector:Format,val:5"`
+ InclusionProofV1 *InclusionProofV1 `tls:"selector:Format,val:4"`
+ ChecksumV1 *ChecksumV1 `tls:"selector:Format,val:5"`
}
type ConsistencyProofV1 struct {
- LogId []byte `tls:"minlen:2,maxlen:127"`
- TreeSize1 uint64
- TreeSize2 uint64
+ LogId []byte `tls:"minlen:2,maxlen:127"`
+ TreeSize1 uint64
+ TreeSize2 uint64
ConsistencyPath []NodeHash `tls:"minlen:1,maxlen:65535"`
}
type SignedTreeHeadV1 struct {
- LogId []byte `tls:"minlen:2,maxlen:127"`
- TreeHead TreeHeadV1 `tls:minlen:0, maxlen:65535` // what should maxlen be?
- Signature []byte `tls:"minlen:0,maxlen:65535"`
+ LogId []byte `tls:"minlen:2,maxlen:127"`
+ TreeHead TreeHeadV1 `tls:minlen:0, maxlen:65535` // what should maxlen be?
+ Signature []byte `tls:"minlen:0,maxlen:65535"`
}
type TreeHeadV1 struct {
Timestamp uint64
- TreeSize uint64
- RootHash NodeHash `tls:minlen:32,maxlen:255`
- Extension []byte `tls:"minlen:0,maxlen:65535"`
+ TreeSize uint64
+ RootHash NodeHash `tls:minlen:32,maxlen:255`
+ Extension []byte `tls:"minlen:0,maxlen:65535"`
}
// ChecksumV1 associates a package name with an arbitrary checksum value
@@ -72,8 +72,8 @@ type InclusionProofV1 struct {
// TODO: double-check that crypto/ed25519 encodes signature as in RFC 8032
// TODO: need to think about signature format, then update markdown/api.md
type SignedDebugInfoV1 struct {
- LogId []byte `tls:"minlen:32,maxlen:127"`
- Message []byte `tls:"minlen:0,maxlen:65535"`
+ LogId []byte `tls:"minlen:32,maxlen:127"`
+ Message []byte `tls:"minlen:0,maxlen:65535"`
Signature []byte `tls:"minlen:0,maxlen:65535"` // defined in RFC 8032
}
@@ -86,8 +86,8 @@ func NewSignedTreeHeadV1(th TreeHeadV1, logId, signature []byte) StItem {
return StItem{
Format: StFormatSignedTreeHeadV1,
SignedTreeHeadV1: &SignedTreeHeadV1{
- LogId: logId,
- TreeHead: th,
+ LogId: logId,
+ TreeHead: th,
Signature: signature,
},
}
@@ -96,7 +96,7 @@ func NewSignedTreeHeadV1(th TreeHeadV1, logId, signature []byte) StItem {
func NewTreeHeadV1(timestamp, treeSize uint64, rootHash []byte) TreeHeadV1 {
return TreeHeadV1{
Timestamp: timestamp,
- TreeSize: treeSize,
+ TreeSize: treeSize,
RootHash: NodeHash{
Data: rootHash,
},
@@ -108,8 +108,8 @@ func NewSignedDebugInfoV1(logId, message, signature []byte) StItem {
return StItem{
Format: StFormatSignedDebugInfoV1,
SignedDebugInfoV1: &SignedDebugInfoV1{
- LogId: logId,
- Message: message,
+ LogId: logId,
+ Message: message,
Signature: signature,
},
}
@@ -153,9 +153,9 @@ func NewConsistencyProofV1(logId []byte, first, second int64, proof *trillian.Pr
return StItem{
Format: StFormatConsistencyProofV1,
ConsistencyProofV1: &ConsistencyProofV1{
- LogId: logId,
- TreeSize1: uint64(first),
- TreeSize2: uint64(second),
+ LogId: logId,
+ TreeSize1: uint64(first),
+ TreeSize2: uint64(second),
ConsistencyPath: path,
},
}