Add Speck-128 implementation

This commit is contained in:
2025-05-19 02:11:38 +02:00
parent 18009f8754
commit 53226adbdb
4 changed files with 270 additions and 0 deletions

16
cipher/cipher.go Normal file
View File

@ -0,0 +1,16 @@
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
}