-
Notifications
You must be signed in to change notification settings - Fork 217
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
u128 and Scalar #364
Open
ripa1995
wants to merge
17
commits into
dalek-cryptography:main
Choose a base branch
from
runtime-machines:u128-and-scalar
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
u128 and Scalar #364
ripa1995
wants to merge
17
commits into
dalek-cryptography:main
from
runtime-machines:u128-and-scalar
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the largest useful bitsize on Scalar values, because the range for the next eligible bitsize, [0, 2^256), contains all Scalar values.
This reverts commit a1a5b4f.
Dear @cathieyun, @hdevalence, @oleganza; |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.