/home/abui.../aes_gcm.h(3)
π /home/abui.../aes_gcm.h(3)
okay so bestie, this is the Library Functions Manual page for /home/abui.../aes_gcm.h(3), and itβs giving βcrypto API but make it formal.β Weβre talking AES-GCM, authenticated encryption, and a whole little family of zpc_aes_gcm_* functions. Letβs get into it. π«Ά
πΈ NAME
/home/abuild/rpmbuild/BUILD/libzpc-legacy-1.5.0-build/libzpc-1.5.0/include/zpc/aes_gcm.h β AES-GCM API.
β¨ SYNOPSIS
Functions
int zpc_aes_gcm_alloc (struct zpc_aes_gcm **ctx)
int zpc_aes_gcm_set_key (struct zpc_aes_gcm *ctx, struct zpc_aes_key *key)
int zpc_aes_gcm_create_iv (struct zpc_aes_gcm *ctx, unsigned char *iv, size_t ivlen)
int zpc_aes_gcm_set_iv (struct zpc_aes_gcm *ctx, const unsigned char *iv, size_t ivlen)
int zpc_aes_gcm_encrypt (struct zpc_aes_gcm *ctx, unsigned char *ct, unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen, const unsigned char *pt, size_t ptlen)
int zpc_aes_gcm_decrypt (struct zpc_aes_gcm *ctx, unsigned char *pt, const unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen, const unsigned char *ct, size_t ctlen)
void zpc_aes_gcm_free (struct zpc_aes_gcm **ctx)
π¦ Detailed Description
AES-GCM API. π
This is the authenticated encryption API for the Advanced Encryption Standard (AES) block cipher [1] in Galois/Counter Mode mode of operation [6] . Yes, thatβs the whole vibe: AES-GCM, authenticated encryption, very serious cryptography, very demure header file. β¨
Definition in file aes_gcm.h.
π§ Function Documentation
π
int zpc_aes_gcm_alloc (struct zpc_aes_gcm **ctx)
Allocate a new context for an AES-GCM operation. Fresh context, new era, main character energy. π
Parameters
ctxβ AES-GCM context
Returns
0 on success. Otherwise, a non-zero error code is returned.
π₯ int zpc_aes_gcm_set_key (struct zpc_aes_gcm *ctx, struct zpc_aes_key *key)
Set the key to be used in the context of an AES-GCM operation. Gotta give the context its key, obviously. π
Parameters
ctxβ AES-GCM contextkeyβ AES key
Returns
0 on success. Otherwise, a non-zero error code is returned.
π int zpc_aes_gcm_create_iv (struct zpc_aes_gcm *ctx, unsigned char *iv, size_t ivlen)
Create the initialization vector to be used in the context of an AES-GCM operation. The minimum and recommended iv length is 12 bytes. Not me being obsessed with a 12-byte minimum, but here we are. π«Ά
Parameters
ctxβ AES-GCM contextivβ application provided buffer of at leastivlenbytes to receive the internally created initialization vectorivlenβ initialization vector length [bytes]
Returns
0 on success. Otherwise, a non-zero error code is returned.
πΈ int zpc_aes_gcm_set_iv (struct zpc_aes_gcm *ctx, const unsigned char *iv, size_t ivlen)
Set the initialization vector to be used in the context of an AES-GCM operation. You bring the IV, this function sets it. Teamwork, periodt. π
Parameters
ctxβ AES-GCM contextivβ initialization vectorivlenβ initialization vector length [bytes]
Returns
0 on success. Otherwise, a non-zero error code is returned.
β int zpc_aes_gcm_encrypt (struct zpc_aes_gcm *ctx, unsigned char *ct, unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen, const unsigned char *pt, size_t ptlen)
Do an AES-GCM authenticated encryption operation. Encrypt, authenticate, slay. π₯
Parameters
ctxβ AES-GCM contextctβ ciphertextmacβ message authentication codemaclenβ message authentication code length [bytes]aadβ additional authenticated dataaadlenβ additional authenticated data length [bytes]ptβ plaintextptlenβ plaintext length [bytes]
Returns
0 on success. Otherwise, a non-zero error code is returned.
π¦ int zpc_aes_gcm_decrypt (struct zpc_aes_gcm *ctx, unsigned char *pt, const unsigned char *mac, size_t maclen, const unsigned char *aad, size_t aadlen, const unsigned char *ct, size_t ctlen)
Do an AES-GCM authenticated decryption operation. The reverse vibe check: ciphertext in, plaintext out, MAC doing its little security moment. π‘οΈ
Parameters
ctxβ AES-GCM contextptβ plaintextmacβ message authentication codemaclenβ message authentication code length [bytes]aadβ additional authenticated dataaadlenβ additional authenticated data length [bytes]ctβ ciphertextctlenβ ciphertext length [bytes]
Returns
0 on success. Otherwise, a non-zero error code is returned.
π void zpc_aes_gcm_free (struct zpc_aes_gcm **ctx)
Free an AES-CCM context. Yes, the page literally says AES-CCM here β Iβm keeping it exactly as written, bestie, no editing, no βfixing,β no cap. π
Parameters
ctxβ AES-GCM context
π
Author: Generated automatically by Doxygen for libzpc from the source code. Iconic automation behavior, honestly. β¨
okay thatβs the whole page, and hereβs the cute little footer sign-off: source/version is libzpc, Version 1.4, and the footer path is /home/abui.../aes_gcm.h(3). Thereβs no date printed on this page, so Iβm not gonna invent one. π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: libzpc-legacy-devel 1.5.0-160000.2.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms