]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost3412128/cipher.go
Simplify keys and IVs arguments passing: use slices instead of arrays
[gogost.git] / src / cypherpunks.ru / gogost / gost3412128 / cipher.go
index 9281892b7a5acbafe919441d7d885c3714b0d97b..e118d31182a33320a9a4c9338018bf18cf34b8ca 100644 (file)
@@ -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)