Added docstring to protobuf file

This commit is contained in:
Sudhi Herle 2020-02-15 11:15:38 -08:00
parent 1cd3a94180
commit 36410626dd
3 changed files with 19 additions and 1 deletions

View file

@ -25,6 +25,11 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
//
// Every encrypted file starts with a header describing the
// Block Size, Salt, Recipient keys etc. Header represents a
// decoded version of this information. It is encoded in
// protobuf format before writing to disk.
type Header struct { type Header struct {
ChunkSize uint32 `protobuf:"varint,1,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"` ChunkSize uint32 `protobuf:"varint,1,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"`
Salt []byte `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"` Salt []byte `protobuf:"bytes,2,opt,name=salt,proto3" json:"salt,omitempty"`
@ -84,6 +89,9 @@ func (m *Header) GetKeys() []*WrappedKey {
return nil return nil
} }
//
// A file encryption key is wrapped by a recipient specific public
// key. WrappedKey describes such a wrapped key.
type WrappedKey struct { type WrappedKey struct {
PkHash []byte `protobuf:"bytes,1,opt,name=pk_hash,json=pkHash,proto3" json:"pk_hash,omitempty"` PkHash []byte `protobuf:"bytes,1,opt,name=pk_hash,json=pkHash,proto3" json:"pk_hash,omitempty"`
Pk []byte `protobuf:"bytes,2,opt,name=pk,proto3" json:"pk,omitempty"` Pk []byte `protobuf:"bytes,2,opt,name=pk,proto3" json:"pk,omitempty"`

View file

@ -9,12 +9,22 @@ package sign;
//option (gogoproto.unmarshaler_all) = true; //option (gogoproto.unmarshaler_all) = true;
//option (gogoproto.goproto_getters_all) = false; //option (gogoproto.goproto_getters_all) = false;
/*
* Every encrypted file starts with a header describing the
* Block Size, Salt, Recipient keys etc. Header represents a
* decoded version of this information. It is encoded in
* protobuf format before writing to disk.
*/
message header { message header {
uint32 chunk_size = 1; uint32 chunk_size = 1;
bytes salt = 2; bytes salt = 2;
repeated wrapped_key keys = 3; repeated wrapped_key keys = 3;
} }
/*
* A file encryption key is wrapped by a recipient specific public
* key. WrappedKey describes such a wrapped key.
*/
message wrapped_key { message wrapped_key {
bytes pk_hash = 1; // hash of Ed25519 PK bytes pk_hash = 1; // hash of Ed25519 PK
bytes pk = 2; // curve25519 PK bytes pk = 2; // curve25519 PK

View file

@ -1 +1 @@
0.9.0 0.9.1