Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion target/.rustc_info.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"rustc_fingerprint":11646856000109947871,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\tanma\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.87.0 (17067e9ac 2025-05-09)\nbinary: rustc\ncommit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359\ncommit-date: 2025-05-09\nhost: x86_64-pc-windows-msvc\nrelease: 1.87.0\nLLVM version: 20.1.1\n","stderr":""}},"successes":{}}
{"rustc_fingerprint":11800355746923300098,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.87.0 (17067e9ac 2025-05-09)\nbinary: rustc\ncommit-hash: 17067e9ac6d7ecb70e50f92c1944e545188d2359\ncommit-date: 2025-05-09\nhost: x86_64-unknown-linux-gnu\nrelease: 1.87.0\nLLVM version: 20.1.1\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/jules/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}}
122 changes: 122 additions & 0 deletions test_summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Test Summary

This document summarizes the results of running the test suite.

## Unit Tests (`cargo test --all -- --nocapture`)

* **Overall Status:** <font color="red">FAILED</font>
* **Tests Run:** 26
* **Passed:** 21
* **Failed:** 5
* **Ignored:** 0

### Failed Unit Tests:

1. `p256::tests::test_field_arithmetic`
* **Assertion:** `assertion failed: bool::from(product.ct_eq(&FieldElement::one()))`
* **Location:** `forge-ec-curves/src/p256.rs:1972:9`
2. `p256::tests::test_hash_to_curve`
* **Assertion:** `assertion failed: bool::from(point_affine.is_on_curve())`
* **Location:** `forge-ec-curves/src/p256.rs:2030:9`
3. `p256::tests::test_scalar_multiplication`
* **Assertion:** `assertion failed: bool::from(P256::to_affine(&g2).ct_eq(&P256::to_affine(&g_doubled)))`
* **Location:** `forge-ec-curves/src/p256.rs:1997:9`
4. `secp256k1::tests::test_point_validation`
* **Assertion:** `assertion failed: bool::from(g_affine.is_on_curve())`
* **Location:** `forge-ec-curves/src/secp256k1.rs:2912:9`
5. `p256::tests::test_key_exchange`
* **Assertion:** `assertion failed: bool::from(P256::to_affine(&alice_shared).ct_eq(&P256::to_affine(&bob_shared)))`
* **Location:** `forge-ec-curves/src/p256.rs:2020:9`

## Integration-style Tests (`test_forge_ec/src/bin/`)

### `test_base58`

* **Status:** <font color="green">PASSED</font>
* **Details:**
* Base58 encoding/decoding: `✓ Base58 encoding/decoding works correctly`
* Base58Check encoding/decoding: `✓ Base58Check encoding/decoding works correctly`

### `test_batch_verification`

* **Status:** <font color="red">FAILED</font> (Underlying signature verification failures)
* **Details:**
* Schnorr batch verification:
* Individual signatures: `Invalid` (for all 5)
* Batch verification: `Failed`
* Consistency: `✓ Batch verification result matches individual verification results`
* ECDSA batch verification:
* Individual signatures: `Invalid` (for all 5)
* Batch verification: `Failed`
* Consistency: `✓ Batch verification result matches individual verification results`
* Negative cases:
* Modified message: `Failed (expected)`
* Swapped signatures: `Failed (expected)`
* Using wrong public key: `Failed (expected)`
* **Note:** The "failures" in batch verification (signatures being invalid) are likely due to issues in the individual signature verification logic rather than the batching process itself. The negative tests behaved as expected.

### `test_der`

* **Status:** <font color="orange">PARTIALLY PASSED</font>
* **Details:**
* ECDSA signature DER encoding/decoding:
* Encoding: `✓ Successfully encoded ECDSA signature to DER`
* Decoding: `✓ Successfully decoded ECDSA signature from DER`
* Comparison: `✗ Decoded signature does not match the original`
* EC public key DER encoding/decoding: `✓ Successfully decoded EC public key from DER` (Note: direct comparison difficult)
* EC private key DER encoding/decoding: `✓ Successfully decoded EC private key from DER` (Note: direct comparison difficult)

### `test_ecdsa`

* **Status:** <font color="red">FAILED</font>
* **Details:**
* Setup (RNG, generator, scalar, multiplication, affine conversion): `✓ Successfully ...`
* ECDSA signing: `✓ Successfully created ECDSA signature`
* ECDSA signature verification: `✗ ECDSA signature verification failed`

### `test_encoding`

* **Status:** <font color="red">FAILED</font>
* **Details:**
* Setup: `✓ Successfully ...`
* Uncompressed point encoding: `✓ Successfully encoded point in uncompressed format`
* Uncompressed point decoding: `✗ Failed to decode uncompressed point`
* Compressed point encoding: `✓ Successfully encoded point in compressed format`
* Compressed point decoding: `✗ Failed to decode compressed point`

### `test_hash_to_curve`

* **Status:** <font color="red">FAILED</font>
* **Details:**
* Simplified SWU method:
* Hashing to point: `✓ Successfully hashed message to curve point using SWU method`
* Determinism: `✓ Hash-to-curve is deterministic (same input produces same output)`
* Uniqueness: `✗ Different messages hash to the same point`
* Icart method:
* Hashing to point: `✓ Successfully hashed message to curve point using Icart method`
* Determinism: `✓ Hash-to-curve is deterministic (same input produces same output)`
* Uniqueness: `✗ Different messages hash to the same point`

### `test_pem`

* **Status:** <font color="green">PASSED</font>
* **Details:**
* PEM encoding/decoding (label "TEST DATA"): All checks `✓`
* PEM encoding/decoding (label "EC PRIVATE KEY"): All checks `✓`
* Invalid PEM decoding (missing header, missing footer, mismatched header/footer): All `✓ Correctly failed to decode invalid PEM`

## Overall Summary of Issues

The test results indicate several areas needing attention:

1. **P256 Curve Implementation:** Multiple core unit tests for P256 (`test_field_arithmetic`, `test_hash_to_curve`, `test_scalar_multiplication`, `test_key_exchange`) are failing. This suggests fundamental problems in the P256 curve arithmetic or its integration.
2. **Secp256k1 Point Validation:** The `test_point_validation` for `secp256k1` is failing, indicating an issue with point validation logic for this curve.
3. **Signature Verification:** ECDSA signature verification consistently fails (`test_ecdsa`, `test_batch_verification`). Schnorr verification also fails in batch tests. This is a critical problem.
4. **DER Encoding/Decoding:** While encoding seems to work, the decoded ECDSA signature in `test_der` does not match the original.
5. **Point Encoding/Decoding:** Decoding of both compressed and uncompressed points fails in `test_encoding`.
6. **Hash-to-Curve Uniqueness:** Both SWU and Icart methods in `test_hash_to_curve` produce the same output for different input messages, which violates a core requirement of hash-to-curve functions.
7. **Batch Verification:** While the batching logic itself might be correct (as it matches individual verification outcomes), the underlying failures in signature verification make the batch tests fail overall.

The Base58 and PEM encoding/decoding functionalities appear to be working correctly.
The `target/` directory was not included in the summary as it contains build artifacts and not test source or direct results.
The `forge-ec-rng/tests/rfc6979_test.rs` tests are part of `cargo test --all` and their individual status is captured under the unit test summary if they passed (which they did, as they are not listed in failures).
Loading