// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: proto/crypto/keys/types.proto
|
|
|
|
package keys
|
|
|
|
import (
|
|
bytes "bytes"
|
|
fmt "fmt"
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
math "math"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type PublicKey struct {
|
|
// Types that are valid to be assigned to Sum:
|
|
// *PublicKey_Ed25519
|
|
Sum isPublicKey_Sum `protobuf_oneof:"sum"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *PublicKey) Reset() { *m = PublicKey{} }
|
|
func (m *PublicKey) String() string { return proto.CompactTextString(m) }
|
|
func (*PublicKey) ProtoMessage() {}
|
|
func (*PublicKey) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_943d79b57ec0188f, []int{0}
|
|
}
|
|
func (m *PublicKey) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_PublicKey.Unmarshal(m, b)
|
|
}
|
|
func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_PublicKey.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *PublicKey) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_PublicKey.Merge(m, src)
|
|
}
|
|
func (m *PublicKey) XXX_Size() int {
|
|
return xxx_messageInfo_PublicKey.Size(m)
|
|
}
|
|
func (m *PublicKey) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_PublicKey.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_PublicKey proto.InternalMessageInfo
|
|
|
|
type isPublicKey_Sum interface {
|
|
isPublicKey_Sum()
|
|
Equal(interface{}) bool
|
|
Compare(interface{}) int
|
|
}
|
|
|
|
type PublicKey_Ed25519 struct {
|
|
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"`
|
|
}
|
|
|
|
func (*PublicKey_Ed25519) isPublicKey_Sum() {}
|
|
|
|
func (m *PublicKey) GetSum() isPublicKey_Sum {
|
|
if m != nil {
|
|
return m.Sum
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PublicKey) GetEd25519() []byte {
|
|
if x, ok := m.GetSum().(*PublicKey_Ed25519); ok {
|
|
return x.Ed25519
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofWrappers is for the internal use of the proto package.
|
|
func (*PublicKey) XXX_OneofWrappers() []interface{} {
|
|
return []interface{}{
|
|
(*PublicKey_Ed25519)(nil),
|
|
}
|
|
}
|
|
|
|
// WARNING PrivateKey is used for internal purposes only
|
|
type PrivateKey struct {
|
|
// Types that are valid to be assigned to Sum:
|
|
// *PrivateKey_Ed25519
|
|
Sum isPrivateKey_Sum `protobuf_oneof:"sum"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *PrivateKey) Reset() { *m = PrivateKey{} }
|
|
func (m *PrivateKey) String() string { return proto.CompactTextString(m) }
|
|
func (*PrivateKey) ProtoMessage() {}
|
|
func (*PrivateKey) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_943d79b57ec0188f, []int{1}
|
|
}
|
|
func (m *PrivateKey) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_PrivateKey.Unmarshal(m, b)
|
|
}
|
|
func (m *PrivateKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_PrivateKey.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *PrivateKey) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_PrivateKey.Merge(m, src)
|
|
}
|
|
func (m *PrivateKey) XXX_Size() int {
|
|
return xxx_messageInfo_PrivateKey.Size(m)
|
|
}
|
|
func (m *PrivateKey) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_PrivateKey.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_PrivateKey proto.InternalMessageInfo
|
|
|
|
type isPrivateKey_Sum interface {
|
|
isPrivateKey_Sum()
|
|
Equal(interface{}) bool
|
|
Compare(interface{}) int
|
|
}
|
|
|
|
type PrivateKey_Ed25519 struct {
|
|
Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"`
|
|
}
|
|
|
|
func (*PrivateKey_Ed25519) isPrivateKey_Sum() {}
|
|
|
|
func (m *PrivateKey) GetSum() isPrivateKey_Sum {
|
|
if m != nil {
|
|
return m.Sum
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PrivateKey) GetEd25519() []byte {
|
|
if x, ok := m.GetSum().(*PrivateKey_Ed25519); ok {
|
|
return x.Ed25519
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// XXX_OneofWrappers is for the internal use of the proto package.
|
|
func (*PrivateKey) XXX_OneofWrappers() []interface{} {
|
|
return []interface{}{
|
|
(*PrivateKey_Ed25519)(nil),
|
|
}
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*PublicKey)(nil), "tendermint.proto.crypto.keys.PublicKey")
|
|
proto.RegisterType((*PrivateKey)(nil), "tendermint.proto.crypto.keys.PrivateKey")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("proto/crypto/keys/types.proto", fileDescriptor_943d79b57ec0188f) }
|
|
|
|
var fileDescriptor_943d79b57ec0188f = []byte{
|
|
// 190 bytes of a gzipped File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16, 0x32,
|
|
0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x99, 0x5e, 0xad, 0xbd, 0x10, 0x01, 0x00, 0x00,
|
|
}
|
|
|
|
func (this *PublicKey) Compare(that interface{}) int {
|
|
if that == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
}
|
|
|
|
that1, ok := that.(*PublicKey)
|
|
if !ok {
|
|
that2, ok := that.(PublicKey)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return 1
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
} else if this == nil {
|
|
return -1
|
|
}
|
|
if that1.Sum == nil {
|
|
if this.Sum != nil {
|
|
return 1
|
|
}
|
|
} else if this.Sum == nil {
|
|
return -1
|
|
} else {
|
|
thisType := -1
|
|
switch this.Sum.(type) {
|
|
case *PublicKey_Ed25519:
|
|
thisType = 0
|
|
default:
|
|
panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum))
|
|
}
|
|
that1Type := -1
|
|
switch that1.Sum.(type) {
|
|
case *PublicKey_Ed25519:
|
|
that1Type = 0
|
|
default:
|
|
panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum))
|
|
}
|
|
if thisType == that1Type {
|
|
if c := this.Sum.Compare(that1.Sum); c != 0 {
|
|
return c
|
|
}
|
|
} else if thisType < that1Type {
|
|
return -1
|
|
} else if thisType > that1Type {
|
|
return 1
|
|
}
|
|
}
|
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
|
return c
|
|
}
|
|
return 0
|
|
}
|
|
func (this *PublicKey_Ed25519) Compare(that interface{}) int {
|
|
if that == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
}
|
|
|
|
that1, ok := that.(*PublicKey_Ed25519)
|
|
if !ok {
|
|
that2, ok := that.(PublicKey_Ed25519)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return 1
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
} else if this == nil {
|
|
return -1
|
|
}
|
|
if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 {
|
|
return c
|
|
}
|
|
return 0
|
|
}
|
|
func (this *PrivateKey) Compare(that interface{}) int {
|
|
if that == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
}
|
|
|
|
that1, ok := that.(*PrivateKey)
|
|
if !ok {
|
|
that2, ok := that.(PrivateKey)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return 1
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
} else if this == nil {
|
|
return -1
|
|
}
|
|
if that1.Sum == nil {
|
|
if this.Sum != nil {
|
|
return 1
|
|
}
|
|
} else if this.Sum == nil {
|
|
return -1
|
|
} else {
|
|
thisType := -1
|
|
switch this.Sum.(type) {
|
|
case *PrivateKey_Ed25519:
|
|
thisType = 0
|
|
default:
|
|
panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum))
|
|
}
|
|
that1Type := -1
|
|
switch that1.Sum.(type) {
|
|
case *PrivateKey_Ed25519:
|
|
that1Type = 0
|
|
default:
|
|
panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum))
|
|
}
|
|
if thisType == that1Type {
|
|
if c := this.Sum.Compare(that1.Sum); c != 0 {
|
|
return c
|
|
}
|
|
} else if thisType < that1Type {
|
|
return -1
|
|
} else if thisType > that1Type {
|
|
return 1
|
|
}
|
|
}
|
|
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
|
|
return c
|
|
}
|
|
return 0
|
|
}
|
|
func (this *PrivateKey_Ed25519) Compare(that interface{}) int {
|
|
if that == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
}
|
|
|
|
that1, ok := that.(*PrivateKey_Ed25519)
|
|
if !ok {
|
|
that2, ok := that.(PrivateKey_Ed25519)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return 1
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
if this == nil {
|
|
return 0
|
|
}
|
|
return 1
|
|
} else if this == nil {
|
|
return -1
|
|
}
|
|
if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 {
|
|
return c
|
|
}
|
|
return 0
|
|
}
|
|
func (this *PublicKey) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
return this == nil
|
|
}
|
|
|
|
that1, ok := that.(*PublicKey)
|
|
if !ok {
|
|
that2, ok := that.(PublicKey)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
return this == nil
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if that1.Sum == nil {
|
|
if this.Sum != nil {
|
|
return false
|
|
}
|
|
} else if this.Sum == nil {
|
|
return false
|
|
} else if !this.Sum.Equal(that1.Sum) {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *PublicKey_Ed25519) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
return this == nil
|
|
}
|
|
|
|
that1, ok := that.(*PublicKey_Ed25519)
|
|
if !ok {
|
|
that2, ok := that.(PublicKey_Ed25519)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
return this == nil
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.Ed25519, that1.Ed25519) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *PrivateKey) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
return this == nil
|
|
}
|
|
|
|
that1, ok := that.(*PrivateKey)
|
|
if !ok {
|
|
that2, ok := that.(PrivateKey)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
return this == nil
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if that1.Sum == nil {
|
|
if this.Sum != nil {
|
|
return false
|
|
}
|
|
} else if this.Sum == nil {
|
|
return false
|
|
} else if !this.Sum.Equal(that1.Sum) {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func (this *PrivateKey_Ed25519) Equal(that interface{}) bool {
|
|
if that == nil {
|
|
return this == nil
|
|
}
|
|
|
|
that1, ok := that.(*PrivateKey_Ed25519)
|
|
if !ok {
|
|
that2, ok := that.(PrivateKey_Ed25519)
|
|
if ok {
|
|
that1 = &that2
|
|
} else {
|
|
return false
|
|
}
|
|
}
|
|
if that1 == nil {
|
|
return this == nil
|
|
} else if this == nil {
|
|
return false
|
|
}
|
|
if !bytes.Equal(this.Ed25519, that1.Ed25519) {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
func NewPopulatedPublicKey(r randyTypes, easy bool) *PublicKey {
|
|
this := &PublicKey{}
|
|
oneofNumber_Sum := []int32{1}[r.Intn(1)]
|
|
switch oneofNumber_Sum {
|
|
case 1:
|
|
this.Sum = NewPopulatedPublicKey_Ed25519(r, easy)
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
this.XXX_unrecognized = randUnrecognizedTypes(r, 2)
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedPublicKey_Ed25519(r randyTypes, easy bool) *PublicKey_Ed25519 {
|
|
this := &PublicKey_Ed25519{}
|
|
v1 := r.Intn(100)
|
|
this.Ed25519 = make([]byte, v1)
|
|
for i := 0; i < v1; i++ {
|
|
this.Ed25519[i] = byte(r.Intn(256))
|
|
}
|
|
return this
|
|
}
|
|
func NewPopulatedPrivateKey(r randyTypes, easy bool) *PrivateKey {
|
|
this := &PrivateKey{}
|
|
oneofNumber_Sum := []int32{1}[r.Intn(1)]
|
|
switch oneofNumber_Sum {
|
|
case 1:
|
|
this.Sum = NewPopulatedPrivateKey_Ed25519(r, easy)
|
|
}
|
|
if !easy && r.Intn(10) != 0 {
|
|
this.XXX_unrecognized = randUnrecognizedTypes(r, 2)
|
|
}
|
|
return this
|
|
}
|
|
|
|
func NewPopulatedPrivateKey_Ed25519(r randyTypes, easy bool) *PrivateKey_Ed25519 {
|
|
this := &PrivateKey_Ed25519{}
|
|
v2 := r.Intn(100)
|
|
this.Ed25519 = make([]byte, v2)
|
|
for i := 0; i < v2; i++ {
|
|
this.Ed25519[i] = byte(r.Intn(256))
|
|
}
|
|
return this
|
|
}
|
|
|
|
type randyTypes interface {
|
|
Float32() float32
|
|
Float64() float64
|
|
Int63() int64
|
|
Int31() int32
|
|
Uint32() uint32
|
|
Intn(n int) int
|
|
}
|
|
|
|
func randUTF8RuneTypes(r randyTypes) rune {
|
|
ru := r.Intn(62)
|
|
if ru < 10 {
|
|
return rune(ru + 48)
|
|
} else if ru < 36 {
|
|
return rune(ru + 55)
|
|
}
|
|
return rune(ru + 61)
|
|
}
|
|
func randStringTypes(r randyTypes) string {
|
|
v3 := r.Intn(100)
|
|
tmps := make([]rune, v3)
|
|
for i := 0; i < v3; i++ {
|
|
tmps[i] = randUTF8RuneTypes(r)
|
|
}
|
|
return string(tmps)
|
|
}
|
|
func randUnrecognizedTypes(r randyTypes, maxFieldNumber int) (dAtA []byte) {
|
|
l := r.Intn(5)
|
|
for i := 0; i < l; i++ {
|
|
wire := r.Intn(4)
|
|
if wire == 3 {
|
|
wire = 5
|
|
}
|
|
fieldNumber := maxFieldNumber + r.Intn(100)
|
|
dAtA = randFieldTypes(dAtA, r, fieldNumber, wire)
|
|
}
|
|
return dAtA
|
|
}
|
|
func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte {
|
|
key := uint32(fieldNumber)<<3 | uint32(wire)
|
|
switch wire {
|
|
case 0:
|
|
dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
|
|
v4 := r.Int63()
|
|
if r.Intn(2) == 0 {
|
|
v4 *= -1
|
|
}
|
|
dAtA = encodeVarintPopulateTypes(dAtA, uint64(v4))
|
|
case 1:
|
|
dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
|
|
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
|
case 2:
|
|
dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
|
|
ll := r.Intn(100)
|
|
dAtA = encodeVarintPopulateTypes(dAtA, uint64(ll))
|
|
for j := 0; j < ll; j++ {
|
|
dAtA = append(dAtA, byte(r.Intn(256)))
|
|
}
|
|
default:
|
|
dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
|
|
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
|
|
}
|
|
return dAtA
|
|
}
|
|
func encodeVarintPopulateTypes(dAtA []byte, v uint64) []byte {
|
|
for v >= 1<<7 {
|
|
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
|
|
v >>= 7
|
|
}
|
|
dAtA = append(dAtA, uint8(v))
|
|
return dAtA
|
|
}
|