Remove logging from loader, stream exception

This commit is contained in:
Ugljesa Jovanovic 2022-03-25 15:56:36 +01:00
parent cdb6ecb8f9
commit 7625a2d103
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
3 changed files with 2 additions and 4 deletions

View File

@ -22,7 +22,7 @@ class SmokeTest {
val hashResult = GenericHash.genericHash("Hello".encodeToUByteArray(), 64) val hashResult = GenericHash.genericHash("Hello".encodeToUByteArray(), 64)
println("Smoke test: ${hashResult.toHexString()}") println("Smoke test: ${hashResult.toHexString()}")
assertTrue { assertTrue {
"EF15EAF92D5E335345A3E1D977BC7D8797C3D275717CC1B10AF79C93CDA01AEB2A0C59BC02E2BDF9380FD1B54EB9E1669026930CCC24BD49748E65F9A6B2EE68".toLowerCase() == hashResult.toHexString() "EF15EAF92D5E335345A3E1D977BC7D8797C3D275717CC1B10AF79C93CDA01AEB2A0C59BC02E2BDF9380FD1B54EB9E1669026930CCC24BD49748E65F9A6B2EE68".lowercase() == hashResult.toHexString().lowercase()
} }

View File

@ -22,7 +22,6 @@ object JsSodiumLoader {
} }
suspend fun load() = suspendCoroutine<Unit> { continuation -> suspend fun load() = suspendCoroutine<Unit> { continuation ->
console.log(getSodiumLoaded())
if (!getSodiumLoaded()) { if (!getSodiumLoaded()) {
_libsodiumPromise.then<dynamic> { _libsodiumPromise.then<dynamic> {
sodium_init() sodium_init()
@ -37,7 +36,6 @@ object JsSodiumLoader {
} }
fun loadWithCallback(doneCallback: () -> (Unit)) { fun loadWithCallback(doneCallback: () -> (Unit)) {
console.log(getSodiumLoaded())
if (!getSodiumLoaded()) { if (!getSodiumLoaded()) {
_libsodiumPromise.then<dynamic> { _libsodiumPromise.then<dynamic> {
sodium_init() sodium_init()

View File

@ -35,7 +35,7 @@ actual object Stream {
val result = getSodium().crypto_stream_chacha20_ietf_xor_ic( val result = getSodium().crypto_stream_chacha20_ietf_xor_ic(
message.toUInt8Array(), message.toUInt8Array(),
nonce.toUInt8Array(), nonce.toUInt8Array(),
initialCounter.toUInt(), initialCounter,
key.toUInt8Array() key.toUInt8Array()
) )