From f97baca6f6288eb786fe3546292465ef76310810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Guti=C3=A9rrez=20Alonso?= <30444886+margual56@users.noreply.github.com> Date: Sun, 13 Jul 2025 09:33:08 +0200 Subject: [PATCH] Add documentation to std.crypto.aes_gcm.AesGcm.encrypt (#24427) --- lib/std/crypto/aes_gcm.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/std/crypto/aes_gcm.zig b/lib/std/crypto/aes_gcm.zig index 90717516c4..e430d3addb 100644 --- a/lib/std/crypto/aes_gcm.zig +++ b/lib/std/crypto/aes_gcm.zig @@ -21,6 +21,12 @@ fn AesGcm(comptime Aes: anytype) type { const zeros = [_]u8{0} ** 16; + /// `c`: The ciphertext buffer to write the encrypted data to. + /// `tag`: The authentication tag buffer to write the computed tag to. + /// `m`: The plaintext message to encrypt. + /// `ad`: The associated data to authenticate. + /// `npub`: The nonce to use for encryption. + /// `key`: The encryption key. pub fn encrypt(c: []u8, tag: *[tag_length]u8, m: []const u8, ad: []const u8, npub: [nonce_length]u8, key: [key_length]u8) void { debug.assert(c.len == m.len); debug.assert(m.len <= 16 * ((1 << 32) - 2));