Package org.drasyl.crypto.sodium
Class Sodium
java.lang.Object
org.drasyl.crypto.sodium.Sodium
- Direct Known Subclasses:
- DrasylSodium
This class presents a restricted view to the native sodium library. Only the required functions
 for drasyl are considered.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintcrypto_aead_xchacha20poly1305_ietf_decrypt(byte[] m, long[] mLen, byte[] nSec, byte[] c, long cLen, byte[] ad, long adLen, byte[] nPub, byte[] k) intcrypto_aead_xchacha20poly1305_ietf_encrypt(byte[] c, long[] cLen, byte[] m, long mLen, byte[] ad, long adLen, byte[] nSec, byte[] nPub, byte[] k) intcrypto_hash_sha256(byte[] out, byte[] in, long inLen) intcrypto_kx_client_session_keys(byte[] rx, byte[] tx, byte[] clientPk, byte[] clientSk, byte[] serverPk) intcrypto_kx_keypair(byte[] publicKey, byte[] secretKey) intcrypto_kx_server_session_keys(byte[] rx, byte[] tx, byte[] serverPk, byte[] serverSk, byte[] clientPk) intcrypto_sign_detached(byte[] signature, com.sun.jna.Pointer sigLength, byte[] message, long messageLen, byte[] secretKey) intcrypto_sign_ed25519_pk_to_curve25519(byte[] curve25519PublicKey, byte[] ed25519PublicKey) intcrypto_sign_ed25519_sk_to_curve25519(byte[] curve25519SecretKey, byte[] ed25519SecretKey) intcrypto_sign_keypair(byte[] publicKey, byte[] secretKey) intcrypto_sign_verify_detached(byte[] signature, byte[] message, long messageLen, byte[] publicKey) protected voidregister()int
- 
Constructor Details- 
Sodiumprotected Sodium()
 
- 
- 
Method Details- 
registerprotected void register()
- 
sodium_initpublic int sodium_init()
- 
crypto_hash_sha256public int crypto_hash_sha256(byte[] out, byte[] in, long inLen) 
- 
crypto_sign_keypairpublic int crypto_sign_keypair(byte[] publicKey, byte[] secretKey) 
- 
crypto_sign_ed25519_pk_to_curve25519public int crypto_sign_ed25519_pk_to_curve25519(byte[] curve25519PublicKey, byte[] ed25519PublicKey) 
- 
crypto_sign_ed25519_sk_to_curve25519public int crypto_sign_ed25519_sk_to_curve25519(byte[] curve25519SecretKey, byte[] ed25519SecretKey) 
- 
crypto_sign_detachedpublic int crypto_sign_detached(byte[] signature, com.sun.jna.Pointer sigLength, byte[] message, long messageLen, byte[] secretKey) 
- 
crypto_sign_verify_detachedpublic int crypto_sign_verify_detached(byte[] signature, byte[] message, long messageLen, byte[] publicKey) 
- 
crypto_kx_keypairpublic int crypto_kx_keypair(byte[] publicKey, byte[] secretKey) 
- 
crypto_kx_client_session_keyspublic int crypto_kx_client_session_keys(byte[] rx, byte[] tx, byte[] clientPk, byte[] clientSk, byte[] serverPk) 
- 
crypto_kx_server_session_keyspublic int crypto_kx_server_session_keys(byte[] rx, byte[] tx, byte[] serverPk, byte[] serverSk, byte[] clientPk) 
- 
crypto_aead_xchacha20poly1305_ietf_encryptpublic 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_decryptpublic int crypto_aead_xchacha20poly1305_ietf_decrypt(byte[] m, long[] mLen, byte[] nSec, byte[] c, long cLen, byte[] ad, long adLen, byte[] nPub, byte[] k) 
 
-