Fixes and improvements, SystemTest still broken

This commit is contained in:
2017-06-16 07:03:12 +02:00
parent 1d3340a547
commit 894e0ff724
62 changed files with 1364 additions and 1276 deletions

View File

@ -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")
}
}

View File

@ -163,7 +163,7 @@ class CryptographyTest {
val TEST_RIPEMD160 = DatatypeConverter.parseHexBinary(""
+ "cd566972b5e50104011a92b59fa8e0b1234851ae")
private val crypto = BouncyCryptography
private val crypto = BouncyCryptography()
init {
Singleton.initialize(crypto)