summaryrefslogtreecommitdiff
path: root/lib/crypto
diff options
context:
space:
mode:
authorSagar Vashnav <sagarvashnav72427@gmail.com>2023-10-25 08:57:07 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2023-11-17 19:16:28 +0800
commit239e27a983316e4746e2ad45ba65fafaf3bbc15d (patch)
treefd1e63420ad20be657283fb35ac43539369c6893 /lib/crypto
parent03f8f3cb6e2280866a9d53b77b6ee1c1b9ffb2a4 (diff)
crypto: lib/aesgcm - Add kernel docs for aesgcm_mac
Add kernel documentation for the aesgcm_mac. This function generates the authentication tag using the AES-GCM algorithm. Signed-off-by: Sagar Vashnav <sagarvashnav72427@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/aesgcm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/crypto/aesgcm.c b/lib/crypto/aesgcm.c
index c632d6e17af8..6bba6473fdf3 100644
--- a/lib/crypto/aesgcm.c
+++ b/lib/crypto/aesgcm.c
@@ -73,6 +73,19 @@ static void aesgcm_ghash(be128 *ghash, const be128 *key, const void *src,
}
}
+/**
+ * aesgcm_mac - Generates the authentication tag using AES-GCM algorithm.
+ * @ctx: The data structure that will hold the AES-GCM key schedule
+ * @src: The input source data.
+ * @src_len: Length of the source data.
+ * @assoc: Points to the associated data.
+ * @assoc_len: Length of the associated data values.
+ * @ctr: Points to the counter value.
+ * @authtag: The output buffer for the authentication tag.
+ *
+ * It takes in the AES-GCM context, source data, associated data, counter value,
+ * and an output buffer for the authentication tag.
+ */
static void aesgcm_mac(const struct aesgcm_ctx *ctx, const u8 *src, int src_len,
const u8 *assoc, int assoc_len, __be32 *ctr, u8 *authtag)
{