Class Sodium

java.lang.Object
org.drasyl.crypto.sodium.Sodium
Direct Known Subclasses:
DrasylSodium

@UnstableApi public class Sodium extends Object
This class presents a restricted view to the native sodium library. Only the required functions for drasyl are considered.
  • Constructor Details

    • Sodium

      protected Sodium()
  • Method Details

    • register

      protected void register()
    • sodium_init

      public int sodium_init()
    • crypto_hash_sha256

      public int crypto_hash_sha256(byte[] out, byte[] in, long inLen)
    • crypto_sign_keypair

      public int crypto_sign_keypair(byte[] publicKey, byte[] secretKey)
    • crypto_sign_ed25519_pk_to_curve25519

      public int crypto_sign_ed25519_pk_to_curve25519(byte[] curve25519PublicKey, byte[] ed25519PublicKey)
    • crypto_sign_ed25519_sk_to_curve25519

      public int crypto_sign_ed25519_sk_to_curve25519(byte[] curve25519SecretKey, byte[] ed25519SecretKey)
    • crypto_sign_detached

      public int crypto_sign_detached(byte[] signature, com.sun.jna.Pointer sigLength, byte[] message, long messageLen, byte[] secretKey)
    • crypto_sign_verify_detached

      public int crypto_sign_verify_detached(byte[] signature, byte[] message, long messageLen, byte[] publicKey)
    • crypto_kx_keypair

      public int crypto_kx_keypair(byte[] publicKey, byte[] secretKey)
    • crypto_kx_client_session_keys

      public int crypto_kx_client_session_keys(byte[] rx, byte[] tx, byte[] clientPk, byte[] clientSk, byte[] serverPk)
    • crypto_kx_server_session_keys

      public int crypto_kx_server_session_keys(byte[] rx, byte[] tx, byte[] serverPk, byte[] serverSk, byte[] clientPk)
    • crypto_aead_xchacha20poly1305_ietf_encrypt

      public int crypto_aead_xchacha20poly1305_ietf_encrypt(byte[] c, long[] cLen, byte[] m, long mLen, byte[] ad, long adLen, byte[] nSec, byte[] nPub, byte[] k)
    • crypto_aead_xchacha20poly1305_ietf_decrypt

      public int crypto_aead_xchacha20poly1305_ietf_decrypt(byte[] m, long[] mLen, byte[] nSec, byte[] c, long cLen, byte[] ad, long adLen, byte[] nPub, byte[] k)