Fixes and improvements, SystemTest still broken
This commit is contained in:
@ -40,8 +40,7 @@ import java.util.*
|
||||
* As Spongycastle can't be used on the Oracle JVM, and Bouncycastle doesn't work properly on Android (thanks, Google),
|
||||
* this is the Bouncycastle implementation.
|
||||
*/
|
||||
object BouncyCryptography : AbstractCryptography(BouncyCastleProvider()) {
|
||||
private val EC_CURVE_PARAMETERS = CustomNamedCurves.getByName("secp256k1")
|
||||
class BouncyCryptography : AbstractCryptography(BouncyCastleProvider()) {
|
||||
|
||||
override fun crypt(encrypt: Boolean, data: ByteArray, key_e: ByteArray, initializationVector: ByteArray): ByteArray {
|
||||
val cipher = PaddedBufferedBlockCipher(
|
||||
@ -119,4 +118,8 @@ object BouncyCryptography : AbstractCryptography(BouncyCastleProvider()) {
|
||||
BigInteger(1, y)
|
||||
).getEncoded(false)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val EC_CURVE_PARAMETERS = CustomNamedCurves.getByName("secp256k1")
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ class CryptographyTest {
|
||||
val TEST_RIPEMD160 = DatatypeConverter.parseHexBinary(""
|
||||
+ "cd566972b5e50104011a92b59fa8e0b1234851ae")
|
||||
|
||||
private val crypto = BouncyCryptography
|
||||
private val crypto = BouncyCryptography()
|
||||
|
||||
init {
|
||||
Singleton.initialize(crypto)
|
||||
|
Reference in New Issue
Block a user