Slash and burn EOL whitespace everywhere
This commit is contained in:
parent
d64c963e5e
commit
02240eff8c
94 changed files with 1059 additions and 1059 deletions
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* This work is based on the implementation of
|
||||
* Soeren S. Thomsen and Krystian Matusiewicz
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -22,7 +22,7 @@ const uint8_t indices_cyclic[15] = {0,1,2,3,4,5,6,7,0,1,2,3,4,5,6};
|
|||
#define ROTATE_COLUMN_DOWN(v1, v2, amount_bytes, temp_var) {temp_var = (v1<<(8*amount_bytes))|(v2>>(8*(4-amount_bytes))); \
|
||||
v2 = (v2<<(8*amount_bytes))|(v1>>(8*(4-amount_bytes))); \
|
||||
v1 = temp_var;}
|
||||
|
||||
|
||||
|
||||
#define COLUMN(x,y,i,c0,c1,c2,c3,c4,c5,c6,c7,tv1,tv2,tu,tl,t) \
|
||||
tu = T[2*(uint32_t)x[4*c0+0]]; \
|
||||
|
@ -161,11 +161,11 @@ static void F512(uint32_t *h, const uint32_t *m) {
|
|||
|
||||
/* digest up to msglen bytes of input (full blocks only) */
|
||||
static void Transform(groestlHashState *ctx,
|
||||
const uint8_t *input,
|
||||
const uint8_t *input,
|
||||
int msglen) {
|
||||
|
||||
/* digest message, one block at a time */
|
||||
for (; msglen >= SIZE512;
|
||||
for (; msglen >= SIZE512;
|
||||
msglen -= SIZE512, input += SIZE512) {
|
||||
F512(ctx->chaining,(uint32_t*)input);
|
||||
|
||||
|
@ -199,7 +199,7 @@ static void OutputTransformation(groestlHashState *ctx) {
|
|||
RND512P((uint8_t*)y, temp, 0x00000009);
|
||||
for (j = 0; j < 2*COLS512; j++) {
|
||||
ctx->chaining[j] ^= temp[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* initialise context */
|
||||
|
@ -313,7 +313,7 @@ static void Final(groestlHashState* ctx,
|
|||
ctx->block_counter2 >>= 8;
|
||||
}
|
||||
/* digest final padding block */
|
||||
Transform(ctx, ctx->buffer, SIZE512);
|
||||
Transform(ctx, ctx->buffer, SIZE512);
|
||||
/* perform output transformation */
|
||||
OutputTransformation(ctx);
|
||||
|
||||
|
@ -332,7 +332,7 @@ static void Final(groestlHashState* ctx,
|
|||
}
|
||||
|
||||
/* hash bit sequence */
|
||||
void groestl(const BitSequence* data,
|
||||
void groestl(const BitSequence* data,
|
||||
DataLength databitlen,
|
||||
BitSequence* hashval) {
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
#include "crypto_uint8.h"
|
||||
#include "crypto_uint32.h"
|
||||
#include "crypto_uint64.h"
|
||||
#include "crypto_hash.h"
|
||||
#include "crypto_hash.h"
|
||||
|
||||
typedef crypto_uint8 uint8_t;
|
||||
typedef crypto_uint32 uint32_t;
|
||||
typedef crypto_uint8 uint8_t;
|
||||
typedef crypto_uint32 uint32_t;
|
||||
typedef crypto_uint64 uint64_t;
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
** Source code author: Doug Whiting, 2008.
|
||||
**
|
||||
** This algorithm and source code is released to the public domain.
|
||||
**
|
||||
**
|
||||
************************************************************************/
|
||||
|
||||
#define SKEIN_PORT_CODE /* instantiate any code in skein_port.h */
|
||||
|
@ -57,7 +57,7 @@ static int Skein_512_Final (Skein_512_Ctxt_t *ctx, u08b_t * hashVal);
|
|||
|
||||
/*****************************************************************
|
||||
** "Internal" Skein definitions
|
||||
** -- not needed for sequential hashing API, but will be
|
||||
** -- not needed for sequential hashing API, but will be
|
||||
** helpful for other uses of Skein (e.g., tree hash mode).
|
||||
** -- included here so that they can be shared between
|
||||
** reference and optimized code.
|
||||
|
@ -179,11 +179,11 @@ static int Skein_512_Final (Skein_512_Ctxt_t *ctx, u08b_t * hashVal);
|
|||
#define Skein_Assert(x,retCode)/* default: ignore all Asserts, for performance */
|
||||
#define Skein_assert(x)
|
||||
#elif defined(SKEIN_ASSERT)
|
||||
#include <assert.h>
|
||||
#define Skein_Assert(x,retCode) assert(x)
|
||||
#define Skein_assert(x) assert(x)
|
||||
#include <assert.h>
|
||||
#define Skein_Assert(x,retCode) assert(x)
|
||||
#define Skein_assert(x) assert(x)
|
||||
#else
|
||||
#include <assert.h>
|
||||
#include <assert.h>
|
||||
#define Skein_Assert(x,retCode) { if (!(x)) return retCode; } /* caller error */
|
||||
#define Skein_assert(x) assert(x) /* internal error */
|
||||
#endif
|
||||
|
@ -191,8 +191,8 @@ static int Skein_512_Final (Skein_512_Ctxt_t *ctx, u08b_t * hashVal);
|
|||
/*****************************************************************
|
||||
** Skein block function constants (shared across Ref and Opt code)
|
||||
******************************************************************/
|
||||
enum
|
||||
{
|
||||
enum
|
||||
{
|
||||
/* Skein_512 round rotation constants */
|
||||
R_512_0_0=46, R_512_0_1=36, R_512_0_2=19, R_512_0_3=37,
|
||||
R_512_1_0=33, R_512_1_1=27, R_512_1_2=14, R_512_1_3=42,
|
||||
|
@ -251,7 +251,7 @@ const u64b_t SKEIN_512_IV_256[] =
|
|||
#define BLK_BITS (WCNT*64) /* some useful definitions for code here */
|
||||
#define KW_TWK_BASE (0)
|
||||
#define KW_KEY_BASE (3)
|
||||
#define ks (kw + KW_KEY_BASE)
|
||||
#define ks (kw + KW_KEY_BASE)
|
||||
#define ts (kw + KW_TWK_BASE)
|
||||
|
||||
#ifdef SKEIN_DEBUG
|
||||
|
@ -310,7 +310,7 @@ static void Skein_512_Process_Block(Skein_512_Ctxt_t *ctx,const u08b_t *blkPtr,s
|
|||
ks[5] = ctx->X[5];
|
||||
ks[6] = ctx->X[6];
|
||||
ks[7] = ctx->X[7];
|
||||
ks[8] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^
|
||||
ks[8] = ks[0] ^ ks[1] ^ ks[2] ^ ks[3] ^
|
||||
ks[4] ^ ks[5] ^ ks[6] ^ ks[7] ^ SKEIN_KS_PARITY;
|
||||
|
||||
ts[2] = ts[0] ^ ts[1];
|
||||
|
@ -338,7 +338,7 @@ static void Skein_512_Process_Block(Skein_512_Ctxt_t *ctx,const u08b_t *blkPtr,s
|
|||
X##p4 += X##p5; X##p5 = RotL_64(X##p5,ROT##_2); X##p5 ^= X##p4; \
|
||||
X##p6 += X##p7; X##p7 = RotL_64(X##p7,ROT##_3); X##p7 ^= X##p6; \
|
||||
|
||||
#if SKEIN_UNROLL_512 == 0
|
||||
#if SKEIN_UNROLL_512 == 0
|
||||
#define R512(p0,p1,p2,p3,p4,p5,p6,p7,ROT,rNum) /* unrolled */ \
|
||||
Round512(p0,p1,p2,p3,p4,p5,p6,p7,ROT,rNum) \
|
||||
Skein_Show_R_Ptr(BLK_BITS,&ctx->h,rNum,Xptr);
|
||||
|
@ -469,7 +469,7 @@ static int Skein_512_Init(Skein_512_Ctxt_t *ctx, size_t hashBitLen)
|
|||
u08b_t b[SKEIN_512_STATE_BYTES];
|
||||
u64b_t w[SKEIN_512_STATE_WORDS];
|
||||
} cfg; /* config block */
|
||||
|
||||
|
||||
Skein_Assert(hashBitLen > 0,SKEIN_BAD_HASHLEN);
|
||||
ctx->h.hashBitLen = hashBitLen; /* output hash bit count */
|
||||
|
||||
|
@ -548,7 +548,7 @@ static int Skein_512_Update(Skein_512_Ctxt_t *ctx, const u08b_t *msg, size_t msg
|
|||
|
||||
return SKEIN_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
/* finalize the hash computation and output the result */
|
||||
static int Skein_512_Final(Skein_512_Ctxt_t *ctx, u08b_t *hashVal)
|
||||
|
@ -562,7 +562,7 @@ static int Skein_512_Final(Skein_512_Ctxt_t *ctx, u08b_t *hashVal)
|
|||
memset(&ctx->b[ctx->h.bCnt],0,SKEIN_512_BLOCK_BYTES - ctx->h.bCnt);
|
||||
|
||||
Skein_512_Process_Block(ctx,ctx->b,1,ctx->h.bCnt); /* process the final block */
|
||||
|
||||
|
||||
/* now output the result */
|
||||
byteCnt = (ctx->h.hashBitLen + 7) >> 3; /* total number of output bytes */
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
** This algorithm and source code is released to the public domain.
|
||||
**
|
||||
***************************************************************************
|
||||
**
|
||||
**
|
||||
** The following compile-time switches may be defined to control some
|
||||
** tradeoffs between speed, code size, error checking, and security.
|
||||
**
|
||||
|
@ -20,8 +20,8 @@
|
|||
** [default: no callouts (no overhead)]
|
||||
**
|
||||
** SKEIN_ERR_CHECK -- how error checking is handled inside Skein
|
||||
** code. If not defined, most error checking
|
||||
** is disabled (for performance). Otherwise,
|
||||
** code. If not defined, most error checking
|
||||
** is disabled (for performance). Otherwise,
|
||||
** the switch value is interpreted as:
|
||||
** 0: use assert() to flag errors
|
||||
** 1: return SKEIN_FAIL to flag errors
|
||||
|
|
|
@ -124,9 +124,9 @@ static inline __m128i soft_aesenc(__m128i in, __m128i key)
|
|||
|
||||
static inline uint32_t sub_word(uint32_t key)
|
||||
{
|
||||
return (saes_sbox[key >> 24 ] << 24) |
|
||||
(saes_sbox[(key >> 16) & 0xff] << 16 ) |
|
||||
(saes_sbox[(key >> 8) & 0xff] << 8 ) |
|
||||
return (saes_sbox[key >> 24 ] << 24) |
|
||||
(saes_sbox[(key >> 16) & 0xff] << 16 ) |
|
||||
(saes_sbox[(key >> 8) & 0xff] << 8 ) |
|
||||
saes_sbox[key & 0xff];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue