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

Optimizations (maybe) worth doing #160

Closed
7 of 23 tasks
nicola opened this issue Sep 8, 2018 · 1 comment
Closed
7 of 23 tasks

Optimizations (maybe) worth doing #160

nicola opened this issue Sep 8, 2018 · 1 comment

Comments

@nicola
Copy link
Contributor

nicola commented Sep 8, 2018

Construction optimization

Circuit optimization

  • Merkle tree last layer is the data
  • Remove Pedersen MD and extend Pedersen Hash to take larger inputs
  • Use pedersen with no padding Pad to 255 bits in circuits. #74
  • Remove all the repeated inputs for the root hashes for drgporep
  • Check if we can re-use the same challenge for all layers (@porcuquine knows)
  • No need to specify double inclusion paths for commD and commR
  • Pack more inclusion paths into 1 Fr. (We can safely include 6 to account for sectors of up to 4TiB: 6 * 42 = 252 < 254. Reconcile this calcultion with actual path lengths, which might be off by one.)
  • Provide merkle inclusion paths for all nodes N rows deep in merkle tree, since these paths will be repeated in many inclusion proofs. Truncate inclusion proofs to terminate at already-proved nodes, and add constraints proving this was done.
  • Check whether we include roots in merkle proofs, and if so don't include them as inputs to the circuit.

Witness generation optimization

  • Cache the merkle tree and only pick the upper layer
  • Sean's batched field inverse calculation optimization
  • Parallel generation of merkle tree paths witnesses (and KDF parallelization)
  • Make sloth cheaper in the forward direction by sampling a better exponent

Library/Hardware Optimization

  • Running Proof Generation/Field operations on a GPU
  • Optimize parallelization techniques in Bellman
  • Improve multi-exponentiation

Sector Storage

Preprocessing (bit-padding)

General

@dignifiedquire
Copy link
Contributor

Compare using xor vs addition for the encoding function here:

pub fn encode<E: Engine>(key: &E::Fr, plaintext: &E::Fr, rounds: usize) -> E::Fr {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants