diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached.json new file mode 100644 index 00000000..0eb65806 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached.json @@ -0,0 +1,45 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_detached", + "type": "function", + "inputs": [ + { + "name": "message", + "type": "unsized_buf" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "publicKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_publickeybytes()" + }, + { + "name": "privateKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_secretkeybytes()" + } + ], + "outputs": [ + { + "name": "ciphertext", + "type": "buf", + "length": "message_length" + }, + { + "name": "mac", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_detached(ciphertext_address, mac_address, message_address, message_length, 0, nonce_address, publicKey_address, privateKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "invalid usage" + } + ], + "return": "_format_output({ciphertext: ciphertext, mac: mac}, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached_afternm.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached_afternm.json new file mode 100644 index 00000000..48062c71 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached_afternm.json @@ -0,0 +1,40 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_detached_afternm", + "type": "function", + "inputs": [ + { + "name": "message", + "type": "unsized_buf" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "sharedKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_beforenmbytes()" + } + ], + "outputs": [ + { + "name": "ciphertext", + "type": "buf", + "length": "message_length" + }, + { + "name": "mac", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_detached_afternm(ciphertext_address, mac_address, message_address, message_length, 0, nonce_address, sharedKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "invalid usage" + } + ], + "return": "_format_output({ciphertext: ciphertext, mac: mac}, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy.json new file mode 100644 index 00000000..f8dcf474 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy.json @@ -0,0 +1,40 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_easy", + "type": "function", + "inputs": [ + { + "name": "message", + "type": "unsized_buf" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "publicKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_publickeybytes()" + }, + { + "name": "privateKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_secretkeybytes()" + } + ], + "outputs": [ + { + "name": "ciphertext", + "type": "buf", + "length": "message_length + libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_easy(ciphertext_address, message_address, message_length, 0, nonce_address, publicKey_address, privateKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "invalid usage" + } + ], + "return": "_format_output(ciphertext, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy_afternm.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy_afternm.json new file mode 100644 index 00000000..29e53794 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy_afternm.json @@ -0,0 +1,35 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_easy_afternm", + "type": "function", + "inputs": [ + { + "name": "message", + "type": "unsized_buf" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "sharedKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_beforenmbytes()" + } + ], + "outputs": [ + { + "name": "ciphertext", + "type": "buf", + "length": "message_length + libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_easy_afternm(ciphertext_address, message_address, message_length, 0, nonce_address, sharedKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "invalid usage" + } + ], + "return": "_format_output(ciphertext, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached.json new file mode 100644 index 00000000..29e7a6c0 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached.json @@ -0,0 +1,45 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_open_detached", + "type": "function", + "inputs": [ + { + "name": "ciphertext", + "type": "unsized_buf" + }, + { + "name": "mac", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "publicKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_publickeybytes()" + }, + { + "name": "privateKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_secretkeybytes()" + } + ], + "outputs": [ + { + "name": "plaintext", + "type": "buf", + "length": "ciphertext_length" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_open_detached(plaintext_address, ciphertext_address, mac_address, ciphertext_length, 0, nonce_address, publicKey_address, privateKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "incorrect key pair for the given ciphertext" + } + ], + "return": "_format_output(plaintext, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached_afternm.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached_afternm.json new file mode 100644 index 00000000..85f78d80 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached_afternm.json @@ -0,0 +1,40 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_open_detached_afternm", + "type": "function", + "inputs": [ + { + "name": "ciphertext", + "type": "unsized_buf" + }, + { + "name": "mac", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "sharedKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_beforenmbytes()" + } + ], + "outputs": [ + { + "name": "plaintext", + "type": "buf", + "length": "ciphertext_length" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_open_detached_afternm(plaintext_address, ciphertext_address, mac_address, ciphertext_length, 0, nonce_address, sharedKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "incorrect secret key for the given ciphertext" + } + ], + "return": "_format_output(plaintext, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy.json new file mode 100644 index 00000000..24f9f4e4 --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy.json @@ -0,0 +1,41 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_open_easy", + "type": "function", + "inputs": [ + { + "name": "ciphertext", + "type": "minsized_buf", + "min_length": "libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "publicKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_publickeybytes()" + }, + { + "name": "privateKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_secretkeybytes()" + } + ], + "outputs": [ + { + "name": "plaintext", + "type": "buf", + "length": "ciphertext_length - libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_open_easy(plaintext_address, ciphertext_address, ciphertext_length, 0, nonce_address, publicKey_address, privateKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "incorrect key pair for the given ciphertext" + } + ], + "return": "_format_output(plaintext, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy_afternm.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy_afternm.json new file mode 100644 index 00000000..aec5ae9d --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy_afternm.json @@ -0,0 +1,36 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_open_easy_afternm", + "type": "function", + "inputs": [ + { + "name": "ciphertext", + "type": "unsized_buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + }, + { + "name": "nonce", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_noncebytes()" + }, + { + "name": "sharedKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_beforenmbytes()" + } + ], + "outputs": [ + { + "name": "plaintext", + "type": "buf", + "length": "ciphertext_length - libsodium._crypto_box_curve25519xchacha20poly1305_macbytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_open_easy_afternm(plaintext_address, ciphertext_address, ciphertext_length, 0, nonce_address, sharedKey_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "incorrect secret key for the given ciphertext" + } + ], + "return": "_format_output(plaintext, outputFormat)" +} diff --git a/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_seed_keypair.json b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_seed_keypair.json new file mode 100644 index 00000000..736e5dbb --- /dev/null +++ b/wrapper/symbols/crypto_box_curve25519xchacha20poly1305_seed_keypair.json @@ -0,0 +1,31 @@ +{ + "name": "crypto_box_curve25519xchacha20poly1305_seed_keypair", + "type": "function", + "inputs": [ + { + "name": "seed", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_seedbytes()" + } + ], + "outputs": [ + { + "name": "publicKey", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_publickeybytes()", + "type": "buf" + }, + { + "name": "privateKey", + "type": "buf", + "length": "libsodium._crypto_box_curve25519xchacha20poly1305_secretkeybytes()" + } + ], + "target": "libsodium._crypto_box_curve25519xchacha20poly1305_seed_keypair(publicKey_address, privateKey_address, seed_address) | 0", + "assert_retval": [ + { + "condition": "=== 0", + "or_else_throw": "invalid usage" + } + ], + "return": "{publicKey: _format_output(publicKey, outputFormat), privateKey: _format_output(privateKey, outputFormat), keyType: 'x25519'}" +}