AES (Rijndael) cipher - encrypt. More...
#include "includes.h"
#include "common.h"
#include "crypto.h"
#include "aes_i.h"
Go to the source code of this file.
Defines | |
#define | ROUND(i, d, s) |
Functions | |
void | rijndaelEncrypt (const u32 rk[], const u8 pt[16], u8 ct[16]) |
void * | aes_encrypt_init (const u8 *key, size_t len) |
Initialize AES for encryption. | |
void | aes_encrypt (void *ctx, const u8 *plain, u8 *crypt) |
Encrypt one AES block. | |
void | aes_encrypt_deinit (void *ctx) |
Deinitialize AES encryption. |
AES (Rijndael) cipher - encrypt.
Modifications to public domain implementation:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
Alternatively, this software may be distributed under the terms of BSD license.
See README and COPYING for more details.
Definition in file aes-internal-enc.c.
#define ROUND | ( | i, | |||
d, | |||||
s | ) |
d##0 = TE0(s##0) ^ TE1(s##1) ^ TE2(s##2) ^ TE3(s##3) ^ rk[4 * i]; \ d##1 = TE0(s##1) ^ TE1(s##2) ^ TE2(s##3) ^ TE3(s##0) ^ rk[4 * i + 1]; \ d##2 = TE0(s##2) ^ TE1(s##3) ^ TE2(s##0) ^ TE3(s##1) ^ rk[4 * i + 2]; \ d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]
void aes_encrypt | ( | void * | ctx, | |
const u8 * | plain, | |||
u8 * | crypt | |||
) |
Encrypt one AES block.
ctx | Context pointer from aes_encrypt_init() | |
plain | Plaintext data to be encrypted (16 bytes) | |
crypt | Buffer for the encrypted data (16 bytes) |
Definition at line 112 of file aes-internal-enc.c.
void aes_encrypt_deinit | ( | void * | ctx | ) |
Deinitialize AES encryption.
ctx | Context pointer from aes_encrypt_init() |
Definition at line 118 of file aes-internal-enc.c.
void* aes_encrypt_init | ( | const u8 * | key, | |
size_t | len | |||
) |
Initialize AES for encryption.
key | Encryption key | |
len | Key length in bytes (usually 16, i.e., 128 bits) |
Definition at line 99 of file aes-internal-enc.c.