17 lines
482 B
Go
17 lines
482 B
Go
package cipher
|
|
|
|
import "errors"
|
|
|
|
var ErrInvalidKeyLength = errors.New("Invalid key length")
|
|
|
|
type Block interface {
|
|
// Encrypt a source block into the destination. Panics if blocks are not sized correctly.
|
|
Encrypt(dst, src []byte)
|
|
// Decrypt a source block into the destination. Panics if blocks are not sized correctly.
|
|
Decrypt(dst, src []byte)
|
|
// BlockSize returns the blocksize in bytes
|
|
BlockSize() int
|
|
// Algorithm returns the name of the algorithm
|
|
Algorithm() string
|
|
}
|