Open ripa1995 opened 1 year ago
Dear @cathieyun, @hdevalence, @oleganza; it looks like that we are not allowed to put reviewers, so I'm adding this comment as "request for review", tagging all of you, since you are the authors of the library. Thank you in advance, for your time and effort.
Disclaimer: This pull request has been made against
main
and notdevelop
since the latter is unmaintained, while the former has recent updates.Motivations
Allowing bigger inputs increases the landscape of domains in which
bulletproofs
can be used.We increased the
bitsize
to 128 and replaced theu64
type withu128
in many places within the code.We also decided to support
Scalar
as input value, and we decided to implement it as a feature of the library, which can be enabled withscalar_range_proof
. Also in this case we had to modify the code such thatScalar
could be accepted. To supportScalar
we had to implement the extraction of a single bit from aScalar
.Our implementation of the above consists in an indexing of the
Scalar
's underlying array of bytes, followed by a shift and mask of the appropriate byte. In both cases where this operation is used, the index is not secret, so the timing and memory access patterns of this operation shouldn't enable any side-channel attack.We think that at the moment there is no bigger
bitsize
value that can be used together withScalar
, because the range for the next eligiblebitsize
(i.e.,[0, 2^256)
), contains all possibleScalar
values.Changes
rust-toolchain
tonightly-2023-01-01
and Rust edition inCargo.toml
to2021
.curve25519-dalek
to3.2.1
,sha3
anddigest
to0.9
, andmerlin
to3
.scalar_range_proof
feature, which allowsRangeProof
to be used withScalar
.bitsize
of 128 and make use ofu128
instead ofu64
in range proof.u128
andScalar
as input.u128
andScalar
as input.InnerProductProof
andinner_product
public.Extras
This PR also solves issues #359 and #363.