X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgogost%2Fgost3412128%2Fcipher.go;h=e118d31182a33320a9a4c9338018bf18cf34b8ca;hb=69e668f3499122e0b1140f3bd927de41ad279b94;hp=9281892b7a5acbafe919441d7d885c3714b0d97b;hpb=9be6f384bae8ebeabc129ede9f8a597de12835d3;p=gogost.git diff --git a/src/cypherpunks.ru/gogost/gost3412128/cipher.go b/src/cypherpunks.ru/gogost/gost3412128/cipher.go index 9281892..e118d31 100644 --- a/src/cypherpunks.ru/gogost/gost3412128/cipher.go +++ b/src/cypherpunks.ru/gogost/gost3412128/cipher.go @@ -132,7 +132,10 @@ func (c *Cipher) BlockSize() int { return BlockSize } -func NewCipher(key [KeySize]byte) *Cipher { +func NewCipher(key []byte) *Cipher { + if len(key) != KeySize { + panic("invalid key size") + } ks := new([10]*[BlockSize]byte) kr0 := new([BlockSize]byte) kr1 := new([BlockSize]byte)