diff options
Diffstat (limited to 'core/crypto/aegis')
| -rw-r--r-- | core/crypto/aegis/aegis.odin | 9 | ||||
| -rw-r--r-- | core/crypto/aegis/aegis_impl_ct64.odin | 8 | ||||
| -rw-r--r-- | core/crypto/aegis/aegis_impl_hw_intel.odin | 8 |
3 files changed, 12 insertions, 13 deletions
diff --git a/core/crypto/aegis/aegis.odin b/core/crypto/aegis/aegis.odin index 41b7ad5be..fbb19f1ae 100644 --- a/core/crypto/aegis/aegis.odin +++ b/core/crypto/aegis/aegis.odin @@ -11,7 +11,6 @@ package aegis import "core:bytes" import "core:crypto" import "core:crypto/aes" -import "core:mem" // KEY_SIZE_128L is the AEGIS-128L key size in bytes. KEY_SIZE_128L :: 16 @@ -197,8 +196,8 @@ open :: proc(ctx: ^Context, dst, iv, aad, ciphertext, tag: []byte) -> bool { } if crypto.compare_constant_time(tag, derived_tag) != 1 { - mem.zero_explicit(raw_data(derived_tag), len(derived_tag)) - mem.zero_explicit(raw_data(dst), ct_len) + crypto.zero_explicit(raw_data(derived_tag), len(derived_tag)) + crypto.zero_explicit(raw_data(dst), ct_len) return false } @@ -208,7 +207,7 @@ open :: proc(ctx: ^Context, dst, iv, aad, ciphertext, tag: []byte) -> bool { // reset sanitizes the Context. The Context must be // re-initialized to be used again. reset :: proc "contextless" (ctx: ^Context) { - mem.zero_explicit(&ctx._key, len(ctx._key)) + crypto.zero_explicit(&ctx._key, len(ctx._key)) ctx._key_len = 0 ctx._is_initialized = false -} +}
\ No newline at end of file diff --git a/core/crypto/aegis/aegis_impl_ct64.odin b/core/crypto/aegis/aegis_impl_ct64.odin index 4813b37ec..15a9b4b3d 100644 --- a/core/crypto/aegis/aegis_impl_ct64.odin +++ b/core/crypto/aegis/aegis_impl_ct64.odin @@ -1,8 +1,8 @@ package aegis +import "core:crypto" import aes "core:crypto/_aes/ct64" import "core:encoding/endian" -import "core:mem" // This uses the bitlsiced 64-bit general purpose register SWAR AES // round function. The intermediate state is stored in interleaved @@ -324,7 +324,7 @@ dec_sw_256 :: #force_inline proc "contextless" (st: ^State_SW, xi, ci: []byte) # @(private = "file") dec_partial_sw_128l :: proc "contextless" (st: ^State_SW, xn, cn: []byte) #no_bounds_check { tmp: [_RATE_128L]byte - defer mem.zero_explicit(&tmp, size_of(tmp)) + defer crypto.zero_explicit(&tmp, size_of(tmp)) z0_0, z0_1, z1_0, z1_1 := z_sw_128l(st) copy(tmp[:], cn) @@ -349,7 +349,7 @@ dec_partial_sw_128l :: proc "contextless" (st: ^State_SW, xn, cn: []byte) #no_bo @(private = "file") dec_partial_sw_256 :: proc "contextless" (st: ^State_SW, xn, cn: []byte) #no_bounds_check { tmp: [_RATE_256]byte - defer mem.zero_explicit(&tmp, size_of(tmp)) + defer crypto.zero_explicit(&tmp, size_of(tmp)) z_0, z_1 := z_sw_256(st) copy(tmp[:], cn) @@ -448,5 +448,5 @@ finalize_sw :: proc "contextless" (st: ^State_SW, tag: []byte, ad_len, msg_len: @(private) reset_state_sw :: proc "contextless" (st: ^State_SW) { - mem.zero_explicit(st, size_of(st^)) + crypto.zero_explicit(st, size_of(st^)) } diff --git a/core/crypto/aegis/aegis_impl_hw_intel.odin b/core/crypto/aegis/aegis_impl_hw_intel.odin index 5334f3258..7673b6b28 100644 --- a/core/crypto/aegis/aegis_impl_hw_intel.odin +++ b/core/crypto/aegis/aegis_impl_hw_intel.odin @@ -2,9 +2,9 @@ package aegis import "base:intrinsics" +import "core:crypto" import "core:crypto/aes" import "core:encoding/endian" -import "core:mem" import "core:simd/x86" @(private) @@ -261,7 +261,7 @@ dec_hw_256 :: #force_inline proc "contextless" (st: ^State_HW, xi, ci: []byte) # @(private = "file", enable_target_feature = "sse2,aes") dec_partial_hw_128l :: #force_inline proc "contextless" (st: ^State_HW, xn, cn: []byte) #no_bounds_check { tmp: [_RATE_128L]byte - defer mem.zero_explicit(&tmp, size_of(tmp)) + defer crypto.zero_explicit(&tmp, size_of(tmp)) z0, z1 := z_hw_128l(st) copy(tmp[:], cn) @@ -286,7 +286,7 @@ dec_partial_hw_128l :: #force_inline proc "contextless" (st: ^State_HW, xn, cn: @(private = "file", enable_target_feature = "sse2,aes") dec_partial_hw_256 :: #force_inline proc "contextless" (st: ^State_HW, xn, cn: []byte) #no_bounds_check { tmp: [_RATE_256]byte - defer mem.zero_explicit(&tmp, size_of(tmp)) + defer crypto.zero_explicit(&tmp, size_of(tmp)) z := z_hw_256(st) copy(tmp[:], cn) @@ -385,5 +385,5 @@ finalize_hw :: proc "contextless" (st: ^State_HW, tag: []byte, ad_len, msg_len: @(private) reset_state_hw :: proc "contextless" (st: ^State_HW) { - mem.zero_explicit(st, size_of(st^)) + crypto.zero_explicit(st, size_of(st^)) } |