fromHex currently decodes each byte with parseInt(..., 16), which silently turns non-hex input into NaN-mangled bytes instead of failing. Add strict hex validation (and an exported isValidHex helper) so malformed hex fails loudly.
Also add guard clauses to sealBid (reject a non-positive Drand round) and openBid (reject an empty ciphertext) so callers get clear errors instead of obscure downstream failures.
fromHexcurrently decodes each byte withparseInt(..., 16), which silently turns non-hex input into NaN-mangled bytes instead of failing. Add strict hex validation (and an exportedisValidHexhelper) so malformed hex fails loudly.Also add guard clauses to
sealBid(reject a non-positive Drand round) andopenBid(reject an empty ciphertext) so callers get clear errors instead of obscure downstream failures.