Skip to content

Releases: jose-compu/opencircom

OpenCircom v0.7.0

Choose a tag to compare

@jose-compu jose-compu released this 22 May 17:10

What's Changed

New Contributors

Full Changelog: v0.6.0...v0.7.0

OpenCircom v0.6.0

Choose a tag to compare

@jose-compu jose-compu released this 21 Feb 13:43
2787ab6

0.6.0

  • Arithmetic: PoEVerify(n) — SNARK-friendly proof-of-exponentiation verification (constrains result = base^exponent in the field; n-bit exponent, no big-int); for field-based accumulators (e.g. witness^element = A). 14 dedicated tests (edge cases, max exponent, 0^0, 1^exp, failure cases).
  • Hashing: PoseidonEncrypt() — symmetric encryption: ciphertext = plaintext + Poseidon(key); decryption off-chain (plaintext = ciphertext − Poseidon(key)). One Poseidon(1) per encrypt; use unique key per message or key+nonce. 6 tests.
  • Identity & credentials: IdentityCommitment() — Semaphore-style commitment = Poseidon(identity, secret). SemaphoreMembership(levels) — prove (identity, secret) in allowlist tree (leaves = Poseidon(1)(commitment)); use with Nullifier for double-signaling prevention. 5 tests.
  • Set membership: AccumulatorMembership(n) — field-based accumulator membership: constrains witness^member = accumulator (wraps PoEVerify). Build A = g^(product of set elements); witness for element e is g^(product/e). 5 tests.
  • String & data: Utf8Validation(n) — validate byte sequence as UTF-8 (state machine, quadratic-only); FixedStringMatch(n) — bytes equal expected; BytesAllInRange(n, lo, hi), ByteInRange(lo, hi) — digits/ASCII range. 9 tests.
  • Test suite expanded across all circuits: 253+ tests (incl. string_data Utf8Validation, FixedStringMatch, BytesAllInRange; PoseidonEncrypt, IdentityCommitment, SemaphoreMembership, AccumulatorMembership; arithmetic, comparators, bitify, divrem, exp, gates, merkle, mimc, mux, muxn, nullifier, poseidon, range/strict, sha256, switcher, utils, substantial circuits, voting). Edge cases, failure paths, and boundary conditions covered.

OpenCircom v0.5.0

Choose a tag to compare

@jose-compu jose-compu released this 21 Feb 12:52
85dd512

0.5.0

  • Merkle: AllowlistMembership(levels) — prove identity in allowlist (hash + Merkle path); pair with nullifier on-chain
  • Utils: PadBits10Star(n, totalBits) — pad with 1 then zeros (hash padding)
  • Utils: ConditionalSelect() — private if-then-else (condition ? a : b)
  • Utils: BalanceProof(n) — prove balance ≥ amount and newBalance = balance − amount; for transfer proofs
  • Utils: VoteInAllowlist(n) — 1 if vote in allowed choices (allowlist voting)
  • Utils: PadPKCS7(blockBytes) — PKCS#7-style padding for block bytes; for hashing/symmetric crypto in-circuit
  • Voting: VoteCommitAllowlist(n) — commit phase with choice in allowedChoices[n]; use with VoteReveal for 1-of-N allowlist voting
  • Tests: 138+ passing (PadPKCS7, VoteCommitAllowlist, and existing substantial circuits)
  • Docs/README: badge 138+ tests; npm run docs generates API docs for all templates (including PadPKCS7, VoteCommitAllowlist)
  • Internal security audit (all circuits reviewed, fixes applied, re-audited):
    • [HIGH] Switcher: added binary constraint on sel (was unconstrained; safe in Merkle context but not standalone)
    • [HIGH] ForceEqualIfEnabled: added binary constraint on enabled
    • [HIGH] IncrementalMerkleInclusion: replaced Num2Bits with StrictNum2Bits for index (prevents field-overflow bypass)
    • [MEDIUM] MerkleInclusionProof: removed unused muxes[] declaration (dead code)
    • [MEDIUM] DivRem: added StrictNum2Bits range check on dividend a (was unchecked; b, q, r were already checked)
    • [MEDIUM] PadPKCS7: enforced numUsed < blockBytes (at least 1 pad byte, per PKCS#7 spec)
    • [LOW/INFO] Gates, Mux1/Mux2, Bits2Num: inputs not binary-constrained by design (documented building blocks)
    • [INFO] Nullifier domainSize unused (API compat, documented)
    • All 138 tests pass after fixes

OpenCircom v0.4.0

Choose a tag to compare

@jose-compu jose-compu released this 21 Feb 06:44
219acea

Changelog

0.4.0

  • Utils: IndexOf(N, nBits) — prove index where arr[i] == value
  • Utils: Min2(n), Max2(n) — min/max of two n-bit values
  • Utils: MinN(n, N), MaxN(n, N) — min/max of an array of N values
  • Utils: AllEqual(n) — 1 if all array elements equal
  • Utils: CountMatches(N) — count of arr[i] == value
  • Utils: Tally(numChoices, numVotes) — vote counts per choice (votes range-checked)
  • Docs: API-style generated docs (npm run docs) for circuit categories and templates; see docs/README.md
  • Tests: 128+ passing (index_of, minmax, minn_maxn, tally test circuits)

0.3.0

  • Arithmetic: Sum(n), InnerProduct(n), DivRem(n), ExpByBits(n) — sum, dot product, safe div/rem, field exponentiation
  • Comparators: AssertNotEqual() — aliasing-safe (constrain a ≠ b)
  • Utils: SelectByIndex(N, nBits), PadBits(n, target), OneOfN(n)

0.2.0

  • Voting circuits: vote_commit, vote_reveal
  • Merkle: merkle_inclusion and related helpers
  • JS export: circuitsDir and circuits (hashing, merkle) for tooling

0.1.0

  • Initial release
  • Hashing: Poseidon, MiMC, SHA-256 (full compression chain)
  • Primitives: comparators, bitify, gates, mux, switcher, compconstant, binsum, aliascheck
  • No circomlib dependency