Class

scorex.crypto.authds.avltree.batch

BatchAVLVerifier

Related Doc: package batch

Permalink

class BatchAVLVerifier[D <: Digest, HF <: CryptographicHash[D]] extends AuthenticatedTreeOps[D] with ToStringHelper

Implements the batch AVL verifier from https://eprint.iacr.org/2016/994

Linear Supertypes
AuthenticatedTreeOps[D], ToStringHelper, ScorexEncoding, BatchProofConstants, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BatchAVLVerifier
  2. AuthenticatedTreeOps
  3. ToStringHelper
  4. ScorexEncoding
  5. BatchProofConstants
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BatchAVLVerifier(startingDigest: ADDigest, proof: SerializedAdProof, keyLength: Int, valueLengthOpt: Option[Int], maxNumOperations: Option[Int] = None, maxDeletes: Option[Int] = None)(implicit hf: HF = Blake2b256)

    Permalink

    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

  1. type ChangeHappened = Boolean

    Permalink
    Definition Classes
    AuthenticatedTreeOps
  2. type HeightIncreased = Boolean

    Permalink
    Definition Classes
    AuthenticatedTreeOps
  3. type ToDelete = Boolean

    Permalink
    Definition Classes
    AuthenticatedTreeOps

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val EndOfTreeInPackagedProof: Byte

    Permalink
    Definition Classes
    BatchProofConstants
  5. val LabelInPackagedProof: Byte

    Permalink
    Definition Classes
    BatchProofConstants
  6. val LeafInPackagedProof: Byte

    Permalink
    Definition Classes
    BatchProofConstants
  7. val NegativeInfinityKey: ADKey

    Permalink
    Attributes
    protected
    Definition Classes
    AuthenticatedTreeOps
  8. val PositiveInfinityKey: ADKey

    Permalink
    Attributes
    protected
    Definition Classes
    AuthenticatedTreeOps
  9. def addNode(r: Leaf[D], key: ADKey, v: ADValue): InternalVerifierNode[D]

    Permalink

    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
    BatchAVLVerifierAuthenticatedTreeOps
  10. def arrayToString(a: Array[Byte]): String

    Permalink
    Attributes
    protected
    Definition Classes
    ToStringHelper
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. val changedNodesBuffer: ArrayBuffer[ProverNodes[D]]

    Permalink

    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
  13. val changedNodesBufferToCheck: ArrayBuffer[ProverNodes[D]]

    Permalink

    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
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. val collectChangedNodes: Boolean

    Permalink
    Definition Classes
    BatchAVLVerifierAuthenticatedTreeOps
  16. def digest: Option[ADDigest]

    Permalink

    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

  17. def digest(rootNode: Node[D]): ADDigest

    Permalink

    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
  18. implicit val encoder: BytesEncoder

    Permalink
    Definition Classes
    ScorexEncoding
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  21. def extractFirstNode(extractor: (VerifierNodes[D]) ⇒ Boolean): Option[VerifierNodes[D]]

    Permalink
  22. def extractNodes(extractor: (VerifierNodes[D]) ⇒ Boolean): Option[Seq[VerifierNodes[D]]]

    Permalink
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  25. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. val keyLength: Int

    Permalink

    - length of keys in tree

    - length of keys in tree

    Definition Classes
    BatchAVLVerifierAuthenticatedTreeOps
  28. def keyMatchesLeaf(key: ADKey, r: Leaf[D]): Boolean

    Permalink

    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
    BatchAVLVerifierAuthenticatedTreeOps
  29. val labelLength: Int

    Permalink
    Attributes
    protected
  30. def logError(t: Throwable): Unit

    Permalink

    Default implementation of error logging.

    Default implementation of error logging.

    Attributes
    protected
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. def nextDirectionIsLeft(key: ADKey, r: InternalNode[D]): Boolean

    Permalink

    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
    BatchAVLVerifierAuthenticatedTreeOps
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def onNodeVisit(n: Node[D], operation: Operation, isRotate: Boolean = false): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    AuthenticatedTreeOps
  36. def performOneOperation(operation: Operation): Try[Option[ADValue]]

    Permalink

    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

  37. def replayComparison: Int

    Permalink

    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
    BatchAVLVerifierAuthenticatedTreeOps
  38. def returnResultOfOneOperation(operation: Operation, rootNode: Node[D]): Try[(Node[D], Option[ADValue])]

    Permalink
    Attributes
    protected
    Definition Classes
    AuthenticatedTreeOps
  39. var rootNodeHeight: Int

    Permalink
    Attributes
    protected
    Definition Classes
    BatchAVLVerifierAuthenticatedTreeOps
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def toString(): String

    Permalink
    Definition Classes
    BatchAVLVerifier → AnyRef → Any
  42. val valueLengthOpt: Option[Int]

    Permalink

    - length of values in tree.

    - length of values in tree. None if it is not fixed

    Definition Classes
    BatchAVLVerifierAuthenticatedTreeOps
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AuthenticatedTreeOps[D]

Inherited from ToStringHelper

Inherited from ScorexEncoding

Inherited from BatchProofConstants

Inherited from AnyRef

Inherited from Any

Ungrouped