]> Cypherpunks.ru repositories - gogost.git/blobdiff - internal/gost34112012/hash.go
Slightly refactored error messages
[gogost.git] / internal / gost34112012 / hash.go
index a3ce069a8bfd84b8461af05b1dad660d39487b30..0e6d02a882a06642dac5da2e1e02058dd183a7ad 100644 (file)
@@ -1,5 +1,5 @@
 // GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2021 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2023 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -452,7 +452,7 @@ func (h *Hash) MarshalBinary() (data []byte, err error) {
 func (h *Hash) UnmarshalBinary(data []byte) error {
        expectedLen := len(MarshaledName) + 1 + 8 + 2*BlockSize
        if len(data) < expectedLen {
-               return fmt.Errorf("gogost/internal/gost34112012: len(data) != %d", expectedLen)
+               return fmt.Errorf("gogost/internal/gost34112012: len(data)=%d != %d", len(data), expectedLen)
        }
        if !bytes.HasPrefix(data, []byte(MarshaledName)) {
                return errors.New("gogost/internal/gost34112012: no hash name prefix")