// GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2017 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2019 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
iv []byte
}
-func (c *Cipher) NewCFBEncrypter(iv [BlockSize]byte) *CFBEncrypter {
- return &CFBEncrypter{c, iv[:]}
+func (c *Cipher) NewCFBEncrypter(iv []byte) *CFBEncrypter {
+ if len(iv) != BlockSize {
+ panic("iv length is not equal to blocksize")
+ }
}
func (c *CFBEncrypter) XORKeyStream(dst, src []byte) {
iv []byte
}
-func (c *Cipher) NewCFBDecrypter(iv [BlockSize]byte) *CFBDecrypter {
- return &CFBDecrypter{c, iv[:]}
+func (c *Cipher) NewCFBDecrypter(iv []byte) *CFBDecrypter {
+ if len(iv) != BlockSize {
+ panic("iv length is not equal to blocksize")
+ }
}
func (c *CFBDecrypter) XORKeyStream(dst, src []byte) {