Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dealer::shard sanity check fails every once in a while #21

Closed
cyphar opened this issue Sep 23, 2023 · 1 comment
Closed

dealer::shard sanity check fails every once in a while #21

cyphar opened this issue Sep 23, 2023 · 1 comment

Comments

@cyphar
Copy link
Owner

cyphar commented Sep 23, 2023

I've run into two cases of failures in safety-checking code, leading me to wonder whether the logic is sound.

  • The sanity check in Dealer::shard that checks whether the evaluated polynomial equals x failed once with thread '<unnamed>' panicked at 'assertion failed: self.threshold == 1 || y != poly.constant()', pkg/paperback-core/src/shamir/dealer.rs:111:17. I guess it is possible for the polynomial to equal the secret at a random x value, but we still should avoid allowing that even if an attacker couldn't know whether that was the case. Maybe we should handle it better? Dealer::next_shard should probably re-try at a different x value rather than crashing the program.
  • In CI, the test for limited_recover_fail failed because it seems one of the polynomials returned the same value for a random x value. thread 'shamir::dealer::test::limited_recover_fail' panicked at '[quickcheck] TEST FAILED. Arguments: (9, [30], [GfElem(4011157905), GfElem(1345881083)])', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/quickcheck-1.0.3/src/tester.rs:165:28 Moved to quickcheck limited_recover_fail failure? #93.

Maybe we need to reconsider if these properties are actually guaranteed or just very unlikely to happen (probably the latter) and how we should protect against them without using asserts.

@cyphar cyphar changed the title spurrious test failures in "safety" checking dealer::shard sanity check fails every once in a while Jul 15, 2024
@cyphar
Copy link
Owner Author

cyphar commented Jul 15, 2024

The first issue was fixed by 359c443.

@cyphar cyphar closed this as completed Jul 15, 2024
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

No branches or pull requests

1 participant