Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/xform_poly1305.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | xform_Poly1305_Final(uint8_t *digest, void *ctx) | ||||
struct poly1305_xform_ctx *polyctx = ctx; | struct poly1305_xform_ctx *polyctx = ctx; | ||||
int rc; | int rc; | ||||
rc = crypto_onetimeauth_poly1305_final(&polyctx->state, digest); | rc = crypto_onetimeauth_poly1305_final(&polyctx->state, digest); | ||||
if (rc != 0) | if (rc != 0) | ||||
panic("%s: Invariant violated: %d", __func__, rc); | panic("%s: Invariant violated: %d", __func__, rc); | ||||
} | } | ||||
struct auth_hash auth_hash_poly1305 = { | const struct auth_hash auth_hash_poly1305 = { | ||||
.type = CRYPTO_POLY1305, | .type = CRYPTO_POLY1305, | ||||
.name = "Poly-1305", | .name = "Poly-1305", | ||||
.keysize = POLY1305_KEY_LEN, | .keysize = POLY1305_KEY_LEN, | ||||
.hashsize = POLY1305_HASH_LEN, | .hashsize = POLY1305_HASH_LEN, | ||||
.ctxsize = sizeof(struct poly1305_xform_ctx), | .ctxsize = sizeof(struct poly1305_xform_ctx), | ||||
.blocksize = crypto_onetimeauth_poly1305_BYTES, | .blocksize = crypto_onetimeauth_poly1305_BYTES, | ||||
.Init = xform_Poly1305_Init, | .Init = xform_Poly1305_Init, | ||||
.Setkey = xform_Poly1305_Setkey, | .Setkey = xform_Poly1305_Setkey, | ||||
.Update = xform_Poly1305_Update, | .Update = xform_Poly1305_Update, | ||||
.Final = xform_Poly1305_Final, | .Final = xform_Poly1305_Final, | ||||
}; | }; |