class BatchAVLVerifier[D <: Digest, HF <: CryptographicHash[D]] extends AuthenticatedTreeOps[D] with ToStringHelper
Implements the batch AVL verifier from https://eprint.iacr.org/2016/994
- Alphabetic
- By Inheritance
- BatchAVLVerifier
- AuthenticatedTreeOps
- ToStringHelper
- SparkzEncoding
- BatchProofConstants
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new BatchAVLVerifier(startingDigest: ADDigest, proof: SerializedAdProof, keyLength: Int, valueLengthOpt: Option[Int], maxNumOperations: Option[Int] = None, maxDeletes: Option[Int] = None)(implicit hf: HF = Blake2b256)
- keyLength
- length of keys in tree
- valueLengthOpt
- length of values in tree. None if it is not fixed
- maxNumOperations
- option the maximum number of operations that this proof can be for, to limit running time in case of malicious proofs. If None, running time limits will not be enforced.
- maxDeletes
- at most, how many of maxNumOperations can be deletions; for a tighter running time bound and better attack protection. If None, defaults to maxNumOperations.
- hf
- hash function
Type Members
- type ChangeHappened = Boolean
- Definition Classes
- AuthenticatedTreeOps
- type HeightIncreased = Boolean
- Definition Classes
- AuthenticatedTreeOps
- type ToDelete = Boolean
- Definition Classes
- AuthenticatedTreeOps
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val EndOfTreeInPackagedProof: Byte
- Definition Classes
- BatchProofConstants
- val LabelInPackagedProof: Byte
- Definition Classes
- BatchProofConstants
- val LeafInPackagedProof: Byte
- Definition Classes
- BatchProofConstants
- val NegativeInfinityKey: ADKey
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- val PositiveInfinityKey: ADKey
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- def addNode(r: Leaf[D], key: ADKey, v: ADValue): InternalVerifierNode[D]
- returns
- A new verifier node with two leaves: r on the left and a new leaf containing key and value on the right
- Attributes
- protected
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- def arrayToString(a: Array[Byte]): String
- Attributes
- protected
- Definition Classes
- ToStringHelper
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val changedNodesBuffer: ArrayBuffer[ProverNodes[D]]
Sequence of leafs and internal nodes that where likely by modified after last proof generation
Sequence of leafs and internal nodes that where likely by modified after last proof generation
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- val changedNodesBufferToCheck: ArrayBuffer[ProverNodes[D]]
Nodes that may, or may not be mofidied after last proof generation
Nodes that may, or may not be mofidied after last proof generation
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- val collectChangedNodes: Boolean
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- def digest: Option[ADDigest]
Returns Some[the current digest of the authenticated data structure], where the digest contains the root hash and the root height Returns None if the proof verification failed at construction or during any of the operations.
Returns Some[the current digest of the authenticated data structure], where the digest contains the root hash and the root height Returns None if the proof verification failed at construction or during any of the operations.
- returns
- Some[digest] or None
- def digest(rootNode: Node[D]): ADDigest
The digest consists of the label of the root node followed by its height, expressed as a single (unsigned) byte
The digest consists of the label of the root node followed by its height, expressed as a single (unsigned) byte
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- implicit val encoder: SparkzEncoder
- Definition Classes
- SparkzEncoding
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def extractFirstNode(extractor: (VerifierNodes[D]) => Boolean): Option[VerifierNodes[D]]
- def extractNodes(extractor: (VerifierNodes[D]) => Boolean): Option[Seq[VerifierNodes[D]]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val keyLength: Int
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- def keyMatchesLeaf(key: ADKey, r: Leaf[D]): Boolean
Determines if the leaf r contains the key or if r.key < r < r.nextLeafKey If neither of those holds, causes an exception.
Determines if the leaf r contains the key or if r.key < r < r.nextLeafKey If neither of those holds, causes an exception.
- Attributes
- protected
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- val labelLength: Int
- Attributes
- protected
- def logError(t: Throwable): Unit
Default implementation of error logging.
Default implementation of error logging.
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nextDirectionIsLeft(key: ADKey, r: InternalNode[D]): Boolean
Figures out whether to go left or right when from node r when searching for the key, using the appropriate bit in the directions bit string from the proof
Figures out whether to go left or right when from node r when searching for the key, using the appropriate bit in the directions bit string from the proof
- returns
- true if to go left, false if to go right in the search
- Attributes
- protected
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def onNodeVisit(n: Node[D], operation: Operation, isRotate: Boolean = false): Unit
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- def performOneOperation(operation: Operation): Try[Option[ADValue]]
If operation.key exists in the tree and the operation succeeds, returns Success(Some(v)), where v is the value associated with operation.key before the operation.
If operation.key exists in the tree and the operation succeeds, returns Success(Some(v)), where v is the value associated with operation.key before the operation. If operation.key does not exists in the tree and the operation succeeds, returns Success(None). Returns Failure if the operation fails or the proof does not verify. After one failure, all subsequent operations will fail and digest is None.
- returns
- Success(Some(old value)), Success(None), or Failure
- def replayComparison: Int
Deletions go down the tree twice -- once to find the leaf and realize that it needs to be deleted, and the second time to actually perform the deletion.
Deletions go down the tree twice -- once to find the leaf and realize that it needs to be deleted, and the second time to actually perform the deletion. This method will re-create comparison results using directions in the proof and lastRightStep variable. Each time it's called, it will give the next comparison result of key and node.key, where node starts at the root and progresses down the tree according to the comparison results.
- returns
- result of previous comparison of key and relevant node's key
- Attributes
- protected
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- def returnResultOfOneOperation(operation: Operation, rootNode: Node[D]): Try[(Node[D], Option[ADValue])]
- Attributes
- protected
- Definition Classes
- AuthenticatedTreeOps
- var rootNodeHeight: Int
- Attributes
- protected
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- BatchAVLVerifier → AnyRef → Any
- val valueLengthOpt: Option[Int]
- Definition Classes
- BatchAVLVerifier → AuthenticatedTreeOps
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated