Changeset View
Changeset View
Standalone View
Standalone View
sys/crypto/blake2/blake2-sw.c
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | blake2b_xform_final(uint8_t *out, void *vctx) | ||||
struct blake2b_xform_ctx *ctx = vctx; | struct blake2b_xform_ctx *ctx = vctx; | ||||
int rc; | int rc; | ||||
rc = blake2b_final_ref(&ctx->state, out, BLAKE2B_OUTBYTES); | rc = blake2b_final_ref(&ctx->state, out, BLAKE2B_OUTBYTES); | ||||
if (rc != 0) | if (rc != 0) | ||||
panic("blake2b_final: invalid"); | panic("blake2b_final: invalid"); | ||||
} | } | ||||
struct auth_hash auth_hash_blake2b = { | const struct auth_hash auth_hash_blake2b = { | ||||
.type = CRYPTO_BLAKE2B, | .type = CRYPTO_BLAKE2B, | ||||
.name = "Blake2b", | .name = "Blake2b", | ||||
.keysize = BLAKE2B_KEYBYTES, | .keysize = BLAKE2B_KEYBYTES, | ||||
.hashsize = BLAKE2B_OUTBYTES, | .hashsize = BLAKE2B_OUTBYTES, | ||||
.ctxsize = sizeof(struct blake2b_xform_ctx), | .ctxsize = sizeof(struct blake2b_xform_ctx), | ||||
.Setkey = blake2b_xform_setkey, | .Setkey = blake2b_xform_setkey, | ||||
.Init = blake2b_xform_init, | .Init = blake2b_xform_init, | ||||
.Update = blake2b_xform_update, | .Update = blake2b_xform_update, | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | blake2s_xform_final(uint8_t *out, void *vctx) | ||||
struct blake2s_xform_ctx *ctx = vctx; | struct blake2s_xform_ctx *ctx = vctx; | ||||
int rc; | int rc; | ||||
rc = blake2s_final_ref(&ctx->state, out, BLAKE2S_OUTBYTES); | rc = blake2s_final_ref(&ctx->state, out, BLAKE2S_OUTBYTES); | ||||
if (rc != 0) | if (rc != 0) | ||||
panic("blake2s_final: invalid"); | panic("blake2s_final: invalid"); | ||||
} | } | ||||
struct auth_hash auth_hash_blake2s = { | const struct auth_hash auth_hash_blake2s = { | ||||
.type = CRYPTO_BLAKE2S, | .type = CRYPTO_BLAKE2S, | ||||
.name = "Blake2s", | .name = "Blake2s", | ||||
.keysize = BLAKE2S_KEYBYTES, | .keysize = BLAKE2S_KEYBYTES, | ||||
.hashsize = BLAKE2S_OUTBYTES, | .hashsize = BLAKE2S_OUTBYTES, | ||||
.ctxsize = sizeof(struct blake2s_xform_ctx), | .ctxsize = sizeof(struct blake2s_xform_ctx), | ||||
.Setkey = blake2s_xform_setkey, | .Setkey = blake2s_xform_setkey, | ||||
.Init = blake2s_xform_init, | .Init = blake2s_xform_init, | ||||
.Update = blake2s_xform_update, | .Update = blake2s_xform_update, | ||||
.Final = blake2s_xform_final, | .Final = blake2s_xform_final, | ||||
}; | }; |