rearranges the crypto package into separate nips and reduces the amount of circular dependencies.

This commit is contained in:
Vitor Pamplona
2024-06-25 12:13:17 -04:00
parent 79ace7f18c
commit a8a2bda9af
34 changed files with 468 additions and 461 deletions

View File

@@ -50,7 +50,7 @@ class CryptoBenchmark {
val keyPair2 = KeyPair()
benchmarkRule.measureRepeated {
assertNotNull(CryptoUtils.getSharedSecretNIP44v1(keyPair1.privKey!!, keyPair2.pubKey))
assertNotNull(CryptoUtils.nip44.v1.getSharedSecret(keyPair1.privKey!!, keyPair2.pubKey))
}
}
@@ -70,7 +70,7 @@ class CryptoBenchmark {
val keyPair2 = KeyPair()
benchmarkRule.measureRepeated {
assertNotNull(CryptoUtils.computeSharedSecretNIP44v1(keyPair1.privKey!!, keyPair2.pubKey))
assertNotNull(CryptoUtils.nip44.v1.computeSharedSecret(keyPair1.privKey!!, keyPair2.pubKey))
}
}

View File

@@ -165,7 +165,7 @@ class GiftWrapReceivingBenchmark {
benchmarkRule.measureRepeated {
assertNotNull(
CryptoUtils.decryptNIP44v2(
CryptoUtils.decryptNIP44(
wrap.content,
receiver.keyPair.privKey!!,
wrap.pubKey.hexToByteArray(),
@@ -182,7 +182,7 @@ class GiftWrapReceivingBenchmark {
val wrap = createWrap(sender, receiver)
val innerJson =
CryptoUtils.decryptNIP44v2(
CryptoUtils.decryptNIP44(
wrap.content,
receiver.keyPair.privKey!!,
wrap.pubKey.hexToByteArray(),
@@ -200,7 +200,7 @@ class GiftWrapReceivingBenchmark {
benchmarkRule.measureRepeated {
assertNotNull(
CryptoUtils.decryptNIP44v2(
CryptoUtils.decryptNIP44(
seal.content,
receiver.keyPair.privKey!!,
seal.pubKey.hexToByteArray(),
@@ -217,7 +217,7 @@ class GiftWrapReceivingBenchmark {
val seal = createSeal(sender, receiver)
val innerJson =
CryptoUtils.decryptNIP44v2(
CryptoUtils.decryptNIP44(
seal.content,
receiver.keyPair.privKey!!,
seal.pubKey.hexToByteArray(),