feat: trying to get tests and sodium object working with new changes

This commit is contained in:
0x330a 2022-12-07 09:06:08 +11:00
parent b2a3e3e7d5
commit 36b091c640
3 changed files with 10 additions and 3 deletions

@ -1 +1 @@
Subproject commit fa7e0d0acf9c343f0d7f0a23e5852077c2cf288f
Subproject commit 57f6bbd91bb4b1f2d115b75e8beb850153bb6767

View File

@ -3,6 +3,7 @@ package network.loki.messenger.libsession_util
import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import network.loki.messenger.libsession_util.util.KeyPair
import network.loki.messenger.libsession_util.util.Sodium
import network.loki.messenger.libsession_util.util.UserPic
import org.junit.Assert.*
@ -18,8 +19,11 @@ import org.session.libsignal.utilities.Hex
@RunWith(AndroidJUnit4::class)
class InstrumentedTests {
val seed = Hex.fromStringCondensed("0123456789abcdef0123456789abcdef00000000000000000000000000000000")
val keyPair = Sodium.ed25519KeyPair(seed)
private val keyPair: KeyPair
get() {
val seed = Hex.fromStringCondensed("0123456789abcdef0123456789abcdef00000000000000000000000000000000")
return Sodium.ed25519KeyPair(seed)
}
@Test
fun useAppContext() {

View File

@ -1,5 +1,8 @@
package network.loki.messenger.libsession_util.util
object Sodium {
init {
System.loadLibrary("session_util")
}
external fun ed25519KeyPair(seed: ByteArray): KeyPair
}