reclaimprotocol / zk-symmetric-crypto

A circom library for zero-knowledge proofs of symmetric encryption key ownership without key revelation.
6 stars 3 forks source link

Add unit tests for utility functions in utils.ts #4

Open adithyaakrishna opened 3 weeks ago

adithyaakrishna commented 3 weeks ago

The utils.ts file contains several utility functions that would benefit from unit tests to ensure their correctness and prevent regressions.

Tasks:

  1. Set up a testing framework (e.g., Jest) if not already in place.
  2. Write unit tests for the following functions:
    • toUintArray
    • toUint8Array
    • padU8ToU32Array
    • padArray
    • uint8ArrayToBits
    • bitsToUint8Array
    • uintArrayToBits
    • bitsToUintArray
    • getFullCounterIv
    • getCounterForChunk
  3. Ensure each test covers normal use cases and edge cases.
  4. Add comments explaining the purpose of each test.
  5. Update the project's README with instructions on how to run the tests.

Adding unit tests will improve the reliability of these utility functions and make it easier to maintain and refactor the code in the future.

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

saumy-sh commented 1 week ago

Hey! I would very much like to work on this issue. Can you assign it to me?

saumy-sh commented 1 week ago

Hey can you assign it fast to me so that I can start working on it and complete it within the time limit of Hacktoberfest.

saumy-sh commented 15 hours ago

@adithyaakrishna any updates on this?