mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-06 06:38:20 +00:00
core/crypto/aes: Fix src size check
Fixed a faulty check that would check the `dst` twice instead of checking the `src` and `dst` input parameters in `encrypt_ecb()` & `decrypt_ecb()`.
This commit is contained in:
@@ -21,7 +21,7 @@ init_ecb :: proc(ctx: ^Context_ECB, key: []byte, impl := DEFAULT_IMPLEMENTATION)
|
||||
encrypt_ecb :: proc(ctx: ^Context_ECB, dst, src: []byte) {
|
||||
ensure(ctx._is_initialized)
|
||||
ensure(len(dst) == BLOCK_SIZE, "crypto/aes: invalid dst size")
|
||||
ensure(len(dst) == BLOCK_SIZE, "crypto/aes: invalid src size")
|
||||
ensure(len(src) == BLOCK_SIZE, "crypto/aes: invalid src size")
|
||||
|
||||
switch &impl in ctx._impl {
|
||||
case ct64.Context:
|
||||
@@ -35,7 +35,7 @@ encrypt_ecb :: proc(ctx: ^Context_ECB, dst, src: []byte) {
|
||||
decrypt_ecb :: proc(ctx: ^Context_ECB, dst, src: []byte) {
|
||||
ensure(ctx._is_initialized)
|
||||
ensure(len(dst) == BLOCK_SIZE, "crypto/aes: invalid dst size")
|
||||
ensure(len(dst) == BLOCK_SIZE, "crypto/aes: invalid src size")
|
||||
ensure(len(src) == BLOCK_SIZE, "crypto/aes: invalid src size")
|
||||
|
||||
switch &impl in ctx._impl {
|
||||
case ct64.Context:
|
||||
|
||||
Reference in New Issue
Block a user