aboutsummaryrefslogtreecommitdiff
path: root/core/crypto
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2024-08-09 00:20:47 +0900
committerYawning Angel <yawning@schwanenlied.me>2024-08-10 18:32:37 +0900
commit38aea1f9077b5f9f8f3ec59a0972e762aca4c112 (patch)
tree6854f0a18760ded374e54bd55a8ecac4db9bd252 /core/crypto
parentb381791f429f7bd36bb9f47c475bd2b3cb19718e (diff)
core/crypto/aes,chacha20poly1305: Add require_results to open
Diffstat (limited to 'core/crypto')
-rw-r--r--core/crypto/aes/aes_gcm.odin1
-rw-r--r--core/crypto/chacha20poly1305/chacha20poly1305.odin1
2 files changed, 2 insertions, 0 deletions
diff --git a/core/crypto/aes/aes_gcm.odin b/core/crypto/aes/aes_gcm.odin
index 845d7db02..ed3bb4313 100644
--- a/core/crypto/aes/aes_gcm.odin
+++ b/core/crypto/aes/aes_gcm.odin
@@ -74,6 +74,7 @@ seal_gcm :: proc(ctx: ^Context_GCM, dst, tag, iv, aad, plaintext: []byte) {
// fails, the destination buffer will be zeroed.
//
// dst and plaintext MUST alias exactly or not at all.
+@(require_results)
open_gcm :: proc(ctx: ^Context_GCM, dst, iv, aad, ciphertext, tag: []byte) -> bool {
assert(ctx._is_initialized)
diff --git a/core/crypto/chacha20poly1305/chacha20poly1305.odin b/core/crypto/chacha20poly1305/chacha20poly1305.odin
index 616525f76..ad7a510a9 100644
--- a/core/crypto/chacha20poly1305/chacha20poly1305.odin
+++ b/core/crypto/chacha20poly1305/chacha20poly1305.odin
@@ -149,6 +149,7 @@ seal :: proc(ctx: ^Context, dst, tag, iv, aad, plaintext: []byte) {
// fails, the destination buffer will be zeroed.
//
// dst and plaintext MUST alias exactly or not at all.
+@(require_results)
open :: proc(ctx: ^Context, dst, iv, aad, ciphertext, tag: []byte) -> bool {
plaintext := dst
_validate_common_slice_sizes(tag, iv, aad, ciphertext, ctx._is_xchacha)