From: Sergey Matveev Date: Wed, 5 Apr 2023 11:53:46 +0000 (+0300) Subject: Proper spelling of variable X-Git-Tag: v5.10.0~2 X-Git-Url: http://www.git.cypherpunks.ru/?p=gogost.git;a=commitdiff_plain;h=46430ef4d0a8a62557bfafba7a0a89240ed50642 Proper spelling of variable --- diff --git a/internal/gost34112012/hash.go b/internal/gost34112012/hash.go index 0e6d02a..9dfd407 100644 --- a/internal/gost34112012/hash.go +++ b/internal/gost34112012/hash.go @@ -27,7 +27,7 @@ import ( const ( BlockSize = 64 - MarshaledName = "STREEBOG" + MarshalledName = "STREEBOG" ) var ( @@ -434,9 +434,9 @@ func l(out, data []byte) []byte { } func (h *Hash) MarshalBinary() (data []byte, err error) { - data = make([]byte, len(MarshaledName)+1+8+2*BlockSize+len(h.buf)) - copy(data, []byte(MarshaledName)) - idx := len(MarshaledName) + data = make([]byte, len(MarshalledName)+1+8+2*BlockSize+len(h.buf)) + copy(data, []byte(MarshalledName)) + idx := len(MarshalledName) data[idx] = byte(h.size) idx += 1 binary.BigEndian.PutUint64(data[idx:idx+8], h.n) @@ -450,14 +450,14 @@ func (h *Hash) MarshalBinary() (data []byte, err error) { } func (h *Hash) UnmarshalBinary(data []byte) error { - expectedLen := len(MarshaledName) + 1 + 8 + 2*BlockSize + expectedLen := len(MarshalledName) + 1 + 8 + 2*BlockSize if len(data) < expectedLen { return fmt.Errorf("gogost/internal/gost34112012: len(data)=%d != %d", len(data), expectedLen) } - if !bytes.HasPrefix(data, []byte(MarshaledName)) { + if !bytes.HasPrefix(data, []byte(MarshalledName)) { return errors.New("gogost/internal/gost34112012: no hash name prefix") } - idx := len(MarshaledName) + idx := len(MarshalledName) h.size = int(data[idx]) idx += 1 h.n = binary.BigEndian.Uint64(data[idx : idx+8])