Skip to content

Add tests for the gaps found by mutation testing - #310

Merged
HDauven merged 1 commit into
masterfrom
test/mutation-gaps
Oct 11, 2026
Merged

HDauven merged 1 commit into
masterfrom
test/mutation-gaps

Conversation

@HDauven

@HDauven HDauven commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

Resolves #309.

Tests only, so there is no changelog entry. Each test fails on the mutant it targets and passes on the released dusk-poseidon 0.44.0.

  • Test that the decryption gadget rejects forged cipher-texts
  • Test that output_len only overrides the other domain
  • Pin the gate counts of the encryption gadgets

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The tests accurately cover the mutation-testing gaps without changing production behavior.

0 open findings

What changed in this PR

Adds mutation-focused regression tests for hashing and encryption gadgets.

Changes:

  • Verifies domain-specific output_len behavior.
  • Tests rejection of forged ciphertexts.
  • Pins encryption gadget constraint counts.
File Description
tests/​hash.rs Tests HashGadget output-length restrictions.
tests/​hash_errors.rs Tests native hash output-length restrictions.
tests/​encryption_gadget.rs Tests forgery rejection and gate counts.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@HDauven
HDauven force-pushed the test/mutation-gaps branch from e6cce35 to b1d11f9 Compare October 10, 2026 12:02
@HDauven

HDauven commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

Force-pushed: squashed into one commit. The tree is unchanged.

@HDauven
HDauven marked this pull request as ready for review October 10, 2026 12:16

@moCello moCello left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE

Each new test can fail for the reason it states, and the forged cipher-text test has an honest proof as its control.

  • One note below, on a discarded Result in the gate count test. It does not block the merge.

Comment thread tests/encryption_gadget.rs Resolved
Mutation testing of dusk-poseidon 0.44.0 found code that no test pins.
Each test below fails on the mutant it targets:

- Test that the decryption gadget rejects forged cipher-texts
- Test that output_len only overrides the other domain
- Pin the gate counts of the encryption gadgets
@HDauven
HDauven force-pushed the test/mutation-gaps branch from b1d11f9 to 72547de Compare October 11, 2026 14:51
@HDauven
HDauven merged commit 2a51aa4 into master Oct 11, 2026
4 checks passed
@HDauven
HDauven deleted the test/mutation-gaps branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover the test gaps found by mutation testing

3 participants