-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #317 from danielecaggiari/crypto_box_curve25519xch…
…acha20poly1305 Add missing crypto_box_curve25519xchacha20poly1305_* functions
- Loading branch information
Showing
9 changed files
with
353 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
40 changes: 40 additions & 0 deletions
40
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_detached_afternm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
40 changes: 40 additions & 0 deletions
40
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
35 changes: 35 additions & 0 deletions
35
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_easy_afternm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
45 changes: 45 additions & 0 deletions
45
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
40 changes: 40 additions & 0 deletions
40
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_detached_afternm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
41 changes: 41 additions & 0 deletions
41
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
36 changes: 36 additions & 0 deletions
36
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_open_easy_afternm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
} |
31 changes: 31 additions & 0 deletions
31
wrapper/symbols/crypto_box_curve25519xchacha20poly1305_seed_keypair.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'}" | ||
} |