Pivot to a handled API, update common js and native generators
This commit is contained in:
1 parent
d8b92a6970
commit
1f0eaf59ca
12 files changed
+419
-258
No files matched your search
@@ -15,7 +15,7 @@ actual typealias Sha512State = Hash.State512
|
||||
actual typealias GenericHashState = ByteArray
|
||||
|
||||
actual class Crypto {
|
||||
actual fun crypto_hash_sha256_init(state: Sha256State): Int {
|
||||
actual fun crypto_hash_sha256_init(state: Sha256State): Sha256State {
|
||||
println("Debug")
|
||||
return sodium.crypto_hash_sha256_init(state)
|
||||
}
|
||||
@@ -25,12 +25,12 @@ actual class Crypto {
|
||||
sodium.crypto_hash_sha256_update(state, input.asByteArray(), input.size.toLong())
|
||||
}
|
||||
|
||||
actual fun crypto_hash_sha256_final(state: Sha256State, out: UByteArray) {
|
||||
actual fun crypto_hash_sha256_final(state: Sha256State, out: UByteArray): UByteArray {
|
||||
println("Debug")
|
||||
sodium.crypto_hash_sha256_final(state, out.asByteArray())
|
||||
return sodium.crypto_hash_sha256_final(state, out.asByteArray())
|
||||
}
|
||||
|
||||
actual fun crypto_hash_sha512_init(state: Sha512State): Int {
|
||||
actual fun crypto_hash_sha512_init(state: Sha512State): Sha512State {
|
||||
println("Debug")
|
||||
return sodium.crypto_hash_sha512_init(state)
|
||||
}
|
||||
@@ -40,16 +40,16 @@ actual class Crypto {
|
||||
sodium.crypto_hash_sha512_update(state, input.asByteArray(), input.size.toLong())
|
||||
}
|
||||
|
||||
actual fun crypto_hash_sha512_final(state: Sha512State, out: UByteArray) {
|
||||
actual fun crypto_hash_sha512_final(state: Sha512State, out: UByteArray): UByteArray {
|
||||
println("Debug")
|
||||
sodium.crypto_hash_sha512_final(state, out.asByteArray())
|
||||
return sodium.crypto_hash_sha512_final(state, out.asByteArray())
|
||||
}
|
||||
|
||||
actual fun crypto_generichash_init(
|
||||
state: GenericHashState,
|
||||
key: UByteArray,
|
||||
outlen: Int
|
||||
): Int {
|
||||
): GenericHashState {
|
||||
println("Debug")
|
||||
return sodium.crypto_generichash_init(state, key.asByteArray(), key.size, outlen)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user