#include <sys/types.h>
#include <crypto/rijndael.h> int
Fo rijndael_makeKey
Fa keyInstance *key
Fa u_int8_t direction
Fa int keyLen
Fa char *keyMaterial
Fc Ft int
Fo rijndael_cipherInit
Fa cipherInstance *cipher
Fa u_int8_t mode
Fa char *IV
Fc Ft int
Fo rijndael_blockEncrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa u_int8_t *input
Fa int inputLen
Fa u_int8_t *outBuffer
Fc Ft int
Fo rijndael_padEncrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa u_int8_t *input
Fa int inputOctets
Fa u_int8_t *outBuffer
Fc Ft int
Fo rijndael_blockDecrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa u_int8_t *input
Fa int inputLen
Fa u_int8_t *outBuffer
Fc Ft int
Fo rijndael_padDecrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa u_int8_t *input
Fa int inputOctets
Fa u_int8_t *outBuffer
Fc
DESCRIPTION
The
rijndael_makeKey ();
function is used to set up the key schedule in
Fa key .
The
Fa direction
(which may be
DIR_ENCRYPT
or
DIR_DECRYPT
specifies the intended use of the key.
The length of the key (in bits) is given in
Fa keyLen ,
and must be 128, 192 or 256.
The actual key is supplied in the buffer pointed to by
Fa keyMaterial .
This material may be raw binary data,
or an ASCII string containing a hexadecimal rendition
of the raw binary data,
dependent on a compile-time option in the
sources,
BINARY_KEY_MATERIAL
RETURN VALUES
The
rijndael_makeKey ();
function will return
BAD_KEY_INSTANCE
if a
NULL
Fa key
is passed,
BAD_KEY_DIR
if
Fa direction
is not
DIR_ENCRYPT
or
DIR_DECRYPTBAD_KEY_MAT
if the key materials are not a hexadecimal string
(and binary keys are not set),
and
TRUE
otherwise.