From cde64154206fee0a978554fe06e61543e36b1ddb Mon Sep 17 00:00:00 2001 From: Wenqi Mou Date: Wed, 28 Aug 2024 14:32:33 -0400 Subject: [PATCH] minor --- pkg/encryptionpb/encryptionpb.pb.go | 558 ++++++++++------------------ proto/encryptionpb.proto | 21 +- scripts/proto.lock | 37 +- 3 files changed, 223 insertions(+), 393 deletions(-) diff --git a/pkg/encryptionpb/encryptionpb.pb.go b/pkg/encryptionpb/encryptionpb.pb.go index 61bf4ca7c..6f05c8956 100644 --- a/pkg/encryptionpb/encryptionpb.pb.go +++ b/pkg/encryptionpb/encryptionpb.pb.go @@ -905,10 +905,16 @@ type FileEncryptionInfo struct { // Types that are valid to be assigned to Mode: // *FileEncryptionInfo_PlainTextDataKey // *FileEncryptionInfo_MasterKeyBased - Mode isFileEncryptionInfo_Mode `protobuf_oneof:"mode"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Mode isFileEncryptionInfo_Mode `protobuf_oneof:"mode"` + // file encryption method + EncryptionMethod EncryptionMethod `protobuf:"varint,3,opt,name=encryption_method,json=encryptionMethod,proto3,enum=encryptionpb.EncryptionMethod" json:"encryption_method,omitempty"` + // iv to encrypt the file by data key + FileIv []byte `protobuf:"bytes,4,opt,name=file_iv,json=fileIv,proto3" json:"file_iv,omitempty"` + // file checksum after encryption, optional if using GCM + Checksum []byte `protobuf:"bytes,5,opt,name=checksum,proto3" json:"checksum,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *FileEncryptionInfo) Reset() { *m = FileEncryptionInfo{} } @@ -981,6 +987,27 @@ func (m *FileEncryptionInfo) GetMasterKeyBased() *MasterKeyBased { return nil } +func (m *FileEncryptionInfo) GetEncryptionMethod() EncryptionMethod { + if m != nil { + return m.EncryptionMethod + } + return EncryptionMethod_UNKNOWN +} + +func (m *FileEncryptionInfo) GetFileIv() []byte { + if m != nil { + return m.FileIv + } + return nil +} + +func (m *FileEncryptionInfo) GetChecksum() []byte { + if m != nil { + return m.Checksum + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*FileEncryptionInfo) XXX_OneofWrappers() []interface{} { return []interface{}{ @@ -992,12 +1019,6 @@ func (*FileEncryptionInfo) XXX_OneofWrappers() []interface{} { // not recommended in production. // user needs to pass back the same data key for restore. type PlainTextDataKey struct { - // iv to encrypt the file by data key - FileIv []byte `protobuf:"bytes,1,opt,name=file_iv,json=fileIv,proto3" json:"file_iv,omitempty"` - // file encryption method - EncryptionMethod EncryptionMethod `protobuf:"varint,2,opt,name=encryption_method,json=encryptionMethod,proto3,enum=encryptionpb.EncryptionMethod" json:"encryption_method,omitempty"` - // file checksum after encryption, optional if using GCM - Checksum []byte `protobuf:"bytes,3,opt,name=checksum,proto3" json:"checksum,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1036,39 +1057,12 @@ func (m *PlainTextDataKey) XXX_DiscardUnknown() { var xxx_messageInfo_PlainTextDataKey proto.InternalMessageInfo -func (m *PlainTextDataKey) GetFileIv() []byte { - if m != nil { - return m.FileIv - } - return nil -} - -func (m *PlainTextDataKey) GetEncryptionMethod() EncryptionMethod { - if m != nil { - return m.EncryptionMethod - } - return EncryptionMethod_UNKNOWN -} - -func (m *PlainTextDataKey) GetChecksum() []byte { - if m != nil { - return m.Checksum - } - return nil -} - type MasterKeyBased struct { // encrypted data key with metadata DataKeyEncryptedContent []*EncryptedContent `protobuf:"bytes,1,rep,name=data_key_encrypted_content,json=dataKeyEncryptedContent,proto3" json:"data_key_encrypted_content,omitempty"` - // iv to encrypt the file by data key - FileIv []byte `protobuf:"bytes,2,opt,name=file_iv,json=fileIv,proto3" json:"file_iv,omitempty"` - // file encryption method - EncryptionMethod EncryptionMethod `protobuf:"varint,3,opt,name=encryption_method,json=encryptionMethod,proto3,enum=encryptionpb.EncryptionMethod" json:"encryption_method,omitempty"` - // file checksum after encryption, optional if using GCM - Checksum []byte `protobuf:"bytes,4,opt,name=checksum,proto3" json:"checksum,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MasterKeyBased) Reset() { *m = MasterKeyBased{} } @@ -1111,27 +1105,6 @@ func (m *MasterKeyBased) GetDataKeyEncryptedContent() []*EncryptedContent { return nil } -func (m *MasterKeyBased) GetFileIv() []byte { - if m != nil { - return m.FileIv - } - return nil -} - -func (m *MasterKeyBased) GetEncryptionMethod() EncryptionMethod { - if m != nil { - return m.EncryptionMethod - } - return EncryptionMethod_UNKNOWN -} - -func (m *MasterKeyBased) GetChecksum() []byte { - if m != nil { - return m.Checksum - } - return nil -} - func init() { proto.RegisterEnum("encryptionpb.EncryptionMethod", EncryptionMethod_name, EncryptionMethod_value) proto.RegisterType((*EncryptionMeta)(nil), "encryptionpb.EncryptionMeta") @@ -1157,80 +1130,78 @@ func init() { func init() { proto.RegisterFile("encryptionpb.proto", fileDescriptor_a483860494a778a2) } var fileDescriptor_a483860494a778a2 = []byte{ - // 1159 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x6f, 0x1b, 0x55, - 0x14, 0xf6, 0xf8, 0x3d, 0xc7, 0x0f, 0xdc, 0x4b, 0xda, 0xb8, 0x2e, 0x32, 0xd6, 0x94, 0x82, 0x05, - 0xad, 0x51, 0x5d, 0x08, 0x2d, 0x08, 0x44, 0x93, 0x06, 0x6c, 0x99, 0xb8, 0xd1, 0x24, 0x05, 0x24, - 0x16, 0xa3, 0x9b, 0x99, 0x13, 0x7b, 0x64, 0xcf, 0x8c, 0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xff, 0x57, - 0x7c, 0xeb, 0x7a, 0x5b, 0x0a, 0x00, 0x00, + // 1135 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x49, 0x6f, 0x23, 0x45, + 0x14, 0x76, 0x3b, 0xde, 0xfa, 0x79, 0xc1, 0x53, 0x64, 0xf1, 0x38, 0xc8, 0x58, 0x3d, 0x0c, 0x58, + 0x30, 0x63, 0x34, 0x1e, 0x08, 0x33, 0x20, 0x10, 0x49, 0x26, 0x60, 0xcb, 0xc4, 0x13, 0x75, 0x32, + 0x80, 0xc4, 0xa1, 0x55, 0xe9, 0x7e, 0xb1, 0x5b, 0x76, 0x77, 0x5b, 0xdd, 0x65, 0x27, 0xe6, 0x97, + 0xc0, 0x11, 0x4e, 0xfc, 0x05, 0xc4, 0x85, 0x23, 0x47, 0x2e, 0x48, 0x1c, 0x51, 0xb8, 0xf0, 0x33, + 0x50, 0x2d, 0x5e, 0x3a, 0x0b, 0x62, 0x4e, 0xae, 0xb7, 0x7c, 0xaf, 0xeb, 0x7d, 0x55, 0xef, 0x2b, + 0x03, 0x41, 0xdf, 0x0e, 0x67, 0x63, 0xe6, 0x06, 0xfe, 0xf8, 0xb4, 0x39, 0x0e, 0x03, 0x16, 0x90, + 0xc2, 0xaa, 0xaf, 0xba, 0xde, 0x0f, 0xfa, 0x81, 0x08, 0xbc, 0xcb, 0x57, 0x32, 0xa7, 0xfa, 0x4a, + 0x38, 0x89, 0x98, 0x58, 0x4a, 0x87, 0xf1, 0x01, 0x94, 0x0e, 0x16, 0xb0, 0x43, 0x64, 0x94, 0x6c, + 0x40, 0x66, 0x88, 0x33, 0xcb, 0x75, 0x2a, 0x5a, 0x5d, 0x6b, 0xa4, 0xcc, 0xf4, 0x10, 0x67, 0x1d, + 0x87, 0x94, 0x20, 0xe9, 0x4e, 0x2b, 0xc9, 0xba, 0xd6, 0x28, 0x98, 0x49, 0x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xca, 0x69, 0xbf, + 0x5d, 0xd6, 0xb4, 0xdf, 0x2f, 0x6b, 0xda, 0x5f, 0x97, 0x35, 0xed, 0xbb, 0xbf, 0x6b, 0x09, 0x28, + 0x07, 0x61, 0xbf, 0xc9, 0xdc, 0xe1, 0xb4, 0x39, 0x9c, 0x8a, 0x7f, 0x61, 0xa7, 0x19, 0xf1, 0xf3, + 0xf8, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x62, 0x5d, 0xc5, 0xd7, 0x09, 0x00, 0x00, } func (m *EncryptionMeta) Marshal() (dAtA []byte, err error) { @@ -1947,6 +1918,25 @@ func (m *FileEncryptionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x2a + } + if len(m.FileIv) > 0 { + i -= len(m.FileIv) + copy(dAtA[i:], m.FileIv) + i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.FileIv))) + i-- + dAtA[i] = 0x22 + } + if m.EncryptionMethod != 0 { + i = encodeVarintEncryptionpb(dAtA, i, uint64(m.EncryptionMethod)) + i-- + dAtA[i] = 0x18 + } if m.Mode != nil { { size := m.Mode.Size() @@ -2025,25 +2015,6 @@ func (m *PlainTextDataKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Checksum) > 0 { - i -= len(m.Checksum) - copy(dAtA[i:], m.Checksum) - i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.Checksum))) - i-- - dAtA[i] = 0x1a - } - if m.EncryptionMethod != 0 { - i = encodeVarintEncryptionpb(dAtA, i, uint64(m.EncryptionMethod)) - i-- - dAtA[i] = 0x10 - } - if len(m.FileIv) > 0 { - i -= len(m.FileIv) - copy(dAtA[i:], m.FileIv) - i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.FileIv))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } @@ -2071,25 +2042,6 @@ func (m *MasterKeyBased) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Checksum) > 0 { - i -= len(m.Checksum) - copy(dAtA[i:], m.Checksum) - i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.Checksum))) - i-- - dAtA[i] = 0x22 - } - if m.EncryptionMethod != 0 { - i = encodeVarintEncryptionpb(dAtA, i, uint64(m.EncryptionMethod)) - i-- - dAtA[i] = 0x18 - } - if len(m.FileIv) > 0 { - i -= len(m.FileIv) - copy(dAtA[i:], m.FileIv) - i = encodeVarintEncryptionpb(dAtA, i, uint64(len(m.FileIv))) - i-- - dAtA[i] = 0x12 - } if len(m.DataKeyEncryptedContent) > 0 { for iNdEx := len(m.DataKeyEncryptedContent) - 1; iNdEx >= 0; iNdEx-- { { @@ -2465,6 +2417,17 @@ func (m *FileEncryptionInfo) Size() (n int) { if m.Mode != nil { n += m.Mode.Size() } + if m.EncryptionMethod != 0 { + n += 1 + sovEncryptionpb(uint64(m.EncryptionMethod)) + } + l = len(m.FileIv) + if l > 0 { + n += 1 + l + sovEncryptionpb(uint64(l)) + } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovEncryptionpb(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2501,17 +2464,6 @@ func (m *PlainTextDataKey) Size() (n int) { } var l int _ = l - l = len(m.FileIv) - if l > 0 { - n += 1 + l + sovEncryptionpb(uint64(l)) - } - if m.EncryptionMethod != 0 { - n += 1 + sovEncryptionpb(uint64(m.EncryptionMethod)) - } - l = len(m.Checksum) - if l > 0 { - n += 1 + l + sovEncryptionpb(uint64(l)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2530,17 +2482,6 @@ func (m *MasterKeyBased) Size() (n int) { n += 1 + l + sovEncryptionpb(uint64(l)) } } - l = len(m.FileIv) - if l > 0 { - n += 1 + l + sovEncryptionpb(uint64(l)) - } - if m.EncryptionMethod != 0 { - n += 1 + sovEncryptionpb(uint64(m.EncryptionMethod)) - } - l = len(m.Checksum) - if l > 0 { - n += 1 + l + sovEncryptionpb(uint64(l)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -4667,58 +4608,26 @@ func (m *FileEncryptionInfo) Unmarshal(dAtA []byte) error { } m.Mode = &FileEncryptionInfo_MasterKeyBased{v} iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEncryptionpb(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEncryptionpb - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PlainTextDataKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEncryptionpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EncryptionMethod", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + m.EncryptionMethod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEncryptionpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EncryptionMethod |= EncryptionMethod(b&0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PlainTextDataKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PlainTextDataKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FileIv", wireType) } @@ -4752,26 +4661,7 @@ func (m *PlainTextDataKey) Unmarshal(dAtA []byte) error { m.FileIv = []byte{} } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionMethod", wireType) - } - m.EncryptionMethod = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEncryptionpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EncryptionMethod |= EncryptionMethod(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) } @@ -4827,6 +4717,57 @@ func (m *PlainTextDataKey) Unmarshal(dAtA []byte) error { } return nil } +func (m *PlainTextDataKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEncryptionpb + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PlainTextDataKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PlainTextDataKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipEncryptionpb(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEncryptionpb + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MasterKeyBased) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4890,93 +4831,6 @@ func (m *MasterKeyBased) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FileIv", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEncryptionpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthEncryptionpb - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthEncryptionpb - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FileIv = append(m.FileIv[:0], dAtA[iNdEx:postIndex]...) - if m.FileIv == nil { - m.FileIv = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionMethod", wireType) - } - m.EncryptionMethod = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEncryptionpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EncryptionMethod |= EncryptionMethod(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEncryptionpb - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthEncryptionpb - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthEncryptionpb - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checksum = append(m.Checksum[:0], dAtA[iNdEx:postIndex]...) - if m.Checksum == nil { - m.Checksum = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEncryptionpb(dAtA[iNdEx:]) diff --git a/proto/encryptionpb.proto b/proto/encryptionpb.proto index 70147a0c2..af03b9d66 100644 --- a/proto/encryptionpb.proto +++ b/proto/encryptionpb.proto @@ -143,26 +143,19 @@ message FileEncryptionInfo { PlainTextDataKey plain_text_data_key = 1; MasterKeyBased master_key_based = 2; } + // file encryption method + encryptionpb.EncryptionMethod encryption_method = 3; + // iv to encrypt the file by data key + bytes file_iv = 4; + // file checksum after encryption, optional if using GCM + bytes checksum = 5; } // not recommended in production. // user needs to pass back the same data key for restore. -message PlainTextDataKey { - // iv to encrypt the file by data key - bytes file_iv = 1; - // file encryption method - encryptionpb.EncryptionMethod encryption_method = 2; - // file checksum after encryption, optional if using GCM - bytes checksum = 3; -} +message PlainTextDataKey {} message MasterKeyBased { // encrypted data key with metadata repeated encryptionpb.EncryptedContent data_key_encrypted_content = 1; - // iv to encrypt the file by data key - bytes file_iv = 2; - // file encryption method - encryptionpb.EncryptionMethod encryption_method = 3; - // file checksum after encryption, optional if using GCM - bytes checksum = 4; } diff --git a/scripts/proto.lock b/scripts/proto.lock index d3f292792..48ada7771 100644 --- a/scripts/proto.lock +++ b/scripts/proto.lock @@ -5526,29 +5526,27 @@ "name": "master_key_based", "type": "MasterKeyBased", "oneof_parent": "mode" - } - ] - }, - { - "name": "PlainTextDataKey", - "fields": [ - { - "id": 1, - "name": "file_iv", - "type": "bytes" }, { - "id": 2, + "id": 3, "name": "encryption_method", "type": "encryptionpb.EncryptionMethod" }, { - "id": 3, + "id": 4, + "name": "file_iv", + "type": "bytes" + }, + { + "id": 5, "name": "checksum", "type": "bytes" } ] }, + { + "name": "PlainTextDataKey" + }, { "name": "MasterKeyBased", "fields": [ @@ -5557,21 +5555,6 @@ "name": "data_key_encrypted_content", "type": "encryptionpb.EncryptedContent", "is_repeated": true - }, - { - "id": 2, - "name": "file_iv", - "type": "bytes" - }, - { - "id": 3, - "name": "encryption_method", - "type": "encryptionpb.EncryptionMethod" - }, - { - "id": 4, - "name": "checksum", - "type": "bytes" } ] }