import { computeSecretHash } from '@aztec/aztec.js/crypto'; import { Fr } from '@aztec/foundation/curves/bn254'; import type { LogFn } from '@aztec/foundation/log'; export async function generateSecretAndHash(log: LogFn) { const secret = Fr.random(); // We hash this the same way that aztec nr hash does. const secretHash = await computeSecretHash(secret); log(` Secret: ${secret} Secret hash: ${secretHash} `); }