Packages

t

org.bitcoins.crypto

CryptoRuntime

trait CryptoRuntime extends AnyRef

Trait that should be extended by specific runtimes like javascript or the JVM to support crypto functions needed for bitcoin-s

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

Abstract Value Members

  1. abstract def add(pk1: ECPublicKey, pk2: ECPublicKey): ECPublicKey

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

  2. abstract val cryptoContext: CryptoContext
  3. abstract def decodePoint(bytes: ByteVector): SecpPoint
  4. abstract def freshPrivateKey: ECPrivateKey

    Generates a 32 byte private key

  5. abstract def hmac256(key: ByteVector, data: ByteVector): ByteVector
  6. abstract def hmac512(key: ByteVector, data: ByteVector): ByteVector
  7. abstract def normalize(str: String): String
  8. abstract def pbkdf2WithSha512(pass: ByteVector, salt: ByteVector, iterationCount: Int, derivedKeyLength: Int): ByteVector
  9. abstract def pubKeyTweakAdd(pubkey: ECPublicKey, privkey: ECPrivateKey): ECPublicKey
  10. abstract def publicKey(privateKey: ECPrivateKeyBytes): ECPublicKey
  11. abstract def randomBytes(n: Int): ByteVector
  12. abstract 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

  13. abstract def ripeMd160(bytes: ByteVector): RipeMd160Digest
  14. abstract def secKeyVerify(privateKeybytes: ByteVector): Boolean
  15. abstract def sha1(bytes: ByteVector): Sha1Digest
  16. abstract def sha256(bytes: ByteVector): Sha256Digest
  17. abstract def sha256Hash160(bytes: ByteVector): Sha256Hash160Digest
  18. abstract def sha3_256(bytes: ByteVector): Sha3_256Digest
  19. abstract def sign(privateKey: ECPrivateKey, dataToSign: ByteVector): ECDigitalSignature
  20. abstract def signWithEntropy(privateKey: ECPrivateKey, bytes: ByteVector, entropy: ByteVector): ECDigitalSignature
  21. abstract def sipHash(item: ByteVector, key: SipHashKey): Long

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

  22. abstract def toPublicKey(privateKey: ECPrivateKeyBytes): ECPublicKey

    Converts a private key -> public key

    Converts a private key -> public key

    privateKey

    the private key we want the corresponding public key for

  23. abstract def tweakMultiply(publicKey: ECPublicKey, tweak: FieldElement): ECPublicKey
  24. abstract def verify(publicKey: ECPublicKeyApi, data: ByteVector, signature: ECDigitalSignature): Boolean

Concrete 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
  5. def adaptorSign(key: ECPrivateKey, adaptorPoint: ECPublicKey, msg: ByteVector, auxRand: ByteVector): ECAdaptorSignature
  6. def adaptorVerify(adaptorSignature: ECAdaptorSignature, key: ECPublicKey, msg: ByteVector, adaptorPoint: ECPublicKey): Boolean
  7. def add(point1: SecpPoint, point2: SecpPoint): SecpPoint

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

  8. def add(pk1: ByteVector, pk2: ECPrivateKey): ByteVector
  9. def add(pk1: ECPrivateKey, pk2: ECPrivateKey): ECPrivateKey
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def checkEntropy(bytes: ByteVector): Boolean
  12. 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

  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. def combinePubKeys(pubKeys: Vector[ECPublicKey], isCompressed: Boolean = true): 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.

  15. def decodePoint(pubKey: ECPublicKey): SecpPoint
  16. def decodeSignature(signature: ECDigitalSignature): (BigInt, BigInt)
  17. def decompressed[PK <: ECPublicKeyApi](publicKey: PK): decompressed.publicKey.type
  18. def decompressed[PK <: ECPublicKeyApi](pubKeyBytes: ByteVector, fromBytes: (ByteVector) => PK): PK
  19. def decompressed(pubKeyBytes: ByteVector): ByteVector
  20. def doubleSHA256(bytes: ByteVector): DoubleSha256Digest

    Performs sha256(sha256(bytes)).

  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def extractAdaptorSecret(signature: ECDigitalSignature, adaptorSignature: ECAdaptorSignature, key: ECPublicKey): ECPrivateKey
  24. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def isDEREncoded(signature: ECDigitalSignature): Boolean
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def isValidPubKey(pubKey: ECPublicKeyApi): Boolean
  30. def isValidSignatureEncoding(signature: ECDigitalSignature): Boolean
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. def pbkdf2WithSha512(pass: String, salt: String, iterationCount: Int, derivedKeyLength: Int): ByteVector
  35. def schnorrComputeSigPoint(data: ByteVector, nonce: SchnorrNonce, pubKey: SchnorrPublicKey, compressed: Boolean): ECPublicKey
  36. def schnorrSign(dataToSign: ByteVector, privateKey: ECPrivateKey, auxRand: ByteVector): SchnorrDigitalSignature
  37. def schnorrSignWithNonce(dataToSign: ByteVector, privateKey: ECPrivateKey, nonceKey: ECPrivateKey): SchnorrDigitalSignature
  38. def schnorrVerify(data: ByteVector, schnorrPubKey: SchnorrPublicKey, signature: SchnorrDigitalSignature): Boolean
  39. def serializeForHash(str: String): ByteVector
  40. def sha256(bitVector: BitVector): Sha256Digest
  41. def sha256(str: String): Sha256Digest
  42. def sha256DLCAnnouncement(bytes: ByteVector): Sha256Digest
  43. def sha256DLCAttestation(str: String): Sha256Digest
  44. def sha256DLCAttestation(bytes: ByteVector): Sha256Digest
  45. def sha256DLEQ(bytes: ByteVector): Sha256Digest
  46. def sha256ECDSAAdaptorAux(bytes: ByteVector): Sha256Digest
  47. def sha256ECDSAAdaptorNonce(bytes: ByteVector): Sha256Digest
  48. def sha256SchnorrAuxRand(bytes: ByteVector): Sha256Digest
  49. def sha256SchnorrChallenge(bytes: ByteVector): Sha256Digest
  50. def sha256SchnorrNonce(bytes: ByteVector): Sha256Digest
  51. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  52. def taggedSha256(bytes: ByteVector, tag: String): Sha256Digest
  53. def tapBranchHash(bytes: ByteVector): Sha256Digest
  54. def tapLeafHash(bytes: ByteVector): Sha256Digest
  55. def tapTweakHash(bytes: ByteVector): Sha256Digest
  56. def toString(): String
    Definition Classes
    AnyRef → Any
  57. def tweakMultiply(point: SecpPoint, tweak: FieldElement): SecpPoint
  58. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  59. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  60. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped