Improve speck tests #3

Merged
omicron merged 3 commits from speck_tests into main 2025-05-20 18:16:52 +00:00
Showing only changes of commit 7b8df3b046 - Show all commits

View File

@ -41,7 +41,7 @@ var keySizes = []int{
// New creates a new speck block cipher context. // New creates a new speck block cipher context.
// Returns the created block cipher or an error. // Returns the created block cipher or an error.
func New(key []byte, param SpeckParameters) (cipher.Block, error) { func New(key []byte, param SpeckParameters) (cipher.Block, error) {
if param == 0 || int(param) > len(keySizes) { if param <= 0 || int(param) >= len(keySizes) {
panic("Invalid parameters") panic("Invalid parameters")
} }
keySize := keySizes[param] keySize := keySizes[param]