public static interface SecretStream.Native
| Modifier and Type | Method and Description |
|---|---|
boolean |
cryptoSecretStreamInitPull(SecretStream.State state,
byte[] header,
byte[] key)
Initialises decryption using a state and a key.
|
boolean |
cryptoSecretStreamInitPush(SecretStream.State state,
byte[] header,
byte[] key)
Initialises encryption with a state and a key.
|
void |
cryptoSecretStreamKeygen(byte[] key)
Generate a secret stream key.
|
boolean |
cryptoSecretStreamPull(SecretStream.State state,
byte[] message,
byte[] tag,
byte[] cipher,
long cipherLen)
Decrypt a message without additional data.
|
boolean |
cryptoSecretStreamPull(SecretStream.State state,
byte[] message,
long[] messageAddress,
byte[] tag,
byte[] cipher,
long cipherLen,
byte[] additionalData,
long additionalDataLen)
Decrypt a message.
|
boolean |
cryptoSecretStreamPush(SecretStream.State state,
byte[] cipher,
byte[] message,
long messageLen,
byte tag)
Encrypt a
message. |
boolean |
cryptoSecretStreamPush(SecretStream.State state,
byte[] cipher,
long[] cipherAddr,
byte[] message,
long messageLen,
byte tag)
Encrypt a
message. |
boolean |
cryptoSecretStreamPush(SecretStream.State state,
byte[] cipher,
long[] cipherAddr,
byte[] message,
long messageLen,
byte[] additionalData,
long additionalDataLen,
byte tag)
Encrypt a
message. |
void |
cryptoSecretStreamRekey(SecretStream.State state)
Explicitly rekeys.
|
void cryptoSecretStreamKeygen(byte[] key)
key - The key of size SecretStream.KEYBYTES.boolean cryptoSecretStreamInitPush(SecretStream.State state, byte[] header, byte[] key)
state - State to be used in other cryptoSecretStreamPush() functions.header - The header of size SecretStream.HEADERBYTES.key - The key as generated by cryptoSecretStreamKeygen(byte[]).boolean cryptoSecretStreamPush(SecretStream.State state, byte[] cipher, long[] cipherAddr, byte[] message, long messageLen, byte[] additionalData, long additionalDataLen, byte tag)
message.state - State as initialised in cryptoSecretStreamInitPush.cipher - The resulting cipher of size SecretStream.ABYTES + messageLen.cipherAddr - The cipher address will be stored here if not null.message - The message to encrypt.messageLen - The message length.additionalData - Additional data.additionalDataLen - Additional data length.tag - The tag.boolean cryptoSecretStreamPush(SecretStream.State state, byte[] cipher, long[] cipherAddr, byte[] message, long messageLen, byte tag)
message. This is like cryptoSecretStreamPush
but without additional data.state - State.cipher - The resulting cipher of size SecretStream.ABYTES + messageLen.cipherAddr - The cipher address will be stored here if not null.message - The message to encrypt.messageLen - The message length.tag - The tag.boolean cryptoSecretStreamPush(SecretStream.State state, byte[] cipher, byte[] message, long messageLen, byte tag)
message. This is like cryptoSecretStreamPush
but without additional data or an address to store the cipher.state - State as initialised in cryptoSecretStreamInitPush.cipher - The resulting cipher of size SecretStream.ABYTES + messageLen.message - The message to encrypt.messageLen - The message length.tag - The tag.boolean cryptoSecretStreamInitPull(SecretStream.State state, byte[] header, byte[] key)
state - State to be used in other cryptoSecretStreamPush() functions.header - The header of size SecretStream.HEADERBYTES.key - The key as generated by cryptoSecretStreamKeygen(byte[]).boolean cryptoSecretStreamPull(SecretStream.State state, byte[] message, long[] messageAddress, byte[] tag, byte[] cipher, long cipherLen, byte[] additionalData, long additionalDataLen)
state - The state as put into cryptoSecretStreamInitPull.message - The message of size cipherLen - SecretStream.ABYTES.messageAddress - The place to store the message.tag - The tag.cipher - The resulting encrypted message.cipherLen - The cipher length.additionalData - Any authenticated data.additionalDataLen - Authenticated data length.boolean cryptoSecretStreamPull(SecretStream.State state, byte[] message, byte[] tag, byte[] cipher, long cipherLen)
state - The state as put into cryptoSecretStreamInitPull.message - The message of size cipherLen - SecretStream.ABYTES.tag - The tag.cipher - The resulting encrypted message.cipherLen - The cipher length.void cryptoSecretStreamRekey(SecretStream.State state)
state - The state to update.