Package org.polkadot.utils.crypto
Class TweetNaCl
- java.lang.Object
-
- org.polkadot.utils.crypto.TweetNaCl
-
public class TweetNaCl extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTweetNaCl.InvalidCipherTextExceptionstatic classTweetNaCl.InvalidSignatureException
-
Field Summary
Fields Modifier and Type Field Description static intBOX_NONCE_BYTESstatic intBOX_OVERHEAD_BYTESstatic intBOX_PUBLIC_KEY_BYTESstatic intBOX_SECRET_KEY_BYTESstatic intBOX_SHARED_KEY_BYTESstatic intcrypto_auth_hmacsha512256_tweet_BYTESstatic intcrypto_auth_hmacsha512256_tweet_KEYBYTESstatic intHASH_SIZE_BYTESstatic intSECRETBOX_KEY_BYTESstatic intSECRETBOX_NONCE_BYTESstatic intSECRETBOX_OVERHEAD_BYTESstatic intSIGN_KEYPAIR_SEED_BYTESstatic intSIGN_PUBLIC_KEY_BYTESstatic intSIGN_SECRET_KEY_BYTESstatic intSIGNATURE_SIZE_BYTES
-
Constructor Summary
Constructors Constructor Description TweetNaCl()
-
Method Summary
Modifier and Type Method Description static byte[]crypto_box(byte[] message, byte[] nonce, byte[] theirPublicBoxingKey, byte[] ourSecretBoxingKey)static intcrypto_box_keypair(byte[] y, byte[] x, boolean isSeeded)static byte[]crypto_box_open(byte[] cipher, byte[] nonce, byte[] theirPublicBoxingKey, byte[] secretBoxingKey)static intcrypto_scalarmult_base(byte[] q, byte[] n)static byte[]crypto_sign(byte[] message, byte[] secretSigningKey)static voidcrypto_sign_keypair(byte[] pk, byte[] sk, boolean isSeeded)static byte[]crypto_sign_open(byte[] signed, byte[] publicSigningKey)static intld32(byte[] x, int off)static voidrandombytes(byte[] b, int len)static byte[]secretbox(byte[] mesage, byte[] nonce, byte[] key)static byte[]secretbox_open(byte[] cipher, byte[] nonce, byte[] key)
-
-
-
Field Detail
-
crypto_auth_hmacsha512256_tweet_BYTES
public static final int crypto_auth_hmacsha512256_tweet_BYTES
- See Also:
- Constant Field Values
-
crypto_auth_hmacsha512256_tweet_KEYBYTES
public static final int crypto_auth_hmacsha512256_tweet_KEYBYTES
- See Also:
- Constant Field Values
-
BOX_PUBLIC_KEY_BYTES
public static final int BOX_PUBLIC_KEY_BYTES
- See Also:
- Constant Field Values
-
BOX_SECRET_KEY_BYTES
public static final int BOX_SECRET_KEY_BYTES
- See Also:
- Constant Field Values
-
BOX_SHARED_KEY_BYTES
public static final int BOX_SHARED_KEY_BYTES
- See Also:
- Constant Field Values
-
BOX_NONCE_BYTES
public static final int BOX_NONCE_BYTES
- See Also:
- Constant Field Values
-
BOX_OVERHEAD_BYTES
public static final int BOX_OVERHEAD_BYTES
- See Also:
- Constant Field Values
-
SIGNATURE_SIZE_BYTES
public static final int SIGNATURE_SIZE_BYTES
- See Also:
- Constant Field Values
-
SIGN_PUBLIC_KEY_BYTES
public static final int SIGN_PUBLIC_KEY_BYTES
- See Also:
- Constant Field Values
-
SIGN_SECRET_KEY_BYTES
public static final int SIGN_SECRET_KEY_BYTES
- See Also:
- Constant Field Values
-
SIGN_KEYPAIR_SEED_BYTES
public static final int SIGN_KEYPAIR_SEED_BYTES
- See Also:
- Constant Field Values
-
SECRETBOX_KEY_BYTES
public static final int SECRETBOX_KEY_BYTES
- See Also:
- Constant Field Values
-
SECRETBOX_NONCE_BYTES
public static final int SECRETBOX_NONCE_BYTES
- See Also:
- Constant Field Values
-
SECRETBOX_OVERHEAD_BYTES
public static final int SECRETBOX_OVERHEAD_BYTES
- See Also:
- Constant Field Values
-
HASH_SIZE_BYTES
public static final int HASH_SIZE_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
crypto_sign_keypair
public static void crypto_sign_keypair(byte[] pk, byte[] sk, boolean isSeeded)
-
crypto_box_keypair
public static int crypto_box_keypair(byte[] y, byte[] x, boolean isSeeded)
-
crypto_scalarmult_base
public static int crypto_scalarmult_base(byte[] q, byte[] n)
-
crypto_sign
public static byte[] crypto_sign(byte[] message, byte[] secretSigningKey)
-
crypto_sign_open
public static byte[] crypto_sign_open(byte[] signed, byte[] publicSigningKey)
-
crypto_box
public static byte[] crypto_box(byte[] message, byte[] nonce, byte[] theirPublicBoxingKey, byte[] ourSecretBoxingKey)
-
crypto_box_open
public static byte[] crypto_box_open(byte[] cipher, byte[] nonce, byte[] theirPublicBoxingKey, byte[] secretBoxingKey)
-
secretbox
public static byte[] secretbox(byte[] mesage, byte[] nonce, byte[] key)
-
secretbox_open
public static byte[] secretbox_open(byte[] cipher, byte[] nonce, byte[] key)
-
ld32
public static int ld32(byte[] x, int off)
-
randombytes
public static void randombytes(byte[] b, int len)
-
-