Merge pull request #21 from ionspin/20-ed25519-curve-pk-conversion-fix
Fix ed25519PkToCurve25519 jvm and native implementations
This commit is contained in:
commit
9681309cde
@ -24,14 +24,13 @@ object Versions {
|
|||||||
val dokkaPlugin = "1.5.0"
|
val dokkaPlugin = "1.5.0"
|
||||||
val taskTreePlugin = "1.5"
|
val taskTreePlugin = "1.5"
|
||||||
val kotlinBigNumVersion = "0.2.8"
|
val kotlinBigNumVersion = "0.2.8"
|
||||||
val jna = "5.7.0"
|
val jna = "5.10.0"
|
||||||
val kotlinPoet = "1.6.0"
|
val kotlinPoet = "1.6.0"
|
||||||
val sampleLibsodiumBindings = "0.8.5-SNAPSHOT"
|
val sampleLibsodiumBindings = "0.8.5-SNAPSHOT"
|
||||||
val ktor = "1.3.2"
|
val ktor = "1.3.2"
|
||||||
val timber = "4.7.1"
|
val timber = "4.7.1"
|
||||||
val kodeinVersion = "7.1.0"
|
val kodeinVersion = "7.1.0"
|
||||||
|
val resourceLoader = "2.0.2"
|
||||||
val resourceLoader = "2.0.1"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ actual object Signature {
|
|||||||
*/
|
*/
|
||||||
actual fun ed25519PkToCurve25519(ed25519PublicKey: UByteArray) : UByteArray {
|
actual fun ed25519PkToCurve25519(ed25519PublicKey: UByteArray) : UByteArray {
|
||||||
val x25519PublicKey = UByteArray(crypto_scalarmult_curve25519_BYTES)
|
val x25519PublicKey = UByteArray(crypto_scalarmult_curve25519_BYTES)
|
||||||
sodiumJna.crypto_sign_ed25519_sk_to_curve25519(
|
sodiumJna.crypto_sign_ed25519_pk_to_curve25519(
|
||||||
x25519PublicKey.asByteArray(),
|
x25519PublicKey.asByteArray(),
|
||||||
ed25519PublicKey.asByteArray()
|
ed25519PublicKey.asByteArray()
|
||||||
)
|
)
|
||||||
|
@ -207,7 +207,7 @@ actual object Signature {
|
|||||||
val x25519PublicKey = UByteArray(crypto_scalarmult_curve25519_BYTES)
|
val x25519PublicKey = UByteArray(crypto_scalarmult_curve25519_BYTES)
|
||||||
val x25519PublicKeyPinned = x25519PublicKey.pin()
|
val x25519PublicKeyPinned = x25519PublicKey.pin()
|
||||||
val ed25519PublicKeyPinned = ed25519PublicKey.pin()
|
val ed25519PublicKeyPinned = ed25519PublicKey.pin()
|
||||||
crypto_sign_ed25519_sk_to_curve25519(
|
crypto_sign_ed25519_pk_to_curve25519(
|
||||||
x25519PublicKeyPinned.toPtr(),
|
x25519PublicKeyPinned.toPtr(),
|
||||||
ed25519PublicKeyPinned.toPtr()
|
ed25519PublicKeyPinned.toPtr()
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user