summaryrefslogtreecommitdiffstats
path: root/src/blake2s.c
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-09-17 10:08:51 +0200
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-09-17 10:26:44 +0200
commit8cefab1740fe402d9f6161a625ad2d637201d5ad (patch)
tree1fa602c19e9a6cb1b35cd4d883468f0f1aacd674 /src/blake2s.c
parentAdjust wg_peer_encrypt and wg_peer_decrypt return (diff)
downloadwireguard-openbsd-8cefab1740fe402d9f6161a625ad2d637201d5ad.tar.xz
wireguard-openbsd-8cefab1740fe402d9f6161a625ad2d637201d5ad.zip
sed /u_int/uint/
Diffstat (limited to 'src/blake2s.c')
-rw-r--r--src/blake2s.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/blake2s.c b/src/blake2s.c
index 39384b0a7b2..d6046e33b38 100644
--- a/src/blake2s.c
+++ b/src/blake2s.c
@@ -22,27 +22,27 @@ ror32(uint32_t word, unsigned int shift)
typedef union {
struct {
- u_int8_t digest_length;
- u_int8_t key_length;
- u_int8_t fanout;
- u_int8_t depth;
- u_int32_t leaf_length;
- u_int32_t node_offset;
- u_int16_t xof_length;
- u_int8_t node_depth;
- u_int8_t inner_length;
- u_int8_t salt[8];
- u_int8_t personal[8];
+ uint8_t digest_length;
+ uint8_t key_length;
+ uint8_t fanout;
+ uint8_t depth;
+ uint32_t leaf_length;
+ uint32_t node_offset;
+ uint16_t xof_length;
+ uint8_t node_depth;
+ uint8_t inner_length;
+ uint8_t salt[8];
+ uint8_t personal[8];
};
- u_int32_t words[8];
+ uint32_t words[8];
} __packed blake2s_param;
-static const u_int32_t blake2s_iv[8] = {
+static const uint32_t blake2s_iv[8] = {
0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL
};
-static const u_int8_t blake2s_sigma[10][16] = {
+static const uint8_t blake2s_sigma[10][16] = {
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
@@ -63,7 +63,7 @@ static inline void blake2s_set_lastblock(struct blake2s_state *state)
}
static inline void blake2s_increment_counter(struct blake2s_state *state,
- const u_int32_t inc)
+ const uint32_t inc)
{
state->t[0] += inc;
state->t[1] += (state->t[0] < inc);
@@ -81,7 +81,7 @@ static inline void blake2s_init_param(struct blake2s_state *state,
void blake2s_init(struct blake2s_state *state, const size_t outlen)
{
- blake2s_param param __aligned(__alignof__(u_int32_t)) = {
+ blake2s_param param __aligned(__alignof__(uint32_t)) = {
.digest_length = outlen,
.fanout = 1,
.depth = 1
@@ -98,7 +98,7 @@ void blake2s_init_key(struct blake2s_state *state, const size_t outlen,
.key_length = keylen,
.fanout = 1,
.depth = 1 };
- u_int8_t block[BLAKE2S_BLOCK_SIZE] = { 0 };
+ uint8_t block[BLAKE2S_BLOCK_SIZE] = { 0 };
/*WARN_ON(IS_ENABLED(DEBUG) && (!outlen || outlen > BLAKE2S_HASH_SIZE ||
!key || !keylen || keylen > BLAKE2S_KEY_SIZE));*/
@@ -109,11 +109,11 @@ void blake2s_init_key(struct blake2s_state *state, const size_t outlen,
}
static inline void blake2s_compress(struct blake2s_state *state,
- const u_int8_t *block, size_t nblocks,
- const u_int32_t inc)
+ const uint8_t *block, size_t nblocks,
+ const uint32_t inc)
{
- u_int32_t m[16];
- u_int32_t v[16];
+ uint32_t m[16];
+ uint32_t v[16];
int i;
/*WARN_ON(IS_ENABLED(DEBUG) &&
@@ -177,7 +177,7 @@ static inline void blake2s_compress(struct blake2s_state *state,
}
}
-void blake2s_update(struct blake2s_state *state, const u_int8_t *in, size_t inlen)
+void blake2s_update(struct blake2s_state *state, const uint8_t *in, size_t inlen)
{
const size_t fill = BLAKE2S_BLOCK_SIZE - state->buflen;
@@ -202,7 +202,7 @@ void blake2s_update(struct blake2s_state *state, const u_int8_t *in, size_t inle
state->buflen += inlen;
}
-void blake2s_final(struct blake2s_state *state, u_int8_t *out, const size_t outlen)
+void blake2s_final(struct blake2s_state *state, uint8_t *out, const size_t outlen)
{
int i;
/*WARN_ON(IS_ENABLED(DEBUG) &&
@@ -218,12 +218,12 @@ void blake2s_final(struct blake2s_state *state, u_int8_t *out, const size_t outl
explicit_bzero(state, sizeof(*state));
}
-void blake2s_hmac(u_int8_t *out, const u_int8_t *in, const u_int8_t *key, const size_t outlen,
+void blake2s_hmac(uint8_t *out, const uint8_t *in, const uint8_t *key, const size_t outlen,
const size_t inlen, const size_t keylen)
{
struct blake2s_state state;
- u_int8_t x_key[BLAKE2S_BLOCK_SIZE] __aligned(__alignof__(u_int32_t)) = { 0 };
- u_int8_t i_hash[BLAKE2S_HASH_SIZE] __aligned(__alignof__(u_int32_t));
+ uint8_t x_key[BLAKE2S_BLOCK_SIZE] __aligned(__alignof__(uint32_t)) = { 0 };
+ uint8_t i_hash[BLAKE2S_HASH_SIZE] __aligned(__alignof__(uint32_t));
int i;
if (keylen > BLAKE2S_BLOCK_SIZE) {