Commit cd4811a6 authored by Jason Cooper's avatar Jason Cooper Committed by Greg Kroah-Hartman

staging: crypto: skein: fixup pointer whitespace

Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9761ccb
...@@ -100,9 +100,9 @@ int Skein_256_Update(struct skein_256_ctx *ctx, const u8 *msg, size_t msgByteCn ...@@ -100,9 +100,9 @@ int Skein_256_Update(struct skein_256_ctx *ctx, const u8 *msg, size_t msgByteCn
int Skein_512_Update(struct skein_512_ctx *ctx, const u8 *msg, size_t msgByteCnt); int Skein_512_Update(struct skein_512_ctx *ctx, const u8 *msg, size_t msgByteCnt);
int Skein1024_Update(struct skein1024_ctx *ctx, const u8 *msg, size_t msgByteCnt); int Skein1024_Update(struct skein1024_ctx *ctx, const u8 *msg, size_t msgByteCnt);
int Skein_256_Final (struct skein_256_ctx *ctx, u8 * hashVal); int Skein_256_Final (struct skein_256_ctx *ctx, u8 *hashVal);
int Skein_512_Final (struct skein_512_ctx *ctx, u8 * hashVal); int Skein_512_Final (struct skein_512_ctx *ctx, u8 *hashVal);
int Skein1024_Final (struct skein1024_ctx *ctx, u8 * hashVal); int Skein1024_Final (struct skein1024_ctx *ctx, u8 *hashVal);
/* /*
** Skein APIs for "extended" initialization: MAC keys, tree hashing. ** Skein APIs for "extended" initialization: MAC keys, tree hashing.
...@@ -127,17 +127,17 @@ int Skein1024_InitExt(struct skein1024_ctx *ctx, size_t hashBitLen, u64 treeInf ...@@ -127,17 +127,17 @@ int Skein1024_InitExt(struct skein1024_ctx *ctx, size_t hashBitLen, u64 treeInf
** Final_Pad: pad, do final block, but no OUTPUT type ** Final_Pad: pad, do final block, but no OUTPUT type
** Output: do just the output stage ** Output: do just the output stage
*/ */
int Skein_256_Final_Pad(struct skein_256_ctx *ctx, u8 * hashVal); int Skein_256_Final_Pad(struct skein_256_ctx *ctx, u8 *hashVal);
int Skein_512_Final_Pad(struct skein_512_ctx *ctx, u8 * hashVal); int Skein_512_Final_Pad(struct skein_512_ctx *ctx, u8 *hashVal);
int Skein1024_Final_Pad(struct skein1024_ctx *ctx, u8 * hashVal); int Skein1024_Final_Pad(struct skein1024_ctx *ctx, u8 *hashVal);
#ifndef SKEIN_TREE_HASH #ifndef SKEIN_TREE_HASH
#define SKEIN_TREE_HASH (1) #define SKEIN_TREE_HASH (1)
#endif #endif
#if SKEIN_TREE_HASH #if SKEIN_TREE_HASH
int Skein_256_Output (struct skein_256_ctx *ctx, u8 * hashVal); int Skein_256_Output (struct skein_256_ctx *ctx, u8 *hashVal);
int Skein_512_Output (struct skein_512_ctx *ctx, u8 * hashVal); int Skein_512_Output (struct skein_512_ctx *ctx, u8 *hashVal);
int Skein1024_Output (struct skein1024_ctx *ctx, u8 * hashVal); int Skein1024_Output (struct skein1024_ctx *ctx, u8 *hashVal);
#endif #endif
/***************************************************************** /*****************************************************************
......
...@@ -123,7 +123,7 @@ OTHER DEALINGS IN THE SOFTWARE. ...@@ -123,7 +123,7 @@ OTHER DEALINGS IN THE SOFTWARE.
* @return * @return
* SKEIN_SUCESS of SKEIN_FAIL * SKEIN_SUCESS of SKEIN_FAIL
*/ */
int skeinCtxPrepare(struct skein_ctx* ctx, enum skein_size size); int skeinCtxPrepare(struct skein_ctx *ctx, enum skein_size size);
/** /**
* Initialize a Skein context. * Initialize a Skein context.
...@@ -139,7 +139,7 @@ OTHER DEALINGS IN THE SOFTWARE. ...@@ -139,7 +139,7 @@ OTHER DEALINGS IN THE SOFTWARE.
* SKEIN_SUCESS of SKEIN_FAIL * SKEIN_SUCESS of SKEIN_FAIL
* @see skeinReset * @see skeinReset
*/ */
int skeinInit(struct skein_ctx* ctx, size_t hashBitLen); int skeinInit(struct skein_ctx *ctx, size_t hashBitLen);
/** /**
* Resets a Skein context for further use. * Resets a Skein context for further use.
...@@ -151,7 +151,7 @@ OTHER DEALINGS IN THE SOFTWARE. ...@@ -151,7 +151,7 @@ OTHER DEALINGS IN THE SOFTWARE.
* @param ctx * @param ctx
* Pointer to a pre-initialized Skein MAC context * Pointer to a pre-initialized Skein MAC context
*/ */
void skeinReset(struct skein_ctx* ctx); void skeinReset(struct skein_ctx *ctx);
/** /**
* Initializes a Skein context for MAC usage. * Initializes a Skein context for MAC usage.
...@@ -173,7 +173,7 @@ OTHER DEALINGS IN THE SOFTWARE. ...@@ -173,7 +173,7 @@ OTHER DEALINGS IN THE SOFTWARE.
* @return * @return
* SKEIN_SUCESS of SKEIN_FAIL * SKEIN_SUCESS of SKEIN_FAIL
*/ */
int skeinMacInit(struct skein_ctx* ctx, const u8 *key, size_t keyLen, int skeinMacInit(struct skein_ctx *ctx, const u8 *key, size_t keyLen,
size_t hashBitLen); size_t hashBitLen);
/** /**
...@@ -222,7 +222,7 @@ OTHER DEALINGS IN THE SOFTWARE. ...@@ -222,7 +222,7 @@ OTHER DEALINGS IN THE SOFTWARE.
* Success or error code. * Success or error code.
* @see skeinReset * @see skeinReset
*/ */
int skeinFinal(struct skein_ctx* ctx, u8* hash); int skeinFinal(struct skein_ctx *ctx, u8 *hash);
/** /**
* @} * @}
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
* @param tweak * @param tweak
* Pointer to the two tweak words (word has 64 bits). * Pointer to the two tweak words (word has 64 bits).
*/ */
void threefishSetKey(struct threefish_key* keyCtx, enum threefish_size stateSize, u64* keyData, u64* tweak); void threefishSetKey(struct threefish_key *keyCtx, enum threefish_size stateSize, u64 *keyData, u64 *tweak);
/** /**
* Encrypt Threefisch block (bytes). * Encrypt Threefisch block (bytes).
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
* @param out * @param out
* Pointer to cipher buffer. * Pointer to cipher buffer.
*/ */
void threefishEncryptBlockBytes(struct threefish_key* keyCtx, u8* in, u8* out); void threefishEncryptBlockBytes(struct threefish_key *keyCtx, u8 *in, u8 *out);
/** /**
* Encrypt Threefisch block (words). * Encrypt Threefisch block (words).
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
* @param out * @param out
* Pointer to cipher buffer. * Pointer to cipher buffer.
*/ */
void threefishEncryptBlockWords(struct threefish_key* keyCtx, u64* in, u64* out); void threefishEncryptBlockWords(struct threefish_key *keyCtx, u64 *in, u64 *out);
/** /**
* Decrypt Threefisch block (bytes). * Decrypt Threefisch block (bytes).
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
* @param out * @param out
* Pointer to plaintext buffer. * Pointer to plaintext buffer.
*/ */
void threefishDecryptBlockBytes(struct threefish_key* keyCtx, u8* in, u8* out); void threefishDecryptBlockBytes(struct threefish_key *keyCtx, u8 *in, u8 *out);
/** /**
* Decrypt Threefisch block (words). * Decrypt Threefisch block (words).
...@@ -144,14 +144,14 @@ ...@@ -144,14 +144,14 @@
* @param out * @param out
* Pointer to plaintext buffer. * Pointer to plaintext buffer.
*/ */
void threefishDecryptBlockWords(struct threefish_key* keyCtx, u64* in, u64* out); void threefishDecryptBlockWords(struct threefish_key *keyCtx, u64 *in, u64 *out);
void threefishEncrypt256(struct threefish_key* keyCtx, u64* input, u64* output); void threefishEncrypt256(struct threefish_key *keyCtx, u64 *input, u64 *output);
void threefishEncrypt512(struct threefish_key* keyCtx, u64* input, u64* output); void threefishEncrypt512(struct threefish_key *keyCtx, u64 *input, u64 *output);
void threefishEncrypt1024(struct threefish_key* keyCtx, u64* input, u64* output); void threefishEncrypt1024(struct threefish_key *keyCtx, u64 *input, u64 *output);
void threefishDecrypt256(struct threefish_key* keyCtx, u64* input, u64* output); void threefishDecrypt256(struct threefish_key *keyCtx, u64 *input, u64 *output);
void threefishDecrypt512(struct threefish_key* keyCtx, u64* input, u64* output); void threefishDecrypt512(struct threefish_key *keyCtx, u64 *input, u64 *output);
void threefishDecrypt1024(struct threefish_key* keyCtx, u64* input, u64* output); void threefishDecrypt1024(struct threefish_key *keyCtx, u64 *input, u64 *output);
/** /**
* @} * @}
*/ */
......
...@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE. ...@@ -27,7 +27,7 @@ OTHER DEALINGS IN THE SOFTWARE.
#include <linux/string.h> #include <linux/string.h>
#include <skeinApi.h> #include <skeinApi.h>
int skeinCtxPrepare(struct skein_ctx* ctx, enum skein_size size) int skeinCtxPrepare(struct skein_ctx *ctx, enum skein_size size)
{ {
Skein_Assert(ctx && size, SKEIN_FAIL); Skein_Assert(ctx && size, SKEIN_FAIL);
...@@ -37,11 +37,11 @@ int skeinCtxPrepare(struct skein_ctx* ctx, enum skein_size size) ...@@ -37,11 +37,11 @@ int skeinCtxPrepare(struct skein_ctx* ctx, enum skein_size size)
return SKEIN_SUCCESS; return SKEIN_SUCCESS;
} }
int skeinInit(struct skein_ctx* ctx, size_t hashBitLen) int skeinInit(struct skein_ctx *ctx, size_t hashBitLen)
{ {
int ret = SKEIN_FAIL; int ret = SKEIN_FAIL;
size_t Xlen = 0; size_t Xlen = 0;
u64* X = NULL; u64 *X = NULL;
u64 treeInfo = SKEIN_CFG_TREE_INFO_SEQUENTIAL; u64 treeInfo = SKEIN_CFG_TREE_INFO_SEQUENTIAL;
Skein_Assert(ctx, SKEIN_FAIL); Skein_Assert(ctx, SKEIN_FAIL);
...@@ -78,11 +78,11 @@ int skeinInit(struct skein_ctx* ctx, size_t hashBitLen) ...@@ -78,11 +78,11 @@ int skeinInit(struct skein_ctx* ctx, size_t hashBitLen)
return ret; return ret;
} }
int skeinMacInit(struct skein_ctx* ctx, const u8 *key, size_t keyLen, int skeinMacInit(struct skein_ctx *ctx, const u8 *key, size_t keyLen,
size_t hashBitLen) size_t hashBitLen)
{ {
int ret = SKEIN_FAIL; int ret = SKEIN_FAIL;
u64* X = NULL; u64 *X = NULL;
size_t Xlen = 0; size_t Xlen = 0;
u64 treeInfo = SKEIN_CFG_TREE_INFO_SEQUENTIAL; u64 treeInfo = SKEIN_CFG_TREE_INFO_SEQUENTIAL;
...@@ -119,10 +119,10 @@ int skeinMacInit(struct skein_ctx* ctx, const u8 *key, size_t keyLen, ...@@ -119,10 +119,10 @@ int skeinMacInit(struct skein_ctx* ctx, const u8 *key, size_t keyLen,
return ret; return ret;
} }
void skeinReset(struct skein_ctx* ctx) void skeinReset(struct skein_ctx *ctx)
{ {
size_t Xlen = 0; size_t Xlen = 0;
u64* X = NULL; u64 *X = NULL;
/* /*
* The following two lines rely of the fact that the real Skein contexts are * The following two lines rely of the fact that the real Skein contexts are
...@@ -169,7 +169,7 @@ int skeinUpdateBits(struct skein_ctx *ctx, const u8 *msg, ...@@ -169,7 +169,7 @@ int skeinUpdateBits(struct skein_ctx *ctx, const u8 *msg,
*/ */
size_t length; size_t length;
u8 mask; u8 mask;
u8* up; u8 *up;
/* only the final Update() call is allowed do partial bytes, else assert an error */ /* only the final Update() call is allowed do partial bytes, else assert an error */
Skein_Assert((ctx->m.h.T[1] & SKEIN_T1_FLAG_BIT_PAD) == 0 || msgBitCnt == 0, SKEIN_FAIL); Skein_Assert((ctx->m.h.T[1] & SKEIN_T1_FLAG_BIT_PAD) == 0 || msgBitCnt == 0, SKEIN_FAIL);
...@@ -199,7 +199,7 @@ int skeinUpdateBits(struct skein_ctx *ctx, const u8 *msg, ...@@ -199,7 +199,7 @@ int skeinUpdateBits(struct skein_ctx *ctx, const u8 *msg,
return SKEIN_SUCCESS; return SKEIN_SUCCESS;
} }
int skeinFinal(struct skein_ctx* ctx, u8* hash) int skeinFinal(struct skein_ctx *ctx, u8 *hash)
{ {
int ret = SKEIN_FAIL; int ret = SKEIN_FAIL;
Skein_Assert(ctx, SKEIN_FAIL); Skein_Assert(ctx, SKEIN_FAIL);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <threefishApi.h> #include <threefishApi.h>
void threefishEncrypt1024(struct threefish_key* keyCtx, u64* input, u64* output) void threefishEncrypt1024(struct threefish_key *keyCtx, u64 *input, u64 *output)
{ {
u64 b0 = input[0], b1 = input[1], u64 b0 = input[0], b1 = input[1],
...@@ -684,7 +684,7 @@ void threefishEncrypt1024(struct threefish_key* keyCtx, u64* input, u64* output) ...@@ -684,7 +684,7 @@ void threefishEncrypt1024(struct threefish_key* keyCtx, u64* input, u64* output)
output[15] = b15 + k1 + 20; output[15] = b15 + k1 + 20;
} }
void threefishDecrypt1024(struct threefish_key* keyCtx, u64* input, u64* output) void threefishDecrypt1024(struct threefish_key *keyCtx, u64 *input, u64 *output)
{ {
u64 b0 = input[0], b1 = input[1], u64 b0 = input[0], b1 = input[1],
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <threefishApi.h> #include <threefishApi.h>
void threefishEncrypt256(struct threefish_key* keyCtx, u64* input, u64* output) void threefishEncrypt256(struct threefish_key *keyCtx, u64 *input, u64 *output)
{ {
u64 b0 = input[0], b1 = input[1], u64 b0 = input[0], b1 = input[1],
...@@ -172,7 +172,7 @@ void threefishEncrypt256(struct threefish_key* keyCtx, u64* input, u64* output) ...@@ -172,7 +172,7 @@ void threefishEncrypt256(struct threefish_key* keyCtx, u64* input, u64* output)
output[3] = b3 + k1 + 18; output[3] = b3 + k1 + 18;
} }
void threefishDecrypt256(struct threefish_key* keyCtx, u64* input, u64* output) void threefishDecrypt256(struct threefish_key *keyCtx, u64 *input, u64 *output)
{ {
u64 b0 = input[0], b1 = input[1], u64 b0 = input[0], b1 = input[1],
b2 = input[2], b3 = input[3]; b2 = input[2], b3 = input[3];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <threefishApi.h> #include <threefishApi.h>
void threefishEncrypt512(struct threefish_key* keyCtx, u64* input, u64* output) void threefishEncrypt512(struct threefish_key *keyCtx, u64 *input, u64 *output)
{ {
u64 b0 = input[0], b1 = input[1], u64 b0 = input[0], b1 = input[1],
...@@ -316,7 +316,7 @@ void threefishEncrypt512(struct threefish_key* keyCtx, u64* input, u64* output) ...@@ -316,7 +316,7 @@ void threefishEncrypt512(struct threefish_key* keyCtx, u64* input, u64* output)
output[7] = b7 + k7 + 18; output[7] = b7 + k7 + 18;
} }
void threefishDecrypt512(struct threefish_key* keyCtx, u64* input, u64* output) void threefishDecrypt512(struct threefish_key *keyCtx, u64 *input, u64 *output)
{ {
u64 b0 = input[0], b1 = input[1], u64 b0 = input[0], b1 = input[1],
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#include <linux/string.h> #include <linux/string.h>
#include <threefishApi.h> #include <threefishApi.h>
void threefishSetKey(struct threefish_key* keyCtx, enum threefish_size stateSize, void threefishSetKey(struct threefish_key *keyCtx, enum threefish_size stateSize,
u64* keyData, u64* tweak) u64 *keyData, u64 *tweak)
{ {
int keyWords = stateSize / 64; int keyWords = stateSize / 64;
int i; int i;
...@@ -22,8 +22,8 @@ void threefishSetKey(struct threefish_key* keyCtx, enum threefish_size stateSize ...@@ -22,8 +22,8 @@ void threefishSetKey(struct threefish_key* keyCtx, enum threefish_size stateSize
keyCtx->stateSize = stateSize; keyCtx->stateSize = stateSize;
} }
void threefishEncryptBlockBytes(struct threefish_key* keyCtx, u8* in, void threefishEncryptBlockBytes(struct threefish_key *keyCtx, u8 *in,
u8* out) u8 *out)
{ {
u64 plain[SKEIN_MAX_STATE_WORDS]; /* max number of words*/ u64 plain[SKEIN_MAX_STATE_WORDS]; /* max number of words*/
u64 cipher[SKEIN_MAX_STATE_WORDS]; u64 cipher[SKEIN_MAX_STATE_WORDS];
...@@ -33,8 +33,8 @@ void threefishEncryptBlockBytes(struct threefish_key* keyCtx, u8* in, ...@@ -33,8 +33,8 @@ void threefishEncryptBlockBytes(struct threefish_key* keyCtx, u8* in,
Skein_Put64_LSB_First(out, cipher, keyCtx->stateSize / 8); /* words to bytes */ Skein_Put64_LSB_First(out, cipher, keyCtx->stateSize / 8); /* words to bytes */
} }
void threefishEncryptBlockWords(struct threefish_key* keyCtx, u64* in, void threefishEncryptBlockWords(struct threefish_key *keyCtx, u64 *in,
u64* out) u64 *out)
{ {
switch (keyCtx->stateSize) { switch (keyCtx->stateSize) {
case Threefish256: case Threefish256:
...@@ -49,8 +49,8 @@ void threefishEncryptBlockWords(struct threefish_key* keyCtx, u64* in, ...@@ -49,8 +49,8 @@ void threefishEncryptBlockWords(struct threefish_key* keyCtx, u64* in,
} }
} }
void threefishDecryptBlockBytes(struct threefish_key* keyCtx, u8* in, void threefishDecryptBlockBytes(struct threefish_key *keyCtx, u8 *in,
u8* out) u8 *out)
{ {
u64 plain[SKEIN_MAX_STATE_WORDS]; /* max number of words*/ u64 plain[SKEIN_MAX_STATE_WORDS]; /* max number of words*/
u64 cipher[SKEIN_MAX_STATE_WORDS]; u64 cipher[SKEIN_MAX_STATE_WORDS];
...@@ -60,8 +60,8 @@ void threefishDecryptBlockBytes(struct threefish_key* keyCtx, u8* in, ...@@ -60,8 +60,8 @@ void threefishDecryptBlockBytes(struct threefish_key* keyCtx, u8* in,
Skein_Put64_LSB_First(out, plain, keyCtx->stateSize / 8); /* words to bytes */ Skein_Put64_LSB_First(out, plain, keyCtx->stateSize / 8); /* words to bytes */
} }
void threefishDecryptBlockWords(struct threefish_key* keyCtx, u64* in, void threefishDecryptBlockWords(struct threefish_key *keyCtx, u64 *in,
u64* out) u64 *out)
{ {
switch (keyCtx->stateSize) { switch (keyCtx->stateSize) {
case Threefish256: case Threefish256:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment