RIJNDAEL(9)
π NAME π
okay so bestie, this is RIJNDAEL(9) from the Kernel Developer's Manual, and it is literally the page for AES encryption β¨. The whole squad is:
rijndael_makeKeyrijndael_cipherInitrijndael_blockEncryptrijndael_padEncryptrijndael_blockDecryptrijndael_padDecrypt
πΈ SYNOPSIS πΈ
Here's the exact include-and-signature moment, no cap:
#include <sys/types.h>
#include <crypto/rijndael.h>
int
rijndael_makeKey(keyInstance *key, uint8_t direction, int keyLen,
char *keyMaterial);
int
rijndael_cipherInit(cipherInstance *cipher, uint8_t mode, char *IV);
int
rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
uint8_t *input, int inputLen, uint8_t *outBuffer);
int
rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key,
uint8_t *input, int inputOctets, uint8_t *outBuffer);
int
rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key,
uint8_t *input, int inputLen, uint8_t *outBuffer);
int
rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
uint8_t *input, int inputOctets, uint8_t *outBuffer);
π DESCRIPTION π
So rijndael_makeKey() is the function that sets up the key schedule in key. Itβs giving βget your key situation readyβ energy π
.
The direction tells it what the key is for, and it may be DIR_ENCRYPT or DIR_DECRYPT.
The key length in bits lives in keyLen, and it must be 128, 192 or 256. No random numbers, bestie π.
The actual key comes from the buffer pointed to by keyMaterial. That material may be raw binary data, or an ASCII string containing a hexadecimal rendition of the raw binary data. Which one? It depends on a compile-time option in the rijndael_makeKey sources: BINARY_KEY_MATERIAL.
π¦ RETURN VALUES π¦
rijndael_makeKey() returns:
BAD_KEY_INSTANCEif aNULLkeyis passed.BAD_KEY_DIRifdirectionis notDIR_ENCRYPTorDIR_DECRYPT.BAD_KEY_MATif the key materials are not a hexadecimal string (and binary keys are not set).TRUEotherwise.
π AUTHORS π
Mark R V Murray. Shoutout to the icon who wrote this one π .
Source/version: Debian. Date: February 6, 2002. Manual page: RIJNDAEL(9). Thatβs the tea β bye bestie π«Άπ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2002 Mark R V Murray. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms