Skip to content

Implement input validation for generateProof function #5

@adithyaakrishna

Description

@adithyaakrishna

The generateProof function in zk.ts could benefit from additional input validation to prevent potential errors and improve user experience.

Tasks:

  1. Add type checking for the opts parameter using TypeScript interfaces.
  2. Implement checks for required properties in the opts object.
  3. Validate the algorithm property against the list of supported algorithms.
  4. Add size checks for key, iv, and ciphertext based on the selected algorithm.
  5. Implement appropriate error handling and throw descriptive error messages for invalid inputs.

Adding input validation will help prevent runtime errors and provide clearer feedback to users when incorrect parameters are provided.

Contributors: Please note that by submitting a pull request, you are agreeing to accept and sign the Contributor License Agreement (CLA) found at https://github.com/reclaimprotocol/.github/blob/main/CLA.md

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions