trait BouncycastleCryptoRuntime extends CryptoRuntime
This is an implementation of CryptoRuntime that defaults to Bouncy Castle (https://bouncycastle.org/) and java.security.
- Alphabetic
- By Inheritance
- BouncycastleCryptoRuntime
- CryptoRuntime
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- Definition Classes
- CryptoRuntime
- def adaptorSign(key: ECPrivateKey, adaptorPoint: ECPublicKey, msg: ByteVector, auxRand: ByteVector): ECAdaptorSignature
- Definition Classes
- CryptoRuntime
- def adaptorVerify(adaptorSignature: ECAdaptorSignature, key: ECPublicKey, msg: ByteVector, adaptorPoint: ECPublicKey): Boolean
- Definition Classes
- CryptoRuntime
- 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
- BouncycastleCryptoRuntime → CryptoRuntime
- 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
- CryptoRuntime
- def add(pk1: ByteVector, pk2: ECPrivateKey): ByteVector
- Definition Classes
- CryptoRuntime
- def add(pk1: ECPrivateKey, pk2: ECPrivateKey): ECPrivateKey
- Definition Classes
- CryptoRuntime
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def checkEntropy(bytes: ByteVector): Boolean
- Definition Classes
- CryptoRuntime
- 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
- 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.
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
- CryptoRuntime
- val cryptoContext: CryptoContext
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def decodePoint(bytes: ByteVector): SecpPoint
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def decodePoint(pubKey: ECPublicKey): SecpPoint
- Definition Classes
- CryptoRuntime
- def decodeSignature(signature: ECDigitalSignature): (BigInt, BigInt)
- Definition Classes
- CryptoRuntime
- def decompressed[PK <: ECPublicKeyApi](publicKey: PK): CryptoRuntime.decompressed.publicKey.type
- Definition Classes
- CryptoRuntime
- def decompressed[PK <: ECPublicKeyApi](pubKeyBytes: ByteVector, fromBytes: (ByteVector) => PK): PK
- Definition Classes
- CryptoRuntime
- def decompressed(pubKeyBytes: ByteVector): ByteVector
- Definition Classes
- CryptoRuntime
- def doubleSHA256(bytes: ByteVector): DoubleSha256Digest
Performs sha256(sha256(bytes)).
Performs sha256(sha256(bytes)).
- Definition Classes
- CryptoRuntime
- 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
- Definition Classes
- CryptoRuntime
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def freshPrivateKey: ECPrivateKey
Cribbed from ECKeyPairGenerator::generateKeyPair
Cribbed from ECKeyPairGenerator::generateKeyPair
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- See also
https://github.com/bcgit/bc-java/blob/63b18eb973f5731e403f655ee81d6b8456f5b256/core/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java#L39
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hmac256(key: ByteVector, data: ByteVector): ByteVector
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def hmac512(key: ByteVector, data: ByteVector): ByteVector
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def isDEREncoded(signature: ECDigitalSignature): Boolean
- Definition Classes
- CryptoRuntime
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isValidPubKey(pubKey: ECPublicKeyApi): Boolean
- Definition Classes
- CryptoRuntime
- def isValidSignatureEncoding(signature: ECDigitalSignature): Boolean
- Definition Classes
- CryptoRuntime
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def normalize(str: String): String
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def pbkdf2WithSha512(pass: ByteVector, salt: ByteVector, iterationCount: Int, derivedKeyLength: Int): ByteVector
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def pbkdf2WithSha512(pass: String, salt: String, iterationCount: Int, derivedKeyLength: Int): ByteVector
- Definition Classes
- CryptoRuntime
- def pubKeyTweakAdd(pubkey: ECPublicKey, privkey: ECPrivateKey): ECPublicKey
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def publicKey(privateKey: ECPrivateKeyBytes): ECPublicKey
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def randomBytes(n: Int): ByteVector
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def recoverPoint(x: BigInteger): (ECPoint, ECPoint)
- x
x coordinate
- returns
a tuple (p1, p2) where p1 and p2 are points on the curve and p1.x = p2.x \= x p1.y is even, p2.y is odd
- 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
- BouncycastleCryptoRuntime → CryptoRuntime
- def ripeMd160(bytes: ByteVector): RipeMd160Digest
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def schnorrComputeSigPoint(data: ByteVector, nonce: SchnorrNonce, pubKey: SchnorrPublicKey, compressed: Boolean): ECPublicKey
- Definition Classes
- CryptoRuntime
- def schnorrSign(dataToSign: ByteVector, privateKey: ECPrivateKey, auxRand: ByteVector): SchnorrDigitalSignature
- Definition Classes
- CryptoRuntime
- def schnorrSignWithNonce(dataToSign: ByteVector, privateKey: ECPrivateKey, nonceKey: ECPrivateKey): SchnorrDigitalSignature
- Definition Classes
- CryptoRuntime
- def schnorrVerify(data: ByteVector, schnorrPubKey: SchnorrPublicKey, signature: SchnorrDigitalSignature): Boolean
- Definition Classes
- CryptoRuntime
- def secKeyVerify(privateKeyBytes: ByteVector): Boolean
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def serializeForHash(str: String): ByteVector
- Definition Classes
- CryptoRuntime
- def sha1(bytes: ByteVector): Sha1Digest
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def sha256(bytes: ByteVector): Sha256Digest
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def sha256(bitVector: BitVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256(str: String): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256DLCAnnouncement(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256DLCAttestation(str: String): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256DLCAttestation(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256DLEQ(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256ECDSAAdaptorAux(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256ECDSAAdaptorNonce(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256Hash160(bytes: ByteVector): Sha256Hash160Digest
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def sha256SchnorrAuxRand(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256SchnorrChallenge(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha256SchnorrNonce(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def sha3_256(bytes: ByteVector): Sha3_256Digest
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def sign(privateKey: ECPrivateKey, dataToSign: ByteVector): ECDigitalSignature
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def signWithEntropy(privateKey: ECPrivateKey, bytes: ByteVector, entropy: ByteVector): ECDigitalSignature
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- 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
- BouncycastleCryptoRuntime → CryptoRuntime
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def taggedSha256(bytes: ByteVector, tag: String): Sha256Digest
- Definition Classes
- CryptoRuntime
- def tapBranchHash(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def tapLeafHash(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- def tapTweakHash(bytes: ByteVector): Sha256Digest
- Definition Classes
- CryptoRuntime
- 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
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tweakMultiply(publicKey: ECPublicKey, tweak: FieldElement): ECPublicKey
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- def tweakMultiply(point: SecpPoint, tweak: FieldElement): SecpPoint
- Definition Classes
- CryptoRuntime
- def verify(publicKey: ECPublicKeyApi, data: ByteVector, signature: ECDigitalSignature): Boolean
- Definition Classes
- BouncycastleCryptoRuntime → CryptoRuntime
- 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()