*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
- RIJNDAEL_DIR_ENCRYPT = 0, /* Are we encrypting? */
- RIJNDAEL_DIR_DECRYPT = 1 /* Are we decrypting? */
+ RIJNDAEL_DIR_ENCRYPT = 0, /* Are we encrypting? */
+ RIJNDAEL_DIR_DECRYPT = 1 /* Are we decrypting? */
- RIJNDAEL_MODE_ECB = 1, /* Are we ciphering in ECB mode? */
- RIJNDAEL_MODE_CBC = 2, /* Are we ciphering in CBC mode? */
- RIJNDAEL_MODE_CFB1 = 3 /* Are we ciphering in 1-bit CFB mode? */
+ RIJNDAEL_MODE_ECB = 1, /* Are we ciphering in ECB mode? */
+ RIJNDAEL_MODE_CBC = 2, /* Are we ciphering in CBC mode? */
+ RIJNDAEL_MODE_CFB1 = 3 /* Are we ciphering in 1-bit CFB mode? */
-{ /* changed order of the components */
- rijndael_mode mode; /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
+{ /* changed order of the components */
+ rijndael_mode mode; /* MODE_ECB, MODE_CBC, or MODE_CFB1 */
/* A possible Initialization Vector for ciphering */
char IV[RIJNDAEL_MAX_IV_SIZE];
} rijndaelCipherInstance;
/* A possible Initialization Vector for ciphering */
char IV[RIJNDAEL_MAX_IV_SIZE];
} rijndaelCipherInstance;
128, 192 or 256. Returns 0 on success, or an error code. */
extern rijndael_rc
rijndaelMakeKey (rijndaelKeyInstance *key, rijndael_direction direction,
128, 192 or 256. Returns 0 on success, or an error code. */
extern rijndael_rc
rijndaelMakeKey (rijndaelKeyInstance *key, rijndael_direction direction,
/* Initialize cipher state CIPHER for encryption MODE (e.g.,
RIJNDAEL_MODE_CBC) with initialization vector IV, a hex string of
/* Initialize cipher state CIPHER for encryption MODE (e.g.,
RIJNDAEL_MODE_CBC) with initialization vector IV, a hex string of
not need an IV (i.e., RIJNDAEL_MODE_ECB). */
extern rijndael_rc
rijndaelCipherInit (rijndaelCipherInstance *cipher,
not need an IV (i.e., RIJNDAEL_MODE_ECB). */
extern rijndael_rc
rijndaelCipherInit (rijndaelCipherInstance *cipher,
/* Encrypt data in INPUT, of INPUTLEN/8 bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
/* Encrypt data in INPUT, of INPUTLEN/8 bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
negative rijndael_rc error code. */
extern int
rijndaelBlockEncrypt (rijndaelCipherInstance *cipher,
negative rijndael_rc error code. */
extern int
rijndaelBlockEncrypt (rijndaelCipherInstance *cipher,
- const rijndaelKeyInstance *key,
- const char *input, size_t inputLen,
- char *outBuffer);
+ const rijndaelKeyInstance *key,
+ const char *input, size_t inputLen,
+ char *outBuffer);
/* Encrypt data in INPUT, of INPUTOCTETS bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
/* Encrypt data in INPUT, of INPUTOCTETS bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
negative rijndael_rc error code. */
extern int
rijndaelPadEncrypt (rijndaelCipherInstance *cipher,
negative rijndael_rc error code. */
extern int
rijndaelPadEncrypt (rijndaelCipherInstance *cipher,
- const rijndaelKeyInstance *key,
- const char *input, size_t inputOctets,
- char *outBuffer);
+ const rijndaelKeyInstance *key,
+ const char *input, size_t inputOctets,
+ char *outBuffer);
/* Decrypt data in INPUT, of INPUTLEN/8 bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
/* Decrypt data in INPUT, of INPUTLEN/8 bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
negative rijndael_rc error code. */
extern int
rijndaelBlockDecrypt (rijndaelCipherInstance *cipher,
negative rijndael_rc error code. */
extern int
rijndaelBlockDecrypt (rijndaelCipherInstance *cipher,
- const rijndaelKeyInstance *key,
- const char *input, size_t inputLen,
- char *outBuffer);
+ const rijndaelKeyInstance *key,
+ const char *input, size_t inputLen,
+ char *outBuffer);
/* Decrypt data in INPUT, of INPUTOCTETS bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
/* Decrypt data in INPUT, of INPUTOCTETS bytes length, placing the
output in the pre-allocated OUTBUFFER which must hold at least
negative rijndael_rc error code. */
extern int
rijndaelPadDecrypt (rijndaelCipherInstance *cipher,
negative rijndael_rc error code. */
extern int
rijndaelPadDecrypt (rijndaelCipherInstance *cipher,
- const rijndaelKeyInstance *key,
- const char *input, size_t inputOctets,
- char *outBuffer);
+ const rijndaelKeyInstance *key,
+ const char *input, size_t inputOctets,
+ char *outBuffer);