Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/edonr_zfs.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | abd_checksum_edonr_native(abd_t *abd, uint64_t size, | ||||
uint8_t digest[EDONR_MODE / 8]; | uint8_t digest[EDONR_MODE / 8]; | ||||
EdonRState ctx; | EdonRState ctx; | ||||
ASSERT(ctx_template != NULL); | ASSERT(ctx_template != NULL); | ||||
bcopy(ctx_template, &ctx, sizeof (ctx)); | bcopy(ctx_template, &ctx, sizeof (ctx)); | ||||
(void) abd_iterate_func(abd, 0, size, edonr_incremental, &ctx); | (void) abd_iterate_func(abd, 0, size, edonr_incremental, &ctx); | ||||
EdonRFinal(&ctx, digest); | EdonRFinal(&ctx, digest); | ||||
bcopy(digest, zcp->zc_word, sizeof (zcp->zc_word)); | bcopy(digest, zcp->zc_word, sizeof (zcp->zc_word)); | ||||
explicit_bzero(&ctx, sizeof(ctx)); | |||||
jhb: It is probably worth checking that this is fixed in ZoF. | |||||
} | } | ||||
/* | /* | ||||
* Byteswapped zio_checksum interface for the Edon-R hash function. | * Byteswapped zio_checksum interface for the Edon-R hash function. | ||||
*/ | */ | ||||
void | void | ||||
abd_checksum_edonr_byteswap(abd_t *abd, uint64_t size, | abd_checksum_edonr_byteswap(abd_t *abd, uint64_t size, | ||||
const void *ctx_template, zio_cksum_t *zcp) | const void *ctx_template, zio_cksum_t *zcp) | ||||
Show All 36 Lines | abd_checksum_edonr_tmpl_init(const zio_cksum_salt_t *salt) | ||||
return (ctx); | return (ctx); | ||||
} | } | ||||
void | void | ||||
abd_checksum_edonr_tmpl_free(void *ctx_template) | abd_checksum_edonr_tmpl_free(void *ctx_template) | ||||
{ | { | ||||
EdonRState *ctx = ctx_template; | EdonRState *ctx = ctx_template; | ||||
bzero(ctx, sizeof (*ctx)); | explicit_bzero(ctx, sizeof (*ctx)); | ||||
kmem_free(ctx, sizeof (*ctx)); | kmem_free(ctx, sizeof (*ctx)); | ||||
} | } |
It is probably worth checking that this is fixed in ZoF.