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

Sinsemilla chip with HashDomain #67

Merged
merged 20 commits into from
Jun 22, 2021
Merged

Sinsemilla chip with HashDomain #67

merged 20 commits into from
Jun 22, 2021

Commits on Jun 19, 2021

  1. ecc::chip.rs: Add Point::from_coordinates_unchecked() API

    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    83eddd8 View commit details
    Browse the repository at this point in the history
  2. gadget::sinsemilla.rs: Add Sinsemilla instructions.

    SinsemillaInstructions has two const generic parameters: K, which
    is the number of bits in each word of the hash, and MAX_WORDS,
    which is the maximum number of words the hash can process.
    
    For Orchard, K = 10, MAX_WORDS = 253.
    therealyingtong committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    af2ac76 View commit details
    Browse the repository at this point in the history
  3. sinsemilla::message.rs: Add message module.

    This defines a Sinsemilla message in terms of pieces and subpieces.
    This is useful when decomposing field elements and packing them
    into K-bit messages.
    therealyingtong committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    e2859df View commit details
    Browse the repository at this point in the history
  4. sinsemilla::chip.rs: Add Sinsemilla chip.

    The chip that will implement SinsemillaInstructions.
    therealyingtong committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    ebb7dae View commit details
    Browse the repository at this point in the history
  5. chip::generator_table.rs: Load Sinsemilla generator lookup table.

    The 2^K table of generators used in the Sinsemilla hash. These
    are loaded into a lookup table.
    therealyingtong committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    74e617b View commit details
    Browse the repository at this point in the history
  6. sinsemilla::chip.rs: Implement witness_message_* APIs.

    witness_message() witnesses a full message given a bitstring.
    
    The other two APIs, witness_message_piece_bitstring() and
    witness_message_piece_field(), both witness a message piece, i.e.
    part of a message that fits within a single base field element.
    
    witness_message_piece_bitstring() takes in a bitstring, while
    witness_message_piece_field() takes in a field element. In the
    latter case, the number of words encoded must be specified.
    therealyingtong committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    7cddc9b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f122e48 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eba2172 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    158ab86 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2f6ca9e View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2021

  1. generator_table.rs: Fix bug in y_p lookup expression.

    Also, GeneratorTable::configure() was not being called in the main
    SinsemillaChip::configure(), which meant the lookup argument had
    not been activated. This has now been fixed.
    
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    9072ed4 View commit details
    Browse the repository at this point in the history
  2. SinsemillaChip::configure(): Introduce closures for Y_A and x_r

    These expressions are derived multiple times in the gates.
    
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    031bb0b View commit details
    Browse the repository at this point in the history
  3. hash_to_point(): Introduce final_piece boolean flag

    This toggles the assignment of q_s2 on the last row of each piece.
    We assign q_s2 = 2 on the last row of the final piece, and q_s2 = 0
    on the last row of other pieces.
    
    This allows us to process the final_piece in the main loop together
    with the other pieces.
    
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    9ce29d9 View commit details
    Browse the repository at this point in the history
  4. hash_piece(): Remove (correct) duplicate assignment of x_a.

    hash_piece() is an internal API, which means its caller hash_message()
    is working in the same region. We rely on the caller to have already
    assigned each piece's initial x_a at the correct offset before making
    the call to hash_piece().
    
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    eccd72f View commit details
    Browse the repository at this point in the history
  5. SinsemillaChip::configure(): Combine and label gates.

    The gates "Secant line" and "Sinsemilla gate" were using the same
    selectors and could be combined.
    
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    744f3d1 View commit details
    Browse the repository at this point in the history
  6. Docfixes and cleanups.

    Co-authored-by: Daira Hopwood <daira@jacaranda.org>
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    3 people committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    002596f View commit details
    Browse the repository at this point in the history
  7. Doc comment fixes

    str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    5f5238f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a01c2ee View commit details
    Browse the repository at this point in the history
  9. SinsemillaChip::configure(): Merge "Initial y_q" gate with main gate

    This allows the MockProver to see the fixed_y_q query as semantically
    connected to q_sinsemilla1.
    
    Co-authored-by: Jack Grigg <jack@electriccoin.co>
    therealyingtong and str4d committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    bd08808 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2021

  1. Rename "Sinsemilla gate" constraint to "y check".

    Signed-off-by: Daira Hopwood <daira@jacaranda.org>
    daira committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    8af8447 View commit details
    Browse the repository at this point in the history