summaryrefslogtreecommitdiff
path: root/crypto/tomcrypt_cipher.h
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-11-22 08:56:40 +0300
committerDmitry Kozlov <xeb@mail.ru>2014-11-22 08:56:40 +0300
commit81ca3923a29ea9b67f7291be23b210019546aa5f (patch)
treefcebf0d426665b4f06e01168f27cd8f9ab8c50d8 /crypto/tomcrypt_cipher.h
parent830c399cf126f6bf1e8dfa1ad919a3ce8e346c5d (diff)
downloadaccel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.tar.gz
accel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.zip
remove trailing whitespaces
Diffstat (limited to 'crypto/tomcrypt_cipher.h')
-rw-r--r--crypto/tomcrypt_cipher.h136
1 files changed, 68 insertions, 68 deletions
diff --git a/crypto/tomcrypt_cipher.h b/crypto/tomcrypt_cipher.h
index c7bab4f3..24e1f781 100644
--- a/crypto/tomcrypt_cipher.h
+++ b/crypto/tomcrypt_cipher.h
@@ -1,6 +1,6 @@
/* ---- SYMMETRIC KEY STUFF -----
*
- * We put each of the ciphers scheduled keys in their own structs then we put all of
+ * We put each of the ciphers scheduled keys in their own structs then we put all of
* the key formats in one union. This makes the function prototypes easier to use.
*/
#ifdef LTC_BLOWFISH
@@ -110,7 +110,7 @@ struct noekeon_key {
};
#endif
-#ifdef LTC_SKIPJACK
+#ifdef LTC_SKIPJACK
struct skipjack_key {
unsigned char key[10];
};
@@ -118,18 +118,18 @@ struct skipjack_key {
#ifdef LTC_KHAZAD
struct khazad_key {
- ulong64 roundKeyEnc[8 + 1];
- ulong64 roundKeyDec[8 + 1];
+ ulong64 roundKeyEnc[8 + 1];
+ ulong64 roundKeyDec[8 + 1];
};
#endif
#ifdef LTC_ANUBIS
-struct anubis_key {
- int keyBits;
- int R;
- ulong32 roundKeyEnc[18 + 1][4];
- ulong32 roundKeyDec[18 + 1][4];
-};
+struct anubis_key {
+ int keyBits;
+ int R;
+ ulong32 roundKeyEnc[18 + 1][4];
+ ulong32 roundKeyDec[18 + 1][4];
+};
#endif
#ifdef LTC_MULTI2
@@ -178,7 +178,7 @@ typedef union Symmetric_key {
#endif
#ifdef LTC_NOEKEON
struct noekeon_key noekeon;
-#endif
+#endif
#ifdef LTC_SKIPJACK
struct skipjack_key skipjack;
#endif
@@ -193,7 +193,7 @@ typedef union Symmetric_key {
#endif
#ifdef LTC_KASUMI
struct kasumi_key kasumi;
-#endif
+#endif
#ifdef LTC_MULTI2
struct multi2_key multi2;
#endif
@@ -204,10 +204,10 @@ typedef union Symmetric_key {
/** A block cipher ECB structure */
typedef struct {
/** The index of the cipher chosen */
- int cipher,
+ int cipher,
/** The block size of the given cipher */
blocklen;
- /** The scheduled key */
+ /** The scheduled key */
symmetric_key key;
} symmetric_ECB;
#endif
@@ -216,14 +216,14 @@ typedef struct {
/** A block cipher CFB structure */
typedef struct {
/** The index of the cipher chosen */
- int cipher,
- /** The block size of the given cipher */
- blocklen,
+ int cipher,
+ /** The block size of the given cipher */
+ blocklen,
/** The padding offset */
padlen;
/** The current IV */
- unsigned char IV[MAXBLOCKSIZE],
- /** The pad used to encrypt/decrypt */
+ unsigned char IV[MAXBLOCKSIZE],
+ /** The pad used to encrypt/decrypt */
pad[MAXBLOCKSIZE];
/** The scheduled key */
symmetric_key key;
@@ -234,9 +234,9 @@ typedef struct {
/** A block cipher OFB structure */
typedef struct {
/** The index of the cipher chosen */
- int cipher,
- /** The block size of the given cipher */
- blocklen,
+ int cipher,
+ /** The block size of the given cipher */
+ blocklen,
/** The padding offset */
padlen;
/** The current IV */
@@ -250,8 +250,8 @@ typedef struct {
/** A block cipher CBC structure */
typedef struct {
/** The index of the cipher chosen */
- int cipher,
- /** The block size of the given cipher */
+ int cipher,
+ /** The block size of the given cipher */
blocklen;
/** The current IV */
unsigned char IV[MAXBLOCKSIZE];
@@ -266,18 +266,18 @@ typedef struct {
typedef struct {
/** The index of the cipher chosen */
int cipher,
- /** The block size of the given cipher */
- blocklen,
+ /** The block size of the given cipher */
+ blocklen,
/** The padding offset */
- padlen,
+ padlen,
/** The mode (endianess) of the CTR, 0==little, 1==big */
mode,
/** counter width */
ctrlen;
- /** The counter */
- unsigned char ctr[MAXBLOCKSIZE],
- /** The pad used to encrypt/decrypt */
+ /** The counter */
+ unsigned char ctr[MAXBLOCKSIZE],
+ /** The pad used to encrypt/decrypt */
pad[MAXBLOCKSIZE];
/** The scheduled key */
symmetric_key key;
@@ -293,7 +293,7 @@ typedef struct {
/** The current IV */
unsigned char IV[16],
-
+
/** the tweak key */
tweak[16],
@@ -314,9 +314,9 @@ typedef struct {
/** A block cipher F8 structure */
typedef struct {
/** The index of the cipher chosen */
- int cipher,
- /** The block size of the given cipher */
- blocklen,
+ int cipher,
+ /** The block size of the given cipher */
+ blocklen,
/** The padding offset */
padlen;
/** The current IV */
@@ -337,14 +337,14 @@ extern struct ltc_cipher_descriptor {
/** internal ID */
unsigned char ID;
/** min keysize (octets) */
- int min_key_length,
+ int min_key_length,
/** max keysize (octets) */
- max_key_length,
+ max_key_length,
/** block size (octets) */
- block_length,
+ block_length,
/** default number of rounds */
default_rounds;
- /** Setup the cipher
+ /** Setup the cipher
@param key The input symmetric key
@param keylen The length of the input key (octets)
@param num_rounds The requested number of rounds (0==default)
@@ -371,10 +371,10 @@ extern struct ltc_cipher_descriptor {
*/
int (*test)(void);
- /** Terminate the context
+ /** Terminate the context
@param skey The scheduled key
*/
- void (*done)(symmetric_key *skey);
+ void (*done)(symmetric_key *skey);
/** Determine a key size
@param keysize [in/out] The size of the key desired and the suggested size
@@ -383,7 +383,7 @@ extern struct ltc_cipher_descriptor {
int (*keysize)(int *keysize);
/** Accelerators **/
- /** Accelerated ECB encryption
+ /** Accelerated ECB encryption
@param pt Plaintext
@param ct Ciphertext
@param blocks The number of complete blocks to process
@@ -392,7 +392,7 @@ extern struct ltc_cipher_descriptor {
*/
int (*accel_ecb_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, symmetric_key *skey);
- /** Accelerated ECB decryption
+ /** Accelerated ECB decryption
@param pt Plaintext
@param ct Ciphertext
@param blocks The number of complete blocks to process
@@ -401,7 +401,7 @@ extern struct ltc_cipher_descriptor {
*/
int (*accel_ecb_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, symmetric_key *skey);
- /** Accelerated CBC encryption
+ /** Accelerated CBC encryption
@param pt Plaintext
@param ct Ciphertext
@param blocks The number of complete blocks to process
@@ -411,7 +411,7 @@ extern struct ltc_cipher_descriptor {
*/
int (*accel_cbc_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, symmetric_key *skey);
- /** Accelerated CBC decryption
+ /** Accelerated CBC decryption
@param pt Plaintext
@param ct Ciphertext
@param blocks The number of complete blocks to process
@@ -421,7 +421,7 @@ extern struct ltc_cipher_descriptor {
*/
int (*accel_cbc_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, symmetric_key *skey);
- /** Accelerated CTR encryption
+ /** Accelerated CTR encryption
@param pt Plaintext
@param ct Ciphertext
@param blocks The number of complete blocks to process
@@ -432,7 +432,7 @@ extern struct ltc_cipher_descriptor {
*/
int (*accel_ctr_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, int mode, symmetric_key *skey);
- /** Accelerated LRW
+ /** Accelerated LRW
@param pt Plaintext
@param ct Ciphertext
@param blocks The number of complete blocks to process
@@ -443,7 +443,7 @@ extern struct ltc_cipher_descriptor {
*/
int (*accel_lrw_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey);
- /** Accelerated LRW
+ /** Accelerated LRW
@param ct Ciphertext
@param pt Plaintext
@param blocks The number of complete blocks to process
@@ -483,7 +483,7 @@ extern struct ltc_cipher_descriptor {
/** Accelerated GCM packet (one shot)
@param key The secret key
@param keylen The length of the secret key
- @param IV The initial vector
+ @param IV The initial vector
@param IVlen The length of the initial vector
@param adata The additional authentication data (header)
@param adatalen The length of the adata
@@ -500,14 +500,14 @@ extern struct ltc_cipher_descriptor {
const unsigned char *IV, unsigned long IVlen,
const unsigned char *adata, unsigned long adatalen,
unsigned char *pt, unsigned long ptlen,
- unsigned char *ct,
+ unsigned char *ct,
unsigned char *tag, unsigned long *taglen,
int direction);
- /** Accelerated one shot LTC_OMAC
+ /** Accelerated one shot LTC_OMAC
@param key The secret key
- @param keylen The key length (octets)
- @param in The message
+ @param keylen The key length (octets)
+ @param in The message
@param inlen Length of message (octets)
@param out [out] Destination for tag
@param outlen [in/out] Initial and final size of out
@@ -518,10 +518,10 @@ extern struct ltc_cipher_descriptor {
const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen);
- /** Accelerated one shot XCBC
+ /** Accelerated one shot XCBC
@param key The secret key
- @param keylen The key length (octets)
- @param in The message
+ @param keylen The key length (octets)
+ @param in The message
@param inlen Length of message (octets)
@param out [out] Destination for tag
@param outlen [in/out] Initial and final size of out
@@ -532,10 +532,10 @@ extern struct ltc_cipher_descriptor {
const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen);
- /** Accelerated one shot F9
+ /** Accelerated one shot F9
@param key The secret key
- @param keylen The key length (octets)
- @param in The message
+ @param keylen The key length (octets)
+ @param in The message
@param inlen Length of message (octets)
@param out [out] Destination for tag
@param outlen [in/out] Initial and final size of out
@@ -763,7 +763,7 @@ extern const struct ltc_cipher_descriptor multi2_desc;
#endif
#ifdef LTC_ECB_MODE
-int ecb_start(int cipher, const unsigned char *key,
+int ecb_start(int cipher, const unsigned char *key,
int keylen, int num_rounds, symmetric_ECB *ecb);
int ecb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_ECB *ecb);
int ecb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_ECB *ecb);
@@ -771,7 +771,7 @@ int ecb_done(symmetric_ECB *ecb);
#endif
#ifdef LTC_CFB_MODE
-int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key,
+int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key,
int keylen, int num_rounds, symmetric_CFB *cfb);
int cfb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CFB *cfb);
int cfb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CFB *cfb);
@@ -781,7 +781,7 @@ int cfb_done(symmetric_CFB *cfb);
#endif
#ifdef LTC_OFB_MODE
-int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key,
+int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key,
int keylen, int num_rounds, symmetric_OFB *ofb);
int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_OFB *ofb);
int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_OFB *ofb);
@@ -828,7 +828,7 @@ int lrw_start( int cipher,
const unsigned char *IV,
const unsigned char *key, int keylen,
const unsigned char *tweak,
- int num_rounds,
+ int num_rounds,
symmetric_LRW *lrw);
int lrw_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_LRW *lrw);
int lrw_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_LRW *lrw);
@@ -839,11 +839,11 @@ int lrw_test(void);
/* don't call */
int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, int mode, symmetric_LRW *lrw);
-#endif
+#endif
#ifdef LTC_F8_MODE
-int f8_start( int cipher, const unsigned char *IV,
- const unsigned char *key, int keylen,
+int f8_start( int cipher, const unsigned char *IV,
+ const unsigned char *key, int keylen,
const unsigned char *salt_key, int skeylen,
int num_rounds, symmetric_F8 *f8);
int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_F8 *f8);
@@ -861,10 +861,10 @@ typedef struct {
} symmetric_xts;
int xts_start( int cipher,
- const unsigned char *key1,
- const unsigned char *key2,
+ const unsigned char *key1,
+ const unsigned char *key2,
unsigned long keylen,
- int num_rounds,
+ int num_rounds,
symmetric_xts *xts);
int xts_encrypt(