trait CryptoUtil extends CryptoRuntime

Utility cryptographic functions This is a proxy for the underlying implementation of CryptoRuntime such as LibSecp256k1CryptoRuntime.

This is necessary so that the core module doesn't need to be refactored to add support for multiple platforms, it can keep referencing CryptoUtil

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CryptoUtil
  2. CryptoRuntime
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def adaptorComplete(key: ECPrivateKey, adaptorSignature: ECAdaptorSignature): ECDigitalSignature
    Definition Classes
    CryptoUtilCryptoRuntime
  5. def adaptorSign(key: ECPrivateKey, adaptorPoint: ECPublicKey, msg: ByteVector, auxRand: ByteVector): ECAdaptorSignature
    Definition Classes
    CryptoUtilCryptoRuntime
  6. def adaptorVerify(adaptorSignature: ECAdaptorSignature, key: ECPublicKey, msg: ByteVector, adaptorPoint: ECPublicKey): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  7. def add(pk1: ECPublicKey, pk2: ECPublicKey): ECPublicKey

    Adds two public keys together, failing if the sum is 0x00 (the point at infinity).

    Adds two public keys together, failing if the sum is 0x00 (the point at infinity).

    Definition Classes
    CryptoUtilCryptoRuntime
  8. def add(point1: SecpPoint, point2: SecpPoint): SecpPoint

    Adds two SecpPoints together and correctly handles the point at infinity (0x00).

    Adds two SecpPoints together and correctly handles the point at infinity (0x00).

    Definition Classes
    CryptoUtilCryptoRuntime
  9. def add(pk1: ByteVector, pk2: ECPrivateKey): ByteVector
    Definition Classes
    CryptoUtilCryptoRuntime
  10. def add(pk1: ECPrivateKey, pk2: ECPrivateKey): ECPrivateKey
    Definition Classes
    CryptoUtilCryptoRuntime
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def checkEntropy(bytes: ByteVector): Boolean
    Definition Classes
    CryptoRuntime
  13. def checkEntropy(bitVector: BitVector): Boolean

    Implements basic sanity tests for checking entropy like making sure it isn't all the same bytes, it isn't all 0x00...00 or it isn't all 0xffff...fff

    Implements basic sanity tests for checking entropy like making sure it isn't all the same bytes, it isn't all 0x00...00 or it isn't all 0xffff...fff

    Definition Classes
    CryptoRuntime
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  15. def combinePubKeys(pubKeys: Vector[ECPublicKey]): ECPublicKey

    Adds a Vector of public keys together, failing only if the total sum is 0x00 (the point at infinity), but still succeeding if sub-sums are 0x00.

    Adds a Vector of public keys together, failing only if the total sum is 0x00 (the point at infinity), but still succeeding if sub-sums are 0x00.

    Definition Classes
    CryptoUtilCryptoRuntime
  16. lazy val cryptoContext: CryptoContext
    Definition Classes
    CryptoUtilCryptoRuntime
  17. def decodePoint(bytes: ByteVector): SecpPoint
    Definition Classes
    CryptoUtilCryptoRuntime
  18. def decodePoint(pubKey: ECPublicKey): SecpPoint
    Definition Classes
    CryptoRuntime
  19. def decodeSignature(signature: ECDigitalSignature): (BigInt, BigInt)
    Definition Classes
    CryptoUtilCryptoRuntime
  20. def decompressed[PK <: PublicKey](publicKey: PK): decompressed.publicKey.type
    Definition Classes
    CryptoUtilCryptoRuntime
  21. def decompressed(pubKeyBytes: ByteVector): ByteVector
    Definition Classes
    CryptoUtilCryptoRuntime
  22. def decompressed[PK <: PublicKey](pubKeyBytes: ByteVector, fromBytes: (ByteVector) => PK): PK
    Definition Classes
    CryptoRuntime
  23. def doubleSHA256(str: String): DoubleSha256Digest
  24. def doubleSHA256(bytes: ByteVector): DoubleSha256Digest

    Performs sha256(sha256(bytes)).

    Performs sha256(sha256(bytes)).

    Definition Classes
    CryptoRuntime
  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  27. def extractAdaptorSecret(signature: ECDigitalSignature, adaptorSignature: ECAdaptorSignature, key: ECPublicKey): ECPrivateKey
    Definition Classes
    CryptoUtilCryptoRuntime
  28. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  29. def freshPrivateKey: ECPrivateKey

    Generates a 32 byte private key

    Generates a 32 byte private key

    Definition Classes
    CryptoUtilCryptoRuntime
  30. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. def hmac512(key: ByteVector, data: ByteVector): ByteVector

    Calculates HMAC-SHA512(key, data)

    Calculates HMAC-SHA512(key, data)

    Definition Classes
    CryptoUtilCryptoRuntime
  33. def isDEREncoded(signature: ECDigitalSignature): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def isValidPubKey(pubKey: PublicKey): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  36. def isValidSignatureEncoding(signature: ECDigitalSignature): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. def normalize(str: String): String
    Definition Classes
    CryptoUtilCryptoRuntime
  39. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. def pbkdf2WithSha512(pass: ByteVector, salt: ByteVector, iterationCount: Int, derivedKeyLength: Int): ByteVector
    Definition Classes
    CryptoUtilCryptoRuntime
  42. def pbkdf2WithSha512(pass: String, salt: String, iterationCount: Int, derivedKeyLength: Int): ByteVector
    Definition Classes
    CryptoRuntime
  43. def pubKeyTweakAdd(pubkey: ECPublicKey, privkey: ECPrivateKey): ECPublicKey
    Definition Classes
    CryptoUtilCryptoRuntime
  44. def publicKey(privateKey: ECPrivateKey): ECPublicKey
    Definition Classes
    CryptoUtilCryptoRuntime
  45. def randomBytes(n: Int): ByteVector
    Definition Classes
    CryptoUtilCryptoRuntime
  46. def recoverPublicKey(signature: ECDigitalSignature, message: ByteVector): (ECPublicKey, ECPublicKey)

    Recover public keys from a signature and the message that was signed.

    Recover public keys from a signature and the message that was signed. This method will return 2 public keys, and the signature can be verified with both, but only one of them matches that private key that was used to generate the signature.

    signature

    signature

    message

    message that was signed

    returns

    a (pub1, pub2) tuple where pub1 and pub2 are candidates public keys. If you have the recovery id then use pub1 if the recovery id is even and pub2 if it is odd

    Definition Classes
    CryptoUtilCryptoRuntime
  47. def ripeMd160(str: String): RipeMd160Digest
  48. def ripeMd160(bytes: ByteVector): RipeMd160Digest

    Performs RIPEMD160(bytes).

    Performs RIPEMD160(bytes).

    Definition Classes
    CryptoUtilCryptoRuntime
  49. def schnorrComputeSigPoint(data: ByteVector, nonce: SchnorrNonce, pubKey: SchnorrPublicKey, compressed: Boolean): ECPublicKey
    Definition Classes
    CryptoUtilCryptoRuntime
  50. def schnorrSign(dataToSign: ByteVector, privateKey: ECPrivateKey, auxRand: ByteVector): SchnorrDigitalSignature
    Definition Classes
    CryptoUtilCryptoRuntime
  51. def schnorrSignWithNonce(dataToSign: ByteVector, privateKey: ECPrivateKey, nonceKey: ECPrivateKey): SchnorrDigitalSignature
    Definition Classes
    CryptoUtilCryptoRuntime
  52. def schnorrVerify(data: ByteVector, schnorrPubKey: SchnorrPublicKey, signature: SchnorrDigitalSignature): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  53. def secKeyVerify(privateKeybytes: ByteVector): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  54. def serializeForHash(str: String): ByteVector
    Definition Classes
    CryptoRuntime
  55. def sha1(str: String): Sha1Digest
  56. def sha1(bytes: ByteVector): Sha1Digest

    Performs SHA1(bytes).

    Performs SHA1(bytes).

    Definition Classes
    CryptoUtilCryptoRuntime
  57. def sha256(bytes: ByteVector): Sha256Digest

    Takes sha256(bytes).

    Takes sha256(bytes).

    Definition Classes
    CryptoUtilCryptoRuntime
  58. def sha256(bitVector: BitVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  59. def sha256(str: String): Sha256Digest
    Definition Classes
    CryptoRuntime
  60. def sha256DLCAnnouncement(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  61. def sha256DLCAttestation(str: String): Sha256Digest
    Definition Classes
    CryptoRuntime
  62. def sha256DLCAttestation(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  63. def sha256DLEQ(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  64. def sha256ECDSAAdaptorAux(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  65. def sha256ECDSAAdaptorNonce(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  66. def sha256Hash160(str: String): Sha256Hash160Digest
  67. def sha256Hash160(bytes: ByteVector): Sha256Hash160Digest

    Does the following computation: RIPEMD160(SHA256(hex)).

    Does the following computation: RIPEMD160(SHA256(hex)).

    Definition Classes
    CryptoUtilCryptoRuntime
  68. def sha256SchnorrAuxRand(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  69. def sha256SchnorrChallenge(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  70. def sha256SchnorrNonce(bytes: ByteVector): Sha256Digest
    Definition Classes
    CryptoRuntime
  71. def sign(privateKey: ECPrivateKey, dataToSign: ByteVector): ECDigitalSignature
    Definition Classes
    CryptoUtilCryptoRuntime
  72. def signWithEntropy(privateKey: ECPrivateKey, bytes: ByteVector, entropy: ByteVector): ECDigitalSignature
    Definition Classes
    CryptoUtilCryptoRuntime
  73. def sipHash(item: ByteVector, key: SipHashKey): Long

    https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki#hashing-data-objects

    https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki#hashing-data-objects

    Definition Classes
    CryptoUtilCryptoRuntime
  74. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  75. def taggedSha256(str: String, tag: String): Sha256Digest
  76. def taggedSha256(bytes: ByteVector, tag: String): Sha256Digest
    Definition Classes
    CryptoRuntime
  77. def toPublicKey(privateKey: ECPrivateKey): ECPublicKey

    Converts a private key -> public key

    Converts a private key -> public key

    privateKey

    the private key we want the corresponding public key for

    Definition Classes
    CryptoUtilCryptoRuntime
  78. def toString(): String
    Definition Classes
    AnyRef → Any
  79. def tweakMultiply(publicKey: ECPublicKey, tweak: FieldElement): ECPublicKey
    Definition Classes
    CryptoUtilCryptoRuntime
  80. def verify(publicKey: PublicKey, data: ByteVector, signature: ECDigitalSignature): Boolean
    Definition Classes
    CryptoUtilCryptoRuntime
  81. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  82. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  83. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from CryptoRuntime

Inherited from AnyRef

Inherited from Any

Ungrouped