use asByteArray _view_ where possible (optimization)

This commit is contained in:
sergeych committed 2024-08-19 11:58:52 +02:00
1 parent b5ac0c4e7e
commit 6431d4896a
17 files changed
+50 -22

No files matched your search

+12
View File
@@ -250,4 +250,16 @@ class KeysTest {
val k1: UniversalKey = biunpack<UniversalKey>(d) as SymmetricKey
assertEquals(k, k1)
}
@Test
fun verifyingKeySerializationTest() = runTest {
initCrypto()
val k = SigningSecretKey.new()
val s1 = pack(k)
val s2 = pack(k.verifyingKey)
val dk1 = unpack<SigningSecretKey>(s1)
val dk2 = unpack<VerifyingPublicKey>(s2)
assertEquals(k, dk1)
assertEquals(k.verifyingKey, dk2)
}
}