Remove unintentional formatting changes and add .editorconfig
This commit is contained in:
parent
989d671c41
commit
2887ae2535
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# EditorConfig is awesome: https://editorconfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*.{kt,kts}]
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
max_line_length = 120
|
@ -158,7 +158,8 @@ object Ristretto255 : Ristretto255LowLevel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hex.length > 2 * crypto_core_ristretto255_SCALARBYTES) {
|
if (hex.length > 2 * crypto_core_ristretto255_SCALARBYTES) {
|
||||||
val encoded = LibsodiumUtil.fromHex(hex.padEnd(2 * crypto_core_ristretto255_NONREDUCEDSCALARBYTES, '0'))
|
val encoded =
|
||||||
|
LibsodiumUtil.fromHex(hex.padEnd(2 * crypto_core_ristretto255_NONREDUCEDSCALARBYTES, '0'))
|
||||||
// Scalars are encoded in little-endian order, so the end can be padded with zeroes up to the size of a
|
// Scalars are encoded in little-endian order, so the end can be padded with zeroes up to the size of a
|
||||||
// non-reduced scalar. After decoding, it is reduced, to obtain a scalar in the canonical range
|
// non-reduced scalar. After decoding, it is reduced, to obtain a scalar in the canonical range
|
||||||
return Scalar(reduceScalar(encoded))
|
return Scalar(reduceScalar(encoded))
|
||||||
|
@ -91,7 +91,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun randombytes_buf_deterministic(
|
fun randombytes_buf_deterministic(
|
||||||
buffer: ByteArray,
|
buffer: ByteArray,
|
||||||
size: Int,
|
size: Int,
|
||||||
seed: ByteArray,
|
seed: ByteArray
|
||||||
)
|
)
|
||||||
|
|
||||||
// uint32_t randombytes_random(void)
|
// uint32_t randombytes_random(void)
|
||||||
@ -99,7 +99,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
|
|
||||||
// uint32_t randombytes_uniform(const uint32_t upper_bound);
|
// uint32_t randombytes_uniform(const uint32_t upper_bound);
|
||||||
fun randombytes_uniform(
|
fun randombytes_uniform(
|
||||||
upperBound: Long,
|
upperBound: Long
|
||||||
) : Long
|
) : Long
|
||||||
|
|
||||||
// void sodium_memzero(void * const pnt, const size_t len);
|
// void sodium_memzero(void * const pnt, const size_t len);
|
||||||
@ -114,7 +114,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
hex: ByteArray,
|
hex: ByteArray,
|
||||||
hexMaxlen: Int,
|
hexMaxlen: Int,
|
||||||
bin: ByteArray,
|
bin: ByteArray,
|
||||||
binLen: Int,
|
binLen: Int
|
||||||
): String
|
): String
|
||||||
|
|
||||||
// int sodium_hex2bin(
|
// int sodium_hex2bin(
|
||||||
@ -129,7 +129,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
hexLen: Int,
|
hexLen: Int,
|
||||||
ignore: ByteArray?,
|
ignore: ByteArray?,
|
||||||
binLen: Pointer,
|
binLen: Pointer,
|
||||||
hexEnd: Pointer?,
|
hexEnd: Pointer?
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int sodium_pad(size_t *padded_buflen_p, unsigned char *buf,
|
// int sodium_pad(size_t *padded_buflen_p, unsigned char *buf,
|
||||||
@ -139,7 +139,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
buffer: ByteArray,
|
buffer: ByteArray,
|
||||||
unpaddedBufferLength: Int,
|
unpaddedBufferLength: Int,
|
||||||
blockSize: Int,
|
blockSize: Int,
|
||||||
maxBufferLength: Int,
|
maxBufferLength: Int
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf,
|
// int sodium_unpad(size_t *unpadded_buflen_p, const unsigned char *buf,
|
||||||
@ -148,7 +148,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
unpaddedBufferLength: Pointer,
|
unpaddedBufferLength: Pointer,
|
||||||
buffer: ByteArray,
|
buffer: ByteArray,
|
||||||
paddedBufferLength: Int,
|
paddedBufferLength: Int,
|
||||||
blockSize: Int,
|
blockSize: Int
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
base64MaxLength: Int,
|
base64MaxLength: Int,
|
||||||
bin: ByteArray,
|
bin: ByteArray,
|
||||||
binLength: Int,
|
binLength: Int,
|
||||||
variant: Int,
|
variant: Int
|
||||||
)
|
)
|
||||||
|
|
||||||
// int sodium_base642bin(
|
// int sodium_base642bin(
|
||||||
@ -176,7 +176,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ignore: ByteArray?,
|
ignore: ByteArray?,
|
||||||
binLength: Pointer,
|
binLength: Pointer,
|
||||||
base64End: Pointer?,
|
base64End: Pointer?,
|
||||||
variant: Int,
|
variant: Int
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// size_t sodium_base64_encoded_len(const size_t bin_len, const int variant)
|
// size_t sodium_base64_encoded_len(const size_t bin_len, const int variant)
|
||||||
@ -193,7 +193,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray,
|
||||||
keylen: Int,
|
keylen: Int
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_hash_sha256(unsigned char *out, const unsigned char *in,
|
// int crypto_hash_sha256(unsigned char *out, const unsigned char *in,
|
||||||
@ -243,7 +243,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray,
|
||||||
keylen: Int,
|
keylen: Int
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state,
|
// int crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state,
|
||||||
@ -334,7 +334,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
nsec: ByteArray?,
|
nsec: ByteArray?,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_xchacha20poly1305_ietf_decrypt(
|
// int crypto_aead_xchacha20poly1305_ietf_decrypt(
|
||||||
@ -356,7 +356,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(
|
// int crypto_aead_xchacha20poly1305_ietf_encrypt_detached(
|
||||||
@ -380,7 +380,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
nsec: ByteArray?,
|
nsec: ByteArray?,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(
|
// int crypto_aead_xchacha20poly1305_ietf_decrypt_detached(
|
||||||
@ -402,7 +402,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
|
// void crypto_aead_xchacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
|
||||||
@ -432,7 +432,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
nsec: ByteArray?,
|
nsec: ByteArray?,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_aead_chacha20poly1305_ietf_decrypt(
|
// int crypto_aead_chacha20poly1305_ietf_decrypt(
|
||||||
@ -454,7 +454,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_chacha20poly1305_ietf_encrypt_detached(
|
// int crypto_aead_chacha20poly1305_ietf_encrypt_detached(
|
||||||
@ -478,7 +478,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
nsec: ByteArray?,
|
nsec: ByteArray?,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_chacha20poly1305_ietf_decrypt_detached(
|
// int crypto_aead_chacha20poly1305_ietf_decrypt_detached(
|
||||||
@ -500,7 +500,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// void crypto_aead_chacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
|
// void crypto_aead_chacha20poly1305_ietf_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
|
||||||
@ -532,7 +532,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
nsec: ByteArray?,
|
nsec: ByteArray?,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_xchacha20poly1305_decrypt(unsigned char *m,
|
// int crypto_aead_xchacha20poly1305_decrypt(unsigned char *m,
|
||||||
@ -553,7 +553,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_chacha20poly1305_encrypt_detached(
|
// int crypto_aead_chacha20poly1305_encrypt_detached(
|
||||||
@ -577,7 +577,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
nsec: ByteArray?,
|
nsec: ByteArray?,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_aead_chacha20poly1305_decrypt_detached(
|
// int crypto_aead_chacha20poly1305_decrypt_detached(
|
||||||
@ -599,7 +599,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
npub: ByteArray,
|
npub: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
|
// void crypto_aead_chacha20poly1305_keygen(unsigned char k[crypto_aead_xchacha20poly1305_ietf_KEYBYTES])
|
||||||
@ -622,7 +622,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_secretstream_xchacha20poly1305_init_push(
|
fun crypto_secretstream_xchacha20poly1305_init_push(
|
||||||
state: SecretStreamXChaCha20Poly1305State,
|
state: SecretStreamXChaCha20Poly1305State,
|
||||||
header: ByteArray,
|
header: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_secretstream_xchacha20poly1305_push
|
// int crypto_secretstream_xchacha20poly1305_push
|
||||||
@ -638,7 +638,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long,
|
||||||
tag: Byte,
|
tag: Byte
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// decrypt
|
// decrypt
|
||||||
@ -650,7 +650,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_secretstream_xchacha20poly1305_init_pull(
|
fun crypto_secretstream_xchacha20poly1305_init_pull(
|
||||||
state: SecretStreamXChaCha20Poly1305State,
|
state: SecretStreamXChaCha20Poly1305State,
|
||||||
header: ByteArray,
|
header: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_secretstream_xchacha20poly1305_pull
|
// int crypto_secretstream_xchacha20poly1305_pull
|
||||||
@ -666,7 +666,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertext: ByteArray,
|
ciphertext: ByteArray,
|
||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
additionalData: ByteArray,
|
additionalData: ByteArray,
|
||||||
additionalDataLength: Long,
|
additionalDataLength: Long
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//keygen and rekey
|
//keygen and rekey
|
||||||
@ -696,7 +696,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_secretbox_easy(
|
// int crypto_secretbox_easy(
|
||||||
@ -708,7 +708,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES])
|
// void crypto_secretbox_keygen(unsigned char k[crypto_secretbox_KEYBYTES])
|
||||||
@ -727,7 +727,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
mac: ByteArray,
|
mac: ByteArray,
|
||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_secretbox_open_easy(
|
// int crypto_secretbox_open_easy(
|
||||||
@ -739,7 +739,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertext: ByteArray,
|
ciphertext: ByteArray,
|
||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// ---- SecretBox End ----
|
// ---- SecretBox End ----
|
||||||
@ -752,7 +752,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
out: ByteArray,
|
out: ByteArray,
|
||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES])
|
// void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES])
|
||||||
@ -764,7 +764,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
hash: ByteArray,
|
hash: ByteArray,
|
||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//Same params as general variant
|
//Same params as general variant
|
||||||
@ -772,7 +772,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
out: ByteArray,
|
out: ByteArray,
|
||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//Same params as general variant
|
//Same params as general variant
|
||||||
@ -783,7 +783,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
hash: ByteArray,
|
hash: ByteArray,
|
||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//Same params as general variant
|
//Same params as general variant
|
||||||
@ -791,7 +791,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
out: ByteArray,
|
out: ByteArray,
|
||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//Same params as general variant
|
//Same params as general variant
|
||||||
@ -802,7 +802,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
hash: ByteArray,
|
hash: ByteArray,
|
||||||
input: ByteArray,
|
input: ByteArray,
|
||||||
inputLength: Long,
|
inputLength: Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -818,7 +818,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_box_seed_keypair(
|
fun crypto_box_seed_keypair(
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray,
|
||||||
seed: ByteArray,
|
seed: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_easy(unsigned char *c, const unsigned char *m,
|
// int crypto_box_easy(unsigned char *c, const unsigned char *m,
|
||||||
@ -830,7 +830,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
recipientPublicKey: ByteArray,
|
recipientPublicKey: ByteArray,
|
||||||
senderSecretKey: ByteArray,
|
senderSecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_open_easy(unsigned char *m, const unsigned char *c,
|
// int crypto_box_open_easy(unsigned char *m, const unsigned char *c,
|
||||||
@ -842,7 +842,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
senderPublickKey: ByteArray,
|
senderPublickKey: ByteArray,
|
||||||
recipientSecretKey: ByteArray,
|
recipientSecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_detached(unsigned char *c, unsigned char *mac,
|
// int crypto_box_detached(unsigned char *c, unsigned char *mac,
|
||||||
@ -856,7 +856,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
recipientPublicKey: ByteArray,
|
recipientPublicKey: ByteArray,
|
||||||
senderSecretKey: ByteArray,
|
senderSecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_open_detached(
|
// int crypto_box_open_detached(
|
||||||
@ -873,7 +873,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
senderPublickKey: ByteArray,
|
senderPublickKey: ByteArray,
|
||||||
recipientSecretKey: ByteArray,
|
recipientSecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
|
// int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
|
||||||
@ -881,7 +881,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_box_beforenm(
|
fun crypto_box_beforenm(
|
||||||
sessionKey: ByteArray,
|
sessionKey: ByteArray,
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m,
|
// int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m,
|
||||||
@ -892,7 +892,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
sessionKey: ByteArray,
|
sessionKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c,
|
// int crypto_box_open_easy_afternm(unsigned char *m, const unsigned char *c,
|
||||||
@ -903,7 +903,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertext: ByteArray,
|
ciphertext: ByteArray,
|
||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
sessionKey: ByteArray,
|
sessionKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_box_seal(unsigned char *c, const unsigned char *m,
|
// int crypto_box_seal(unsigned char *c, const unsigned char *m,
|
||||||
@ -912,7 +912,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertext: ByteArray,
|
ciphertext: ByteArray,
|
||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
recipientPublicKey: ByteArray,
|
recipientPublicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
|
|
||||||
@ -924,7 +924,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
ciphertext: ByteArray,
|
ciphertext: ByteArray,
|
||||||
ciphertextLength: Long,
|
ciphertextLength: Long,
|
||||||
senderPublickKey: ByteArray,
|
senderPublickKey: ByteArray,
|
||||||
recipientSecretKey: ByteArray,
|
recipientSecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
//
|
//
|
||||||
// // ---- Box end ----
|
// // ---- Box end ----
|
||||||
@ -940,7 +940,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
signedMessageLength: LongArray?,
|
signedMessageLength: LongArray?,
|
||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_open(
|
// int crypto_sign_open(
|
||||||
@ -952,7 +952,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: LongArray?,
|
messageLength: LongArray?,
|
||||||
signedMessage: ByteArray,
|
signedMessage: ByteArray,
|
||||||
signedMessageLength: Long,
|
signedMessageLength: Long,
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_detached(
|
// int crypto_sign_detached(
|
||||||
@ -964,7 +964,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
signatureLength: LongArray?,
|
signatureLength: LongArray?,
|
||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_verify_detached(
|
// int crypto_sign_verify_detached(
|
||||||
@ -976,7 +976,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
signature: ByteArray,
|
signature: ByteArray,
|
||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_ed25519_pk_to_curve25519(
|
// int crypto_sign_ed25519_pk_to_curve25519(
|
||||||
@ -984,27 +984,27 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
// const unsigned char *ed25519_pk)
|
// const unsigned char *ed25519_pk)
|
||||||
fun crypto_sign_ed25519_pk_to_curve25519(
|
fun crypto_sign_ed25519_pk_to_curve25519(
|
||||||
curve25519PublicKey: ByteArray,
|
curve25519PublicKey: ByteArray,
|
||||||
ed25519PublicKey: ByteArray,
|
ed25519PublicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk,
|
// int crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk,
|
||||||
// const unsigned char *ed25519_sk)
|
// const unsigned char *ed25519_sk)
|
||||||
fun crypto_sign_ed25519_sk_to_curve25519(
|
fun crypto_sign_ed25519_sk_to_curve25519(
|
||||||
curve25519SecretKey: ByteArray,
|
curve25519SecretKey: ByteArray,
|
||||||
ed25519SecretKey: ByteArray,
|
ed25519SecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk)
|
// int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk)
|
||||||
fun crypto_sign_ed25519_sk_to_pk(
|
fun crypto_sign_ed25519_sk_to_pk(
|
||||||
ed25519PublicKey: ByteArray,
|
ed25519PublicKey: ByteArray,
|
||||||
ed25519SecretKey: ByteArray,
|
ed25519SecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_ed25519_sk_to_seed(unsigned char *seed,
|
// int crypto_sign_ed25519_sk_to_seed(unsigned char *seed,
|
||||||
// const unsigned char *sk)
|
// const unsigned char *sk)
|
||||||
fun crypto_sign_ed25519_sk_to_seed(
|
fun crypto_sign_ed25519_sk_to_seed(
|
||||||
seed: ByteArray,
|
seed: ByteArray,
|
||||||
ed25519SecretKey: ByteArray,
|
ed25519SecretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_init(crypto_sign_state *state);
|
// int crypto_sign_init(crypto_sign_state *state);
|
||||||
@ -1015,7 +1015,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_sign_update(
|
fun crypto_sign_update(
|
||||||
state: Ed25519SignatureState,
|
state: Ed25519SignatureState,
|
||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig,
|
// int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig,
|
||||||
@ -1025,7 +1025,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
state: Ed25519SignatureState,
|
state: Ed25519SignatureState,
|
||||||
signature: ByteArray,
|
signature: ByteArray,
|
||||||
signatureLength: LongArray?,
|
signatureLength: LongArray?,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_final_verify(crypto_sign_state *state, const unsigned char *sig,
|
// int crypto_sign_final_verify(crypto_sign_state *state, const unsigned char *sig,
|
||||||
@ -1033,12 +1033,12 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_sign_final_verify(
|
fun crypto_sign_final_verify(
|
||||||
state: Ed25519SignatureState,
|
state: Ed25519SignatureState,
|
||||||
signature: ByteArray,
|
signature: ByteArray,
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
|
// int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
|
||||||
fun crypto_sign_keypair(
|
fun crypto_sign_keypair(
|
||||||
publicKey: ByteArray, secretKey: ByteArray,
|
publicKey: ByteArray, secretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
|
// int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
|
||||||
@ -1046,7 +1046,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_sign_seed_keypair(
|
fun crypto_sign_seed_keypair(
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray,
|
||||||
seed: ByteArray,
|
seed: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
|
|
||||||
@ -1067,12 +1067,12 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
subkeyLength: Int,
|
subkeyLength: Int,
|
||||||
subkeyId: Long,
|
subkeyId: Long,
|
||||||
context: ByteArray,
|
context: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES])
|
// void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES])
|
||||||
fun crypto_kdf_keygen(
|
fun crypto_kdf_keygen(
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
)
|
)
|
||||||
//
|
//
|
||||||
// // ---- KDF end -----
|
// // ---- KDF end -----
|
||||||
@ -1093,7 +1093,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
salt: ByteArray,
|
salt: ByteArray,
|
||||||
opslimit: Long,
|
opslimit: Long,
|
||||||
memlimit: Long,
|
memlimit: Long,
|
||||||
algorithm: Int,
|
algorithm : Int
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_pwhash_str(char out[crypto_pwhash_STRBYTES],
|
// int crypto_pwhash_str(char out[crypto_pwhash_STRBYTES],
|
||||||
@ -1104,7 +1104,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
password: String,
|
password: String,
|
||||||
passwordLength: Long,
|
passwordLength: Long,
|
||||||
opslimit: Long,
|
opslimit: Long,
|
||||||
memlimit: Long,
|
memlimit: Long
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES],
|
// int crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES],
|
||||||
@ -1112,16 +1112,15 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_pwhash_str_needs_rehash(
|
fun crypto_pwhash_str_needs_rehash(
|
||||||
output: String,
|
output: String,
|
||||||
opslimit: Long,
|
opslimit: Long,
|
||||||
memlimit: Long,
|
memlimit: Long
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES],
|
// int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES],
|
||||||
// const char * const passwd,
|
// const char * const passwd,
|
||||||
// unsigned long long passwdlen)
|
// unsigned long long passwdlen)
|
||||||
fun crypto_pwhash_str_verify(
|
fun crypto_pwhash_str_verify(
|
||||||
hash: String,
|
hash: String,
|
||||||
password: String,
|
password: String,
|
||||||
passwordLength: Long,
|
passwordLength: Long
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1129,6 +1128,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // ---- Key exchange ----
|
// // ---- Key exchange ----
|
||||||
|
|
||||||
|
|
||||||
@ -1136,7 +1136,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
// unsigned char sk[crypto_kx_SECRETKEYBYTES])
|
// unsigned char sk[crypto_kx_SECRETKEYBYTES])
|
||||||
fun crypto_kx_keypair(
|
fun crypto_kx_keypair(
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
|
|
||||||
@ -1146,9 +1146,8 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
fun crypto_kx_seed_keypair(
|
fun crypto_kx_seed_keypair(
|
||||||
publicKey: ByteArray,
|
publicKey: ByteArray,
|
||||||
secretKey: ByteArray,
|
secretKey: ByteArray,
|
||||||
seed: ByteArray,
|
seed: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
|
// int crypto_kx_client_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
|
||||||
// unsigned char tx[crypto_kx_SESSIONKEYBYTES],
|
// unsigned char tx[crypto_kx_SESSIONKEYBYTES],
|
||||||
// const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES],
|
// const unsigned char client_pk[crypto_kx_PUBLICKEYBYTES],
|
||||||
@ -1159,9 +1158,8 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
sendKey: ByteArray,
|
sendKey: ByteArray,
|
||||||
clientPublicKey: ByteArray,
|
clientPublicKey: ByteArray,
|
||||||
clientSecretKey: ByteArray,
|
clientSecretKey: ByteArray,
|
||||||
serverPublicKey: ByteArray,
|
serverPublicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
// int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
|
// int crypto_kx_server_session_keys(unsigned char rx[crypto_kx_SESSIONKEYBYTES],
|
||||||
// unsigned char tx[crypto_kx_SESSIONKEYBYTES],
|
// unsigned char tx[crypto_kx_SESSIONKEYBYTES],
|
||||||
// const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES],
|
// const unsigned char server_pk[crypto_kx_PUBLICKEYBYTES],
|
||||||
@ -1172,7 +1170,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
sendKey: ByteArray,
|
sendKey: ByteArray,
|
||||||
serverPublicKey: ByteArray,
|
serverPublicKey: ByteArray,
|
||||||
serverSecretKey: ByteArray,
|
serverSecretKey: ByteArray,
|
||||||
clientPublicKey: ByteArray,
|
clientPublicKey: ByteArray
|
||||||
): Int
|
): Int
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1186,9 +1184,8 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
stream: ByteArray,
|
stream: ByteArray,
|
||||||
streamLength: Long,
|
streamLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
|
// int crypto_stream_chacha20_xor(unsigned char *c, const unsigned char *m,
|
||||||
// unsigned long long mlen, const unsigned char *n,
|
// unsigned long long mlen, const unsigned char *n,
|
||||||
// const unsigned char *k)
|
// const unsigned char *k)
|
||||||
@ -1197,9 +1194,8 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
// int crypto_stream_chacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
||||||
// unsigned long long mlen,
|
// unsigned long long mlen,
|
||||||
// const unsigned char *n, uint64_t ic,
|
// const unsigned char *n, uint64_t ic,
|
||||||
@ -1210,7 +1206,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
initialCounter : Long,
|
initialCounter : Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_chacha20_ietf(unsigned char *c, unsigned long long clen,
|
// int crypto_stream_chacha20_ietf(unsigned char *c, unsigned long long clen,
|
||||||
@ -1219,7 +1215,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
stream: ByteArray,
|
stream: ByteArray,
|
||||||
streamLength: Long,
|
streamLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_chacha20_ietf_xor(unsigned char *c, const unsigned char *m,
|
// int crypto_stream_chacha20_ietf_xor(unsigned char *c, const unsigned char *m,
|
||||||
@ -1230,7 +1226,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m,
|
// int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m,
|
||||||
@ -1243,7 +1239,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
initialCounter : Int,
|
initialCounter : Int,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// void crypto_stream_chacha20_keygen(unsigned char k[crypto_stream_chacha20_KEYBYTES])
|
// void crypto_stream_chacha20_keygen(unsigned char k[crypto_stream_chacha20_KEYBYTES])
|
||||||
@ -1255,7 +1251,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
stream: ByteArray,
|
stream: ByteArray,
|
||||||
streamLength: Long,
|
streamLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_xchacha20_xor(unsigned char *c, const unsigned char *m,
|
// int crypto_stream_xchacha20_xor(unsigned char *c, const unsigned char *m,
|
||||||
@ -1266,7 +1262,7 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
message: ByteArray,
|
message: ByteArray,
|
||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// int crypto_stream_xchacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
// int crypto_stream_xchacha20_xor_ic(unsigned char *c, const unsigned char *m,
|
||||||
@ -1279,9 +1275,8 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
messageLength: Long,
|
messageLength: Long,
|
||||||
nonce: ByteArray,
|
nonce: ByteArray,
|
||||||
initialCounter : Long,
|
initialCounter : Long,
|
||||||
key: ByteArray,
|
key: ByteArray
|
||||||
) : Int
|
) : Int
|
||||||
|
|
||||||
// void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES])
|
// void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES])
|
||||||
fun crypto_stream_xchacha20_keygen(key: ByteArray)
|
fun crypto_stream_xchacha20_keygen(key: ByteArray)
|
||||||
|
|
||||||
@ -1294,7 +1289,6 @@ interface JnaLibsodiumInterface : Library {
|
|||||||
// int crypto_scalarmult(unsigned char *q, const unsigned char *n,
|
// int crypto_scalarmult(unsigned char *q, const unsigned char *n,
|
||||||
// const unsigned char *p)
|
// const unsigned char *p)
|
||||||
fun crypto_scalarmult(q: ByteArray, n: ByteArray, p: ByteArray): Int
|
fun crypto_scalarmult(q: ByteArray, n: ByteArray, p: ByteArray): Int
|
||||||
|
|
||||||
// int crypto_scalarmult_base(unsigned char *q, const unsigned char *n)
|
// int crypto_scalarmult_base(unsigned char *q, const unsigned char *n)
|
||||||
fun crypto_scalarmult_base(q: ByteArray, b: ByteArray): Int
|
fun crypto_scalarmult_base(q: ByteArray, b: ByteArray): Int
|
||||||
//
|
//
|
||||||
|
@ -44,7 +44,8 @@ actual abstract class Ristretto255LowLevel actual constructor() {
|
|||||||
actual fun invertScalar(scalar: UByteArray): UByteArray {
|
actual fun invertScalar(scalar: UByteArray): UByteArray {
|
||||||
val result = UByteArray(crypto_core_ristretto255_SCALARBYTES)
|
val result = UByteArray(crypto_core_ristretto255_SCALARBYTES)
|
||||||
|
|
||||||
sodiumJna.crypto_core_ristretto255_scalar_invert(result.asByteArray(), scalar.asByteArray()).ensureLibsodiumSuccess()
|
sodiumJna.crypto_core_ristretto255_scalar_invert(result.asByteArray(), scalar.asByteArray())
|
||||||
|
.ensureLibsodiumSuccess()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,10 @@ actual abstract class Ristretto255LowLevel actual constructor() {
|
|||||||
|
|
||||||
result.usePinned { resultPinned ->
|
result.usePinned { resultPinned ->
|
||||||
scalar.usePinned { scalarPinned ->
|
scalar.usePinned { scalarPinned ->
|
||||||
crypto_core_ristretto255_scalar_invert(resultPinned.toPtr(), scalarPinned.toPtr()).ensureLibsodiumSuccess()
|
crypto_core_ristretto255_scalar_invert(
|
||||||
|
resultPinned.toPtr(),
|
||||||
|
scalarPinned.toPtr()
|
||||||
|
).ensureLibsodiumSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user