Class Curve


  • public class Curve
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  Curve.Size  
    • Constructor Summary

      Constructors 
      Constructor Description
      Curve()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int afternm​(byte[] ciphered, byte[] plaintext, int length, byte[] nonce, byte[] precomp)  
      (package private) int afternm​(java.nio.ByteBuffer ciphered, java.nio.ByteBuffer plaintext, int length, java.nio.ByteBuffer nonce, byte[] precom)  
      (package private) int beforenm​(byte[] outSharedKey, byte[] publicKey, byte[] secretKey)  
      int box​(byte[] ciphertext, byte[] plaintext, int length, byte[] nonce, byte[] publicKey, byte[] secretKey)  
      int box​(java.nio.ByteBuffer ciphertext, java.nio.ByteBuffer plaintext, int length, java.nio.ByteBuffer nonce, byte[] publicKey, byte[] secretKey)  
      byte[][] keypair()
      Generates a pair of keys for use with this class.
      java.lang.String[] keypairZ85()
      Generates a pair of Z85-encoded keys for use with this class.
      (package private) int open​(byte[] plaintext, byte[] messagebox, int length, byte[] nonce, byte[] publicKey, byte[] secretKey)  
      (package private) int open​(java.nio.ByteBuffer plaintext, java.nio.ByteBuffer messagebox, int length, java.nio.ByteBuffer nonce, byte[] precom, byte[] secretKey)  
      (package private) int openAfternm​(byte[] plaintext, byte[] cipher, int length, byte[] nonce, byte[] precom)  
      (package private) int openAfternm​(java.nio.ByteBuffer plaintext, java.nio.ByteBuffer messagebox, int length, java.nio.ByteBuffer nonce, byte[] precom)  
      (package private) byte[] random​(int length)  
      (package private) int secretbox​(byte[] ciphertext, byte[] plaintext, int length, byte[] nonce, byte[] key)  
      (package private) int secretbox​(java.nio.ByteBuffer ciphertext, java.nio.ByteBuffer plaintext, int length, java.nio.ByteBuffer nonce, byte[] key)  
      (package private) int secretboxOpen​(byte[] plaintext, byte[] box, int length, byte[] nonce, byte[] key)  
      (package private) int secretboxOpen​(java.nio.ByteBuffer plaintext, java.nio.ByteBuffer box, int length, java.nio.ByteBuffer nonce, byte[] key)  
      static java.lang.String z85EncodePublic​(byte[] publicKey)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Curve

        public Curve()
    • Method Detail

      • z85EncodePublic

        public static java.lang.String z85EncodePublic​(byte[] publicKey)
      • keypairZ85

        public java.lang.String[] keypairZ85()
        Generates a pair of Z85-encoded keys for use with this class.
        Returns:
        an array of 2 strings, holding Z85-encoded keys. The first element of the array is the public key, the second element is the private (or secret) key.
      • keypair

        public byte[][] keypair()
        Generates a pair of keys for use with this class.
        Returns:
        an array of 2 byte arrays, holding keys. The first element of the array is the public key, the second element is the private (or secret) key.
      • beforenm

        int beforenm​(byte[] outSharedKey,
                     byte[] publicKey,
                     byte[] secretKey)
      • afternm

        int afternm​(java.nio.ByteBuffer ciphered,
                    java.nio.ByteBuffer plaintext,
                    int length,
                    java.nio.ByteBuffer nonce,
                    byte[] precom)
      • afternm

        int afternm​(byte[] ciphered,
                    byte[] plaintext,
                    int length,
                    byte[] nonce,
                    byte[] precomp)
      • openAfternm

        int openAfternm​(java.nio.ByteBuffer plaintext,
                        java.nio.ByteBuffer messagebox,
                        int length,
                        java.nio.ByteBuffer nonce,
                        byte[] precom)
      • openAfternm

        int openAfternm​(byte[] plaintext,
                        byte[] cipher,
                        int length,
                        byte[] nonce,
                        byte[] precom)
      • open

        int open​(java.nio.ByteBuffer plaintext,
                 java.nio.ByteBuffer messagebox,
                 int length,
                 java.nio.ByteBuffer nonce,
                 byte[] precom,
                 byte[] secretKey)
      • open

        int open​(byte[] plaintext,
                 byte[] messagebox,
                 int length,
                 byte[] nonce,
                 byte[] publicKey,
                 byte[] secretKey)
      • secretbox

        int secretbox​(java.nio.ByteBuffer ciphertext,
                      java.nio.ByteBuffer plaintext,
                      int length,
                      java.nio.ByteBuffer nonce,
                      byte[] key)
      • secretbox

        int secretbox​(byte[] ciphertext,
                      byte[] plaintext,
                      int length,
                      byte[] nonce,
                      byte[] key)
      • secretboxOpen

        int secretboxOpen​(java.nio.ByteBuffer plaintext,
                          java.nio.ByteBuffer box,
                          int length,
                          java.nio.ByteBuffer nonce,
                          byte[] key)
      • secretboxOpen

        int secretboxOpen​(byte[] plaintext,
                          byte[] box,
                          int length,
                          byte[] nonce,
                          byte[] key)
      • random

        byte[] random​(int length)
      • box

        public int box​(java.nio.ByteBuffer ciphertext,
                       java.nio.ByteBuffer plaintext,
                       int length,
                       java.nio.ByteBuffer nonce,
                       byte[] publicKey,
                       byte[] secretKey)
      • box

        public int box​(byte[] ciphertext,
                       byte[] plaintext,
                       int length,
                       byte[] nonce,
                       byte[] publicKey,
                       byte[] secretKey)