@@ -23,7 +23,7 @@ type PublicKey struct {
2323// This compact serialization format is the raw key material, without metadata or structure.
2424// It errors if the slice is not the right size.
2525func PublicKeyFromBytes (b []byte ) (PublicKey , error ) {
26- if len (b ) != PublicKeySize {
26+ if len (b ) != PublicKeyBytesSize {
2727 return PublicKey {}, fmt .Errorf ("invalid ed25519 public key size" )
2828 }
2929 // make a copy
@@ -39,7 +39,7 @@ func PublicKeyFromPublicKeyMultibase(multibase string) (PublicKey, error) {
3939 if code != MultibaseCode {
4040 return PublicKey {}, fmt .Errorf ("invalid code" )
4141 }
42- if len (bytes ) != PublicKeySize {
42+ if len (bytes ) != PublicKeyBytesSize {
4343 return PublicKey {}, fmt .Errorf ("invalid ed25519 public key size" )
4444 }
4545 return PublicKeyFromBytes (bytes )
@@ -69,7 +69,7 @@ func PublicKeyFromX509PEM(str string) (PublicKey, error) {
6969func (p PublicKey ) ToBytes () []byte {
7070 // Copy the private key to a fixed size buffer that can get allocated on the
7171 // caller's stack after inlining.
72- var buf [PublicKeySize ]byte
72+ var buf [PublicKeyBytesSize ]byte
7373 return append (buf [:0 ], p .k ... )
7474}
7575
@@ -110,7 +110,7 @@ func (p PublicKey) VerifyASN1(message, signature []byte) bool {
110110 if ! s .ReadASN1BitString (& bitString ) {
111111 return false
112112 }
113- if bitString .BitLength != SignatureSize * 8 {
113+ if bitString .BitLength != SignatureBytesSize * 8 {
114114 return false
115115 }
116116
0 commit comments