/home/abui.../aes_gcm.h(3)

πŸ“¦ version 1.5.0, in opensuse-leap 16.0

πŸ’– /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 context
  • key β€” 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 context
  • iv β€” application provided buffer of at least ivlen bytes to receive the internally created initialization vector
  • ivlen β€” 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 context
  • iv β€” initialization vector
  • ivlen β€” 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 context
  • ct β€” ciphertext
  • mac β€” message authentication code
  • maclen β€” message authentication code length [bytes]
  • aad β€” additional authenticated data
  • aadlen β€” additional authenticated data length [bytes]
  • pt β€” plaintext
  • ptlen β€” 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 context
  • pt β€” plaintext
  • mac β€” message authentication code
  • maclen β€” message authentication code length [bytes]
  • aad β€” additional authenticated data
  • aadlen β€” additional authenticated data length [bytes]
  • ct β€” ciphertext
  • ctlen β€” 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