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
- Alphabetic
- By Inheritance
- CryptoRuntime
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def add(pk1: ECPublicKey, pk2: ECPublicKey): ECPublicKey
Adds two public keys together, failing if the sum is 0x00 (the point at infinity).
- abstract def cryptoContext: CryptoContext
- abstract def decodePoint(bytes: ByteVector): SecpPoint
- abstract def freshPrivateKey: ECPrivateKey
Generates a 32 byte private key
- abstract def hmac256(key: ByteVector, data: ByteVector): ByteVector
- abstract def hmac512(key: ByteVector, data: ByteVector): ByteVector
- abstract def normalize(str: String): String
- abstract def pbkdf2WithSha512(pass: ByteVector, salt: ByteVector, iterationCount: Int, derivedKeyLength: Int): ByteVector
- abstract def pubKeyTweakAdd(pubkey: ECPublicKey, privkey: ECPrivateKey): ECPublicKey
- abstract def publicKey(privateKey: ECPrivateKeyBytes): ECPublicKey
- abstract def randomBytes(n: Int): ByteVector
- 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
- abstract def ripeMd160(bytes: ByteVector): RipeMd160Digest
- abstract def secKeyVerify(privateKeybytes: ByteVector): Boolean
- abstract def sha1(bytes: ByteVector): Sha1Digest
- abstract def sha256(bytes: ByteVector): Sha256Digest
- abstract def sha256Hash160(bytes: ByteVector): Sha256Hash160Digest
- abstract def sha3_256(bytes: ByteVector): Sha3_256Digest
- abstract def sign(privateKey: ECPrivateKey, dataToSign: ByteVector): ECDigitalSignature
- abstract def signWithEntropy(privateKey: ECPrivateKey, bytes: ByteVector, entropy: ByteVector): ECDigitalSignature
- abstract def sipHash(item: ByteVector, key: SipHashKey): Long
https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki#hashing-data-objects
- 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
- abstract def tweakMultiply(publicKey: ECPublicKey, tweak: FieldElement): ECPublicKey
- abstract def verify(publicKey: ECPublicKeyApi, data: ByteVector, signature: ECDigitalSignature): Boolean
Concrete 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
- def adaptorComplete(key: ECPrivateKey, adaptorSignature: ECAdaptorSignature): ECDigitalSignature
- def adaptorSign(key: ECPrivateKey, adaptorPoint: ECPublicKey, msg: ByteVector, auxRand: ByteVector): ECAdaptorSignature
- def adaptorVerify(adaptorSignature: ECAdaptorSignature, key: ECPublicKey, msg: ByteVector, adaptorPoint: ECPublicKey): Boolean
- def add(point1: SecpPoint, point2: SecpPoint): SecpPoint
Adds two SecpPoints together and correctly handles the point at infinity (0x00).
- def add(pk1: ByteVector, pk2: ECPrivateKey): ByteVector
- def add(pk1: ECPrivateKey, pk2: ECPrivateKey): ECPrivateKey
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def checkEntropy(bytes: ByteVector): Boolean
- 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
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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.
- def decodePoint(pubKey: ECPublicKey): SecpPoint
- def decodeSignature(signature: ECDigitalSignature): (BigInt, BigInt)
- def decompressed[PK <: ECPublicKeyApi](publicKey: PK): decompressed.publicKey.type
- def decompressed[PK <: ECPublicKeyApi](pubKeyBytes: ByteVector, fromBytes: (ByteVector) => PK): PK
- def decompressed(pubKeyBytes: ByteVector): ByteVector
- def doubleSHA256(bytes: ByteVector): DoubleSha256Digest
Performs sha256(sha256(bytes)).
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def extractAdaptorSecret(signature: ECDigitalSignature, adaptorSignature: ECAdaptorSignature, key: ECPublicKey): ECPrivateKey
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isDEREncoded(signature: ECDigitalSignature): Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isValidPubKey(pubKey: ECPublicKeyApi): Boolean
- def isValidSignatureEncoding(signature: ECDigitalSignature): Boolean
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def pbkdf2WithSha512(pass: String, salt: String, iterationCount: Int, derivedKeyLength: Int): ByteVector
- def schnorrComputeSigPoint(data: ByteVector, nonce: SchnorrNonce, pubKey: SchnorrPublicKey, compressed: Boolean): ECPublicKey
- def schnorrSign(dataToSign: ByteVector, privateKey: ECPrivateKey, auxRand: ByteVector): SchnorrDigitalSignature
- def schnorrSignWithNonce(dataToSign: ByteVector, privateKey: ECPrivateKey, nonceKey: ECPrivateKey): SchnorrDigitalSignature
- def schnorrVerify(data: ByteVector, schnorrPubKey: SchnorrPublicKey, signature: SchnorrDigitalSignature): Boolean
- def serializeForHash(str: String): ByteVector
- def sha256(bitVector: BitVector): Sha256Digest
- def sha256(str: String): Sha256Digest
- def sha256DLCAnnouncement(bytes: ByteVector): Sha256Digest
- def sha256DLCAttestation(str: String): Sha256Digest
- def sha256DLCAttestation(bytes: ByteVector): Sha256Digest
- def sha256DLEQ(bytes: ByteVector): Sha256Digest
- def sha256ECDSAAdaptorAux(bytes: ByteVector): Sha256Digest
- def sha256ECDSAAdaptorNonce(bytes: ByteVector): Sha256Digest
- def sha256SchnorrAuxRand(bytes: ByteVector): Sha256Digest
- def sha256SchnorrChallenge(bytes: ByteVector): Sha256Digest
- def sha256SchnorrNonce(bytes: ByteVector): Sha256Digest
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def taggedSha256(bytes: ByteVector, tag: String): Sha256Digest
- def tapBranchHash(bytes: ByteVector): Sha256Digest
- def tapLeafHash(bytes: ByteVector): Sha256Digest
- def tapTweakHash(bytes: ByteVector): Sha256Digest
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tweakMultiply(point: SecpPoint, tweak: FieldElement): SecpPoint
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()