rijndael (9)
Leading comments
Copyright (c) 2002
Mark R V Murray. All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer...
(The comments found at the beginning of the groff file "man9/rijndael.9freebsd".)
NAME
rijndael_makeKey
rijndael_cipherInit
rijndael_blockEncrypt
rijndael_padEncrypt
rijndael_blockDecrypt
rijndael_padDecrypt
- AES encryption
SYNOPSIS
In sys/types.h
In crypto/rijndael.h
Ft int
Fo rijndael_makeKey
Fa keyInstance *key
Fa uint8_t direction
Fa int keyLen
Fa char *keyMaterial
Fc Ft int
Fo rijndael_cipherInit
Fa cipherInstance *cipher
Fa uint8_t mode
Fa char *IV
Fc Ft int
Fo rijndael_blockEncrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa uint8_t *input
Fa int inputLen
Fa uint8_t *outBuffer
Fc Ft int
Fo rijndael_padEncrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa uint8_t *input
Fa int inputOctets
Fa uint8_t *outBuffer
Fc Ft int
Fo rijndael_blockDecrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa uint8_t *input
Fa int inputLen
Fa uint8_t *outBuffer
Fc Ft int
Fo rijndael_padDecrypt
Fa cipherInstance *cipher
Fa keyInstance *key
Fa uint8_t *input
Fa int inputOctets
Fa uint8_t *outBuffer
Fc
DESCRIPTION
The
Fn 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
ifconfig
sources,
BINARY_KEY_MATERIAL
RETURN VALUES
The
Fn 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_DECRYPT
BAD_KEY_MAT
if the key materials are not a hexadecimal string
(and binary keys are not set),
and
TRUE
otherwise.
AUTHORS
An Mark R V Murray