logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

rijndael_makeKey, rijndael_cipherInit, rijndael_blockEncrypt, rijndael_padEncrypt, rijndael_blockDecrypt,

Authors

       Mark R V Murray

Debian                                          February 6, 2002                                     RIJNDAEL(9)

Description

       The  rijndael_makeKey()  function is used to set up the key schedule in key.  The 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  keyLen,  and  must be 128, 192 or 256.  The actual key is supplied in the buffer pointed to by
       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  rijndael_makeKey   sources,
       BINARY_KEY_MATERIAL.

Name

       rijndael_makeKey, rijndael_cipherInit, rijndael_blockEncrypt, rijndael_padEncrypt, rijndael_blockDecrypt,
       rijndael_padDecrypt — AES encryption

Return Values

       The  rijndael_makeKey()  function  will  return  BAD_KEY_INSTANCE if a NULL key is passed, BAD_KEY_DIR if
       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.

Synopsis

#include<sys/types.h>#include<crypto/rijndael.h>intrijndael_makeKey(keyInstance*key, uint8_tdirection, intkeyLen, char*keyMaterial);

       intrijndael_cipherInit(cipherInstance*cipher, uint8_tmode, char*IV);

       intrijndael_blockEncrypt(cipherInstance*cipher,     keyInstance*key,     uint8_t*input,     intinputLen,
           uint8_t*outBuffer);

       intrijndael_padEncrypt(cipherInstance*cipher,    keyInstance*key,     uint8_t*input,     intinputOctets,
           uint8_t*outBuffer);

       intrijndael_blockDecrypt(cipherInstance*cipher,     keyInstance*key,     uint8_t*input,     intinputLen,
           uint8_t*outBuffer);

       intrijndael_padDecrypt(cipherInstance*cipher,    keyInstance*key,     uint8_t*input,     intinputOctets,
           uint8_t*outBuffer);

See Also