hash_update(h, seed, ctx->prng.seed_len);
hash_update(h, ctx->curkey, sizeof(ctx->curkey));
memcpy(ctx->curkey, hash_final(h), sizeof(ctx->curkey));
hash_update(h, seed, ctx->prng.seed_len);
hash_update(h, ctx->curkey, sizeof(ctx->curkey));
memcpy(ctx->curkey, hash_final(h), sizeof(ctx->curkey));