Skip to content

cleanup: replace old nacl functions with libsodium replacements #3030

Description

@Green-Sky

Follow up to #2497 , we still use functions libsodium only includes for NaCl api-compatibilty.

eg. crypto_box

https://doc.libsodium.org/doc/public-key_cryptography/authenticated_encryption#notes

Notes
The original NaCl crypto_box API is also supported, albeit not recommended.
crypto_box() takes a pointer to 32 bytes before the message and stores the ciphertext 16 bytes after the destination pointer, with the first 16 bytes being overwritten with zeros. crypto_box_open() takes a pointer to 16 bytes before the ciphertext and stores the message 32 bytes after the destination pointer, overwriting the first 32 bytes with zeros.
The _easy and _detached APIs are faster and improve usability by not requiring padding, copying, or tricky pointer arithmetic.

Might be more.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions