pub struct MerkleChip<Hash, Commit, Fixed> where
    Hash: HashDomains<Affine>,
    Fixed: FixedPoints<Affine>,
    Commit: CommitDomains<Affine, Fixed, Hash>, 
{ /* private fields */ }
Expand description

Chip implementing MerkleInstructions.

This chip specifically implements MerkleInstructions::hash_layer as the MerkleCRH function hash = SinsemillaHash(Q, 𝑙⋆ || left⋆ || right⋆), where:

  • 𝑙⋆ = I2LEBSP_10(l)
  • left⋆ = I2LEBSP_255(left)
  • right⋆ = I2LEBSP_255(right)

This chip does NOT constrain left⋆ and right⋆ to be canonical encodings of left and right.

Implementations

Configures the MerkleChip.

Constructs a MerkleChip given a MerkleConfig.

Trait Implementations

A type that holds the configuration for this chip, and any other state it may need during circuit synthesis, that can be derived during Circuit::configure. Read more

A type that holds any general chip state that needs to be loaded at the start of Circuit::synthesize. This might simply be () for some chips. Read more

The chip holds its own configuration.

Provides access to general chip state loaded at the beginning of circuit synthesis. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Given an input pair (a,b) and a swap boolean flag, returns (b,a) if swap is set, else (a,b) if swap is not set. Read more

Formats the value using the given formatter. Read more

Compute MerkleCRH for a given layer. The hash that computes the root is at layer 0, and the hashes that are applied to two leaves are at layer MERKLE_DEPTH - 1 = layer 31. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

A variable in the circuit.

A message composed of Self::MessagePieces.

A piece in a message containing a number of K-bit words. A Self::MessagePiece fits in a single base field element, which means it can only contain up to N words, where N*K <= C::Base::CAPACITY. Read more

A cumulative sum z is used to decompose a Sinsemilla message. It produces intermediate values for each word in the message, such that z_next = (z_cur - word_next) / 2^K. Read more

The x-coordinate of a point output of Self::hash_to_point.

A point output of Self::hash_to_point.

A type enumerating the fixed points used in CommitDomains.

HashDomains used in this instruction.

CommitDomains used in this instruction.

Witness a message piece given a field element. Returns a Self::MessagePiece encoding the given message. Read more

Hashes a message to an ECC curve point. This returns both the resulting point, as well as the message decomposition in the form of intermediate values in a cumulative sum. Read more

Extracts the x-coordinate of the output of a Sinsemilla hash.

Variable in the circuit.

Load a variable.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more