Skip to content

test(signing): use E::Digest for DataToSign and add verifier unit tests - #248

Closed
kavix wants to merge 2 commits into
LFDT-Lockness:cggmp24/mfrom
kavix:test/external-verifier-and-sha384-digest
Closed

kavix wants to merge 2 commits into
LFDT-Lockness:cggmp24/mfrom
kavix:test/external-verifier-and-sha384-digest

Conversation

@kavix

@kavix kavix commented Nov 24, 2026

Copy link
Copy Markdown

Summary

  • Use DataToSign::digest::<E::Digest> instead of hardcoded Sha256 in signing_works, signing_with_presigs, and signing_sync (tests/tests/it/signing.rs) so Secp384r1 is tested with SHA-384.
  • Simplify P384::verify to use VerifyingKey::verify (SHA-384) directly.
  • Add p256_verifier_roundtrip_and_rejections and p384_verifier_roundtrip_and_rejections unit tests in tests/src/external_verifier.rs covering valid signatures, tampered messages, wrong public keys, and invalid (1, 1) signatures.

Note: Builds on #246.

Fixes #247

Verification

  • RUSTFLAGS="--deny warnings" cargo test --release -p cggmp24-tests --lib (2 passed, 0 failed)
  • RUSTFLAGS="--deny warnings" cargo test --release -p cggmp24-tests --test it signing::signing_works::secp256r1::t2n3 (1 passed, 0 failed)
  • RUSTFLAGS="--deny warnings" cargo test --release -p cggmp24-tests --test it signing::signing_works::secp384r1::t2n3 (1 passed, 0 failed)

… p384

Replace Noop external verifier for Secp256r1 and Secp384r1 with independent ECDSA verification using the p256 and p384 crates.

Fixes LFDT-Lockness#188

Signed-off-by: kavix <kavix@yahoo.com>
Use E::Digest instead of hardcoded Sha256 in signing_works, signing_with_presigs, and signing_sync so secp384r1 tests SHA-384 signing, and add round-trip/rejection unit tests for P256 and P384 external verifiers.

Fixes LFDT-Lockness#247

Signed-off-by: kavix <kavix@yahoo.com>
@survived

survived commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Hey, thanks for sending PR. We've implemented this on our end, we'll push the changes soon.

@survived survived closed this Dec 1, 2026
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.

Tests: signing tests hardcode Sha256 instead of E::Digest and external verifiers lack round-trip/rejection unit tests

2 participants