Sortix 1.1dev ports manual
This manual documents Sortix 1.1dev ports. You can instead view this document in the latest official manual.
AES_ENCRYPT(3) | Library Functions Manual | AES_ENCRYPT(3) |
NAME
AES_set_encrypt_key, AES_set_decrypt_key, AES_encrypt, AES_decrypt, AES_cbc_encrypt — low-level interface to the AES symmetric cipherSYNOPSIS
#include <openssl/aes.h> intAES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int
AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); void
AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void
AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void
AES_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t length, const AES_KEY *key, unsigned char *ivec, const int enc);
DESCRIPTION
These function provide a low-level interface to the AES symmetric cipher algorithm, also called Rijndael. For reasons of flexibility, it is recommended that application programs use the high-level interface described in EVP_EncryptInit(3) and EVP_aes_128_cbc(3) instead whenever possible. AES_KEY is a structure that can hold up to 60 int values and a number of rounds. AES_set_encrypt_key() expands the userKey, which is bits long, into the key structure to prepare for encryption. The number of bits and bytes read from userKey, the number of int values stored into key, and the number of rounds are as follows:bits | bytes | ints | rounds |
128 | 16 | 44 | 10 |
192 | 24 | 52 | 12 |
256 | 32 | 60 | 14 |
RETURN VALUES
AES_set_encrypt_key() and AES_set_decrypt_key() return 0 for success, -1 if userKey or key isNULL
, or -2 if the number of
bits is unsupported.
SEE ALSO
crypto(3), EVP_aes_128_cbc(3), EVP_EncryptInit(3)STANDARDS
ISO/IEC 18033-3:2010 Information technology — Security techniques — Encryption algorithms — Part 3: Block ciphersHISTORY
These functions first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.AUTHORS
Vincent RijmenAntoon Bosselaers
Paulo Barreto
August 28, 2019 | Debian |