style: fix coding style
This commit is contained in:
parent
0d92a80e4c
commit
3289a9191d
3 changed files with 12 additions and 11 deletions
|
|
@ -43,13 +43,13 @@ static void
|
||||||
sha256_encode(const struct sha256_ctx *ctx, uint8_t out[32])
|
sha256_encode(const struct sha256_ctx *ctx, uint8_t out[32])
|
||||||
{
|
{
|
||||||
for (uint8_t i = 0; i < 8; ++i)
|
for (uint8_t i = 0; i < 8; ++i)
|
||||||
{
|
{
|
||||||
const uint8_t i4 = i * 4;
|
const uint8_t i4 = i * 4;
|
||||||
uint32_t v = ctx->state[i];
|
uint32_t v = ctx->state[i];
|
||||||
|
|
||||||
out[i4 + 0] = (uint8_t)(v >> 24);
|
out[i4 + 0] = (uint8_t)(v >> 24);
|
||||||
out[i4 + 1] = (uint8_t)(v >> 16);
|
out[i4 + 1] = (uint8_t)(v >> 16);
|
||||||
out[i4 + 2] = (uint8_t)(v >> 8);
|
out[i4 + 2] = (uint8_t)(v >> 8);
|
||||||
out[i4 + 3] = (uint8_t)(v >> 0);
|
out[i4 + 3] = (uint8_t)(v >> 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
static void whirlpool_pad(struct whirlpool_ctx *ctx);
|
static void whirlpool_pad(struct whirlpool_ctx *ctx);
|
||||||
static void whirlpool_encode(const struct whirlpool_ctx *ctx, uint8_t out[64]);
|
static void whirlpool_encode(const struct whirlpool_ctx *ctx, uint8_t out[64]);
|
||||||
static inline void whirlpool_write_len(struct whirlpool_ctx *ctx, uint64_t bitlen);
|
static inline void whirlpool_write_len(struct whirlpool_ctx *ctx, uint64_t
|
||||||
|
bitlen);
|
||||||
/* ---------------- */
|
/* ---------------- */
|
||||||
|
|
||||||
void whirlpool_final(void *ctx, uint8_t *out)
|
void whirlpool_final(void *ctx, uint8_t *out)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
#include "whirlpool.h"
|
#include "whirlpool.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
void whirlpool_init(void *ctx)
|
void whirlpool_init(void *ctx)
|
||||||
{
|
{
|
||||||
struct whirlpool_ctx *local_ctx = ctx;
|
struct whirlpool_ctx *local_ctx = ctx;
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 8; ++i)
|
memset(local_ctx->state, 0, sizeof(uint64_t) * 8);
|
||||||
local_ctx->state[i] = 0;
|
|
||||||
local_ctx->count = 0;
|
local_ctx->count = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue