Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nonce-accepting overload of
secretBox.seal
As good as the current API is at some times it is necessary to have reproducible results of the encryption for several reasons: * It is already supported by `.box.seal()` * It is necessary for distributed systems where remote peers must agree on the hash of encrypted content upon re-encryption. This commit introduces: ``` sodium.secureBox.seal(message: [...], secretKey: [...], nonce: [...]) ``` That takes the usual `message` and `secretKey`, and an additional user-provided `nonce` to generate the result that is completely defined by those inputs and does not rely on any entropy.
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
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
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
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