Remove unintentional formatting changes and add .editorconfig

This commit is contained in:
Johannes Leupold committed 2024-08-14 23:06:41 +02:00
1 parent 989d671c41
commit 2887ae2535
12 files changed
+2329 -2321

No files matched your search

@@ -5,102 +5,102 @@ import ext.libsodium.com.ionspin.kotlin.crypto.toUByteArray
import ext.libsodium.com.ionspin.kotlin.crypto.toUInt8Array
actual abstract class Ed25519LowLevel actual constructor() {
actual fun isValidPoint(encoded: UByteArray): Boolean =
getSodium().crypto_core_ed25519_is_valid_point(encoded.toUInt8Array())
actual fun isValidPoint(encoded: UByteArray): Boolean =
getSodium().crypto_core_ed25519_is_valid_point(encoded.toUInt8Array())
actual fun addPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_add(p.toUInt8Array(), q.toUInt8Array())
actual fun addPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_add(p.toUInt8Array(), q.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun subtractPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_sub(p.toUInt8Array(), q.toUInt8Array())
actual fun subtractPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_sub(p.toUInt8Array(), q.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun encodedPointFromUniform(uniform: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_from_uniform(uniform.toUInt8Array())
actual fun encodedPointFromUniform(uniform: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_from_uniform(uniform.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun randomEncodedPoint(): UByteArray {
val result = getSodium().crypto_core_ed25519_random()
actual fun randomEncodedPoint(): UByteArray {
val result = getSodium().crypto_core_ed25519_random()
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun randomEncodedScalar(): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_random()
actual fun randomEncodedScalar(): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_random()
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun invertScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_invert(scalar.toUInt8Array())
actual fun invertScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_invert(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun negateScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_negate(scalar.toUInt8Array())
actual fun negateScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_negate(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun complementScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_complement(scalar.toUInt8Array())
actual fun complementScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_complement(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun addScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_add(x.toUInt8Array(), y.toUInt8Array())
actual fun addScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_add(x.toUInt8Array(), y.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun subtractScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_sub(x.toUInt8Array(), y.toUInt8Array())
actual fun subtractScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_sub(x.toUInt8Array(), y.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun multiplyScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_mul(x.toUInt8Array(), y.toUInt8Array())
actual fun multiplyScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_mul(x.toUInt8Array(), y.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun reduceScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_reduce(scalar.toUInt8Array())
actual fun reduceScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ed25519_scalar_reduce(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun scalarMultiplication(n: UByteArray, p: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519(n.toUInt8Array(), p.toUInt8Array())
actual fun scalarMultiplication(n: UByteArray, p: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519(n.toUInt8Array(), p.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun scalarMultiplicationNoClamp(n: UByteArray, p: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519_noclamp(n.toUInt8Array(), p.toUInt8Array())
actual fun scalarMultiplicationNoClamp(n: UByteArray, p: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519_noclamp(n.toUInt8Array(), p.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun scalarMultiplicationBase(n: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519_base(n.toUInt8Array())
actual fun scalarMultiplicationBase(n: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519_base(n.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun scalarMultiplicationBaseNoClamp(n: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519_base_noclamp(n.toUInt8Array())
actual fun scalarMultiplicationBaseNoClamp(n: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ed25519_base_noclamp(n.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
}
@@ -5,90 +5,90 @@ import ext.libsodium.com.ionspin.kotlin.crypto.toUByteArray
import ext.libsodium.com.ionspin.kotlin.crypto.toUInt8Array
actual abstract class Ristretto255LowLevel actual constructor() {
actual fun isValidPoint(encoded: UByteArray): Boolean =
getSodium().crypto_core_ristretto255_is_valid_point(encoded.toUInt8Array())
actual fun isValidPoint(encoded: UByteArray): Boolean =
getSodium().crypto_core_ristretto255_is_valid_point(encoded.toUInt8Array())
actual fun addPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_add(p.toUInt8Array(), q.toUInt8Array())
actual fun addPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_add(p.toUInt8Array(), q.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun subtractPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_sub(p.toUInt8Array(), q.toUInt8Array())
actual fun subtractPoints(p: UByteArray, q: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_sub(p.toUInt8Array(), q.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun encodedPointFromHash(hash: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_from_hash(hash.toUInt8Array())
actual fun encodedPointFromHash(hash: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_from_hash(hash.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun randomEncodedPoint(): UByteArray {
val result = getSodium().crypto_core_ristretto255_random()
actual fun randomEncodedPoint(): UByteArray {
val result = getSodium().crypto_core_ristretto255_random()
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun randomEncodedScalar(): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_random()
actual fun randomEncodedScalar(): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_random()
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun invertScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_invert(scalar.toUInt8Array())
actual fun invertScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_invert(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun negateScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_negate(scalar.toUInt8Array())
actual fun negateScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_negate(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun complementScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_complement(scalar.toUInt8Array())
actual fun complementScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_complement(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun addScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_add(x.toUInt8Array(), y.toUInt8Array())
actual fun addScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_add(x.toUInt8Array(), y.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun subtractScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_sub(x.toUInt8Array(), y.toUInt8Array())
actual fun subtractScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_sub(x.toUInt8Array(), y.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun multiplyScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_mul(x.toUInt8Array(), y.toUInt8Array())
actual fun multiplyScalars(x: UByteArray, y: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_mul(x.toUInt8Array(), y.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun reduceScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_reduce(scalar.toUInt8Array())
actual fun reduceScalar(scalar: UByteArray): UByteArray {
val result = getSodium().crypto_core_ristretto255_scalar_reduce(scalar.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun scalarMultiplication(n: UByteArray, p: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ristretto255(n.toUInt8Array(), p.toUInt8Array())
actual fun scalarMultiplication(n: UByteArray, p: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ristretto255(n.toUInt8Array(), p.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
actual fun scalarMultiplicationBase(n: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ristretto255_base(n.toUInt8Array())
actual fun scalarMultiplicationBase(n: UByteArray): UByteArray {
val result = getSodium().crypto_scalarmult_ristretto255_base(n.toUInt8Array())
return result.toUByteArray()
}
return result.toUByteArray()
}
}