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

fix!: nonce index encoding #31

Merged
merged 1 commit into from Jun 19, 2023
Merged

Conversation

AaronFeickert
Copy link
Contributor

@AaronFeickert AaronFeickert commented Apr 28, 2023

Nonces used for mask recovery are generated using hashes of a label, seed, and two optional indexes. The label is included using the persona field available in Blake2b, and the seed is of fixed length. However, the indexes are usize and encoded in a manner that is platform dependent. This means that mask recovery on a platform with a different pointer size than the prover will fail to produce the correct mask.

This work updates to use a u32 encoding, returning an error if the index exceeds this limit. This should never occur, given the typical range of indexes used. It adds tests and does some minor refactoring.

Closes issue 30.

BREAKING CHANGE: Changes the way that seed nonces are used in mask recovery. Existing range proofs will verify, but will fail to recover the correct mask.

@CjS77 CjS77 merged commit 394843f into tari-project:main Jun 19, 2023
5 checks passed
@AaronFeickert AaronFeickert deleted the encoding-fix branch June 19, 2023 13:20
@SWvheerden SWvheerden mentioned this pull request Jul 13, 2023
stringhandler pushed a commit that referenced this pull request Jul 13, 2023
Update the version

##
[0.3.0](v0.2.3...v0.3.0)
(2023-07-13)


## ⚠ BREAKING CHANGES

* Changes the way that seed nonces are used in mask
recovery. Existing range proofs will verify, but will fail to recover
the correct mask.

## Features

* simplify bit vector commitment
([35](#35))
([f831d64](f831d64)),
closes
[/github.com/tari-project/bulletproofs-plus/blob/cd7588ee8eaebe862fe9cf5d7c3fd92981703e87/src/range_proof.rs#L265-L273](https://github.com/tari-project//github.com/tari-project/bulletproofs-plus/blob/cd7588ee8eaebe862fe9cf5d7c3fd92981703e87/src/range_proof.rs/issues/L265-L273)
* use precomputation on (most) fixed generators
([19](#19))
([cd7588e](cd7588e)),
closes
[#18](#18)


## Bug Fixes

* nonce index encoding
([31](#31))
([394843f](394843f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent nonce index encoding
4 participants