Skip to content

Commit 1505af5

Browse files
committed
Use data types defined in hash.h
1 parent 905d556 commit 1505af5

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

crypto/c_skein.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1934,8 +1934,8 @@ hashState;
19341934

19351935
/* "incremental" hashing API */
19361936
static SkeinHashReturn Init (hashState *state, int hashbitlen);
1937-
static SkeinHashReturn Update(hashState *state, const SkeinBitSequence *data, SkeinDataLength databitlen);
1938-
static SkeinHashReturn Final (hashState *state, SkeinBitSequence *hashval);
1937+
static SkeinHashReturn Update(hashState *state, const BitSequence *data, DataLength databitlen);
1938+
static SkeinHashReturn Final (hashState *state, BitSequence *hashval);
19391939

19401940
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
19411941
/* select the context size and init the context */
@@ -1963,7 +1963,7 @@ static SkeinHashReturn Init(hashState *state, int hashbitlen)
19631963

19641964
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
19651965
/* process data to be hashed */
1966-
static SkeinHashReturn Update(hashState *state, const SkeinBitSequence *data, SkeinDataLength databitlen)
1966+
static SkeinHashReturn Update(hashState *state, const BitSequence *data, DataLength databitlen)
19671967
{
19681968
/* only the final Update() call is allowed do partial bytes, else assert an error */
19691969
Skein_Assert((state->u.h.T[1] & SKEIN_T1_FLAG_BIT_PAD) == 0 || databitlen == 0, SKEIN_FAIL);
@@ -2008,7 +2008,7 @@ static SkeinHashReturn Update(hashState *state, const SkeinBitSequence *data, Sk
20082008

20092009
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
20102010
/* finalize hash computation and output the result (hashbitlen bits) */
2011-
static SkeinHashReturn Final(hashState *state, SkeinBitSequence *hashval)
2011+
static SkeinHashReturn Final(hashState *state, BitSequence *hashval)
20122012
{
20132013
Skein_Assert(state->statebits % 256 == 0 && (state->statebits-256) < 1024,FAIL);
20142014
switch ((state->statebits >> 8) & 3)
@@ -2022,8 +2022,8 @@ static SkeinHashReturn Final(hashState *state, SkeinBitSequence *hashval)
20222022

20232023
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
20242024
/* all-in-one hash function */
2025-
SkeinHashReturn c_skein_hash(int hashbitlen, const SkeinBitSequence *data, /* all-in-one call */
2026-
SkeinDataLength databitlen,SkeinBitSequence *hashval)
2025+
SkeinHashReturn c_skein_hash(int hashbitlen, const BitSequence *data, /* all-in-one call */
2026+
DataLength databitlen,BitSequence *hashval)
20272027
{
20282028
hashState state;
20292029
SkeinHashReturn r = Init(&state,hashbitlen);

crypto/c_skein.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
**
2929
***************************************************************************/
3030
#include "skein_port.h" /* get platform-specific definitions */
31+
#include "hash.h"
3132

3233
typedef enum
3334
{
@@ -37,11 +38,8 @@ typedef enum
3738
}
3839
SkeinHashReturn;
3940

40-
typedef size_t SkeinDataLength; /* bit count type */
41-
typedef u08b_t SkeinBitSequence; /* bit stream type */
42-
4341
/* "all-in-one" call */
44-
SkeinHashReturn c_skein_hash(int hashbitlen, const SkeinBitSequence *data,
45-
SkeinDataLength databitlen, SkeinBitSequence *hashval);
42+
SkeinHashReturn c_skein_hash(int hashbitlen, const BitSequence *data,
43+
DataLength databitlen, BitSequence *hashval);
4644

4745
#endif /* ifndef _SKEIN_H_ */

0 commit comments

Comments
 (0)