Object

sigmastate.crypto

CryptoFacade

Related Doc: package crypto

Permalink

object CryptoFacade

A facade for cryptographic operations. The concrete implementation is delegated to the Platform object, which is resolved by the compiler to either JVM or JS implementation. Cross-platform code should use this facade instead of the Platform object directly.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CryptoFacade
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 BitcoinSeed: Array[Byte]

    Permalink

    Used as the key parameter of hashHmacSHA512

  5. val Encoding: String

    Permalink

    Default encoding used for Strings.

  6. val Pbkdf2Iterations: Int

    Permalink

    Number of iteration specified in BIP39 standard.

  7. val Pbkdf2KeyLength: Int

    Permalink

    The size of the key in bits.

  8. val SecretKeyLength: Int

    Permalink

    part of the protocol, do not change

  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def createCryptoContext(): CryptoContext

    Permalink

    Create a new context for cryptographic operations.

  12. def createSecureRandom(): SecureRandom

    Permalink

    Create source of secure randomness.

  13. def encodeFieldElem(p: ECFieldElem): Array[Byte]

    Permalink

    Returns byte representation of the given field element.

  14. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def exponentiatePoint(p: Ecp, n: BigInteger): Ecp

    Permalink

    Exponentiate a point.

    Exponentiate a point.

    p

    point to exponentiate

    n

    exponent

    returns

    p to the power of n (p^n) i.e. p + p + ... + p (n times)

  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def generatePbkdf2Key(normalizedMnemonic: String, normalizedPass: String): Array[Byte]

    Permalink

    Generates PBKDF2 key from a mnemonic and passphrase using SHA512 digest.

  19. def getASN1Encoding(p: Ecp, compressed: Boolean): Array[Byte]

    Permalink

    Byte representation of the given point.

    Byte representation of the given point.

    ASN.1, short for Abstract Syntax Notation One, is a standard and notation that describes data structures for representing, encoding, transmitting, and decoding data.

    The ASN.1 encoding of EC point according to this standard can be one of two forms:

    Compressed form: This is a shorter form where only the x coordinate and a bit of information about the y coordinate are stored. The full y coordinate can be recalculated from this information. The compressed form begins with a byte value of 02 or 03 (depending on the y coordinate), followed by the x coordinate.

    Uncompressed form: This is a longer form where both the x and y coordinates are stored. The uncompressed form begins with a byte value of 04, followed by the x coordinate, and then the y coordinate.

    NOTE, this encoding is not used in ErgoTree and not part of consensus, it is used for extended keys (in the wallet) to ensure BIP32 compatibility.

    p

    point to encode

    compressed

    if true, generates a compressed point encoding

  20. def getAffineXCoord(p: Ecp): ECFieldElem

    Permalink

    Returns the affine x-coordinate after checking that this point is normalized.

    Returns the affine x-coordinate after checking that this point is normalized.

    returns

    The affine x-coordinate of this point

    Exceptions thrown

    IllegalStateException if the point is not normalized

  21. def getAffineYCoord(p: Ecp): ECFieldElem

    Permalink

    Returns the affine y-coordinate after checking that this point is normalized

    Returns the affine y-coordinate after checking that this point is normalized

    returns

    The affine y-coordinate of this point

    Exceptions thrown

    IllegalStateException if the point is not normalized

  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def getCurve(p: Ecp): Curve

    Permalink

    A Curve instance describing the elliptic curve of the point p

    A Curve instance describing the elliptic curve of the point p

    p

    the elliptic curve point

  24. def getXCoord(p: Ecp): ECFieldElem

    Permalink

    Returns the x-coordinate.

    Returns the x-coordinate.

    Caution: depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineXCoord() if you expect the point to already have been normalized.

    returns

    the x-coordinate of this point

  25. def getYCoord(p: Ecp): ECFieldElem

    Permalink

    Returns the y-coordinate.

    Returns the y-coordinate.

    Caution: depending on the curve's coordinate system, this may not be the same value as in an affine coordinate system; use normalize() to get a point where the coordinates have their affine values, or use getAffineYCoord() if you expect the point to already have been normalized.

    returns

    the y-coordinate of this point

  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. def hashHmacSHA512(key: Array[Byte], data: Array[Byte]): Array[Byte]

    Permalink

    Computes HMAC-SHA512 hash of the given data using the specified key.

    Computes HMAC-SHA512 hash of the given data using the specified key.

    key

    the secret key used for hashing

    data

    the input data to be hashed

    returns

    a HMAC-SHA512 hash of the input data

  28. def isInfinityPoint(p: Ecp): Boolean

    Permalink

    Check if a point is infinity.

  29. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  30. def multiplyPoints(p1: Ecp, p2: Ecp): Ecp

    Permalink

    Multiply two points.

    Multiply two points.

    p1

    first point

    p2

    second point

    returns

    group multiplication (p1 * p2)

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

    Permalink
    Definition Classes
    AnyRef
  32. def negatePoint(p: Ecp): Ecp

    Permalink

    Negates the given point by negating its y coordinate.

  33. def normalizeChars(chars: Array[Char]): String

    Permalink

    Normalize a sequence of char values using NFKD normalization form.

  34. def normalizePoint(p: Ecp): Ecp

    Permalink

    Normalization ensures that any projective coordinate is 1, and therefore that the x, y coordinates reflect those of the equivalent point in an affine coordinate system.

    Normalization ensures that any projective coordinate is 1, and therefore that the x, y coordinates reflect those of the equivalent point in an affine coordinate system.

    returns

    a new ECPoint instance representing the same point, but with normalized coordinates

  35. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  37. def showPoint(p: Ecp): String

    Permalink

    Return simplified string representation of the point (used only for debugging)

  38. def signOf(p: ECFieldElem): Boolean

    Permalink

    Returns the sign of the field element.

  39. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  41. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped