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 Skein_256_Final (struct skein_256_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 Skein_256_Final (struct skein_256_ctx *ctx, u8 *hashVal);
+int Skein_512_Final (struct skein_512_ctx *ctx, u8 *hashVal);
+int Skein1024_Final (struct skein1024_ctx *ctx, u8 *hashVal);
/*
** Skein APIs for "extended" initialization: MAC keys, tree hashing.
** Final_Pad: pad, do final block, but no OUTPUT type
** Output: do just the output stage
*/
-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 Skein1024_Final_Pad(struct skein1024_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 Skein1024_Final_Pad(struct skein1024_ctx *ctx, u8 *hashVal);
#ifndef SKEIN_TREE_HASH
#define SKEIN_TREE_HASH (1)
#endif
#if SKEIN_TREE_HASH
-int Skein_256_Output (struct skein_256_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 Skein_256_Output (struct skein_256_ctx *ctx, u8 *hashVal);
+int Skein_512_Output (struct skein_512_ctx *ctx, u8 *hashVal);
+int Skein1024_Output (struct skein1024_ctx *ctx, u8 *hashVal);
#endif
/*****************************************************************
* @return
* 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.
* SKEIN_SUCESS of SKEIN_FAIL
* @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.
* @param ctx
* 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.
* @return
* 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);
/**
* Success or error code.
* @see skeinReset
*/
- int skeinFinal(struct skein_ctx* ctx, u8* hash);
+ int skeinFinal(struct skein_ctx *ctx, u8 *hash);
/**
* @}
* @param tweak
* 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).
* @param out
* 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).
* @param out
* 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).
* @param out
* 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).
* @param out
* 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 threefishEncrypt512(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 threefishDecrypt512(struct threefish_key* keyCtx, u64* input, u64* output);
- void threefishDecrypt1024(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 threefishEncrypt1024(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 threefishDecrypt1024(struct threefish_key *keyCtx, u64 *input, u64 *output);
/**
* @}
*/
#include <linux/string.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);
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;
size_t Xlen = 0;
- u64* X = NULL;
+ u64 *X = NULL;
u64 treeInfo = SKEIN_CFG_TREE_INFO_SEQUENTIAL;
Skein_Assert(ctx, SKEIN_FAIL);
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)
{
int ret = SKEIN_FAIL;
- u64* X = NULL;
+ u64 *X = NULL;
size_t Xlen = 0;
u64 treeInfo = SKEIN_CFG_TREE_INFO_SEQUENTIAL;
return ret;
}
-void skeinReset(struct skein_ctx* ctx)
+void skeinReset(struct skein_ctx *ctx)
{
size_t Xlen = 0;
- u64* X = NULL;
+ u64 *X = NULL;
/*
* The following two lines rely of the fact that the real Skein contexts are
*/
size_t length;
u8 mask;
- u8* up;
+ u8 *up;
/* 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);
return SKEIN_SUCCESS;
}
-int skeinFinal(struct skein_ctx* ctx, u8* hash)
+int skeinFinal(struct skein_ctx *ctx, u8 *hash)
{
int ret = SKEIN_FAIL;
Skein_Assert(ctx, SKEIN_FAIL);
#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],
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],
#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],
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],
b2 = input[2], b3 = input[3];
#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],
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],
#include <linux/string.h>
#include <threefishApi.h>
-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)
{
int keyWords = stateSize / 64;
int i;
keyCtx->stateSize = stateSize;
}
-void threefishEncryptBlockBytes(struct threefish_key* keyCtx, u8* in,
- u8* out)
+void threefishEncryptBlockBytes(struct threefish_key *keyCtx, u8 *in,
+ u8 *out)
{
u64 plain[SKEIN_MAX_STATE_WORDS]; /* max number of words*/
u64 cipher[SKEIN_MAX_STATE_WORDS];
Skein_Put64_LSB_First(out, cipher, keyCtx->stateSize / 8); /* words to bytes */
}
-void threefishEncryptBlockWords(struct threefish_key* keyCtx, u64* in,
- u64* out)
+void threefishEncryptBlockWords(struct threefish_key *keyCtx, u64 *in,
+ u64 *out)
{
switch (keyCtx->stateSize) {
case Threefish256:
}
}
-void threefishDecryptBlockBytes(struct threefish_key* keyCtx, u8* in,
- u8* out)
+void threefishDecryptBlockBytes(struct threefish_key *keyCtx, u8 *in,
+ u8 *out)
{
u64 plain[SKEIN_MAX_STATE_WORDS]; /* max number of words*/
u64 cipher[SKEIN_MAX_STATE_WORDS];
Skein_Put64_LSB_First(out, plain, keyCtx->stateSize / 8); /* words to bytes */
}
-void threefishDecryptBlockWords(struct threefish_key* keyCtx, u64* in,
- u64* out)
+void threefishDecryptBlockWords(struct threefish_key *keyCtx, u64 *in,
+ u64 *out)
{
switch (keyCtx->stateSize) {
case Threefish256: