X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost28147%2Fmac.go;h=5c8dbda9435effed1e1937a948b51c282d639c2d;hb=HEAD;hp=b49bc7d305f67f720f2cb0cfc2d37cc0bb3795c7;hpb=0da4d634ac5368d024489baf4bdd5d422b84dd84;p=gogost.git diff --git a/gost28147/mac.go b/gost28147/mac.go index b49bc7d..18756c0 100644 --- a/gost28147/mac.go +++ b/gost28147/mac.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2019 Sergey Matveev +// Copyright (C) 2015-2024 Sergey Matveev // // 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 @@ -16,7 +16,7 @@ package gost28147 import ( - "errors" + "fmt" ) var ( @@ -42,10 +42,10 @@ type MAC struct { // following ones are fed to Write function. func (c *Cipher) NewMAC(size int, iv []byte) (*MAC, error) { if size == 0 || size > 8 { - return nil, errors.New("gogost/gost28147: invalid tag size") + return nil, fmt.Errorf("gogost/gost28147: invalid tag size (0<%d<=8)", size) } if len(iv) != BlockSize { - return nil, errors.New("gogost/gost28147: len(iv) != 8") + return nil, fmt.Errorf("gogost/gost28147: len(iv)=%d != %d", len(iv), BlockSize) } m := MAC{c: c, size: size, iv: iv} n2, n1 := block2nvs(iv)