Skip to content

test(entropy,hmac,ed25519): cover domain constants, JWK shapes, clone/debug invariants#703

Closed
EffortlessSteven wants to merge 1 commit into
mainfrom
claude/coverage-entropy-hmac-ed25519-S3CNe
Closed

test(entropy,hmac,ed25519): cover domain constants, JWK shapes, clone/debug invariants#703
EffortlessSteven wants to merge 1 commit into
mainfrom
claude/coverage-entropy-hmac-ed25519-S3CNe

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Closes small coverage gaps across three sibling fixture crates.

uselesskey-entropy

  • Pin DOMAIN_ENTROPY_FIXTURE constant (part of every consumer's cache key — silent change would invalidate all deterministic outputs).
  • bytes(0) returns empty; fill_bytes(&mut []) is a no-op.
  • fill_bytes_with_variant matches bytes_with_variant for the same variant.
  • Clone preserves bytes, label, variant.
  • Debug includes label/variant but never byte material (hex form check).
  • Default variant on the fixture handle propagates through bytes() and variant-bound fixtures produce the same material as explicit variant calls on the default fixture.

uselesskey-hmac

  • Pin DOMAIN_HMAC_SECRET constant.
  • Clone preserves secret_bytes, label, spec (single + chained clones).
  • Debug must not contain raw secret bytes (hex form check).
  • JWK use_ field is exactly "sig" across HS256/HS384/HS512.
  • JWKS keys array has exactly one entry.

uselesskey-ed25519

  • Pin DOMAIN_ED25519_KEYPAIR constant.
  • PKCS#8 / SPKI DER outputs meet minimum-length invariants.
  • PEM outputs have the correct BEGIN headers.
  • public_jwk() exercises every OKP field shape; x base64url decodes to 32 bytes; private_key_jwk() d decodes to 32 bytes.
  • public_jwks() cardinality is exactly 1; public_jwks_json() matches public_jwks().to_value().
  • Clone preserves private/public DER and label.

No production code changes; 3 new test files, all green.

Test plan

  • cargo test -p uselesskey-entropy -p uselesskey-hmac -p uselesskey-ed25519 --all-features
  • cargo fmt --check for each crate
  • cargo clippy --all-features --all-targets -- -D warnings for each crate

Generated by Claude Code

…/debug invariants

entropy:
- Pin DOMAIN_ENTROPY_FIXTURE constant (part of every consumer's cache key).
- bytes(0) returns empty; fill_bytes(&mut []) is a no-op.
- fill_bytes_with_variant matches bytes_with_variant for the same variant.
- Clone preserves bytes, label, variant.
- Debug includes label/variant but never byte material (hex form check).
- Default variant on the fixture handle propagates through bytes() and
  variant-bound fixtures produce the same material as explicit variant
  calls on the default fixture.

hmac:
- Pin DOMAIN_HMAC_SECRET constant.
- Clone preserves secret_bytes, label, spec (single + chained clones).
- Debug must not contain raw secret bytes (hex form check).
- JWK use_ field is exactly "sig" across HS256/HS384/HS512.
- JWKS keys array has exactly one entry.

ed25519:
- Pin DOMAIN_ED25519_KEYPAIR constant.
- PKCS#8 / SPKI DER outputs meet minimum length invariants.
- PEM outputs have correct BEGIN headers.
- public_jwk() exercises every OKP field shape and the x base64url
  decodes to 32 bytes; private_key_jwk() d decodes to 32 bytes.
- public_jwks() cardinality is exactly 1; public_jwks_json() matches
  public_jwks().to_value().
- Clone preserves private/public DER and label.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 12 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3809f4eb-1fc6-4b7e-81a8-45775c85a735

📥 Commits

Reviewing files that changed from the base of the PR and between fad488d and fe6e892.

📒 Files selected for processing (3)
  • crates/uselesskey-ed25519/tests/ed25519_extra_coverage.rs
  • crates/uselesskey-entropy/tests/entropy_extra_coverage.rs
  • crates/uselesskey-hmac/tests/hmac_extra_coverage.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/coverage-entropy-hmac-ed25519-S3CNe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

EffortlessSteven added a commit that referenced this pull request May 16, 2026
Port useful entropy/HMAC/Ed25519 coverage from stale #703 onto current main.

- cover domain constants and deterministic clone/debug invariants
- cover Ed25519 JWK/JWKS public material shapes
- cover HMAC secret-shape/debug behavior without new no-panic debt

Validation: hosted pr, perf, and GitGuardian checks passed on #727.
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Closing as superseded by #727. The useful entropy/HMAC/Ed25519 coverage was ported onto current main, cleaned up for no-panic-style tests, validated, and merged there; this older draft branch is now stale.

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.

2 participants