Package 

Interface SecretStream.Native

    • Method Detail

      • cryptoSecretStreamKeygen

         abstract void cryptoSecretStreamKeygen(Array<byte> key)

        Generate a secret stream key.

        Parameters:
        key - The key of size KEYBYTES.
      • cryptoSecretStreamPush

         abstract boolean cryptoSecretStreamPush(SecretStream.State state, Array<byte> cipher, Array<long> cipherLen, Array<byte> message, int messageLen, Array<byte> additionalData, int additionalDataLen, byte tag)

        Encrypt a {@code message}.

        Parameters:
        state - State as initialised in cryptoSecretStreamInitPush.
        cipher - The resulting cipher of size ABYTES + {@code messageLen}.
        cipherLen - The length of the resulting cipher 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.
      • cryptoSecretStreamPush

         abstract boolean cryptoSecretStreamPush(SecretStream.State state, Array<byte> cipher, Array<long> cipherLen, Array<byte> message, int messageLen, byte tag)

        Encrypt a {@code message}. This is like cryptoSecretStreamPushbut without additional data.

        Parameters:
        state - State.
        cipher - The resulting cipher of size ABYTES + {@code messageLen}.
        cipherLen - The length of the resulting cipher will be stored here if not null.
        message - The message to encrypt.
        messageLen - The message length.
        tag - The tag.
      • cryptoSecretStreamPush

         abstract boolean cryptoSecretStreamPush(SecretStream.State state, Array<byte> cipher, Array<byte> message, int messageLen, byte tag)

        Encrypt a {@code message}. This is like cryptoSecretStreamPushbut without additional data or an address to store the cipher.

        Parameters:
        state - State as initialised in cryptoSecretStreamInitPush.
        cipher - The resulting cipher of size ABYTES + {@code messageLen}.
        message - The message to encrypt.
        messageLen - The message length.
        tag - The tag.
      • cryptoSecretStreamPull

         abstract boolean cryptoSecretStreamPull(SecretStream.State state, Array<byte> message, Array<long> messageLen, Array<byte> tag, Array<byte> cipher, int cipherLen, Array<byte> additionalData, int additionalDataLen)

        Decrypt a message.

        Parameters:
        state - The state as put into cryptoSecretStreamInitPull.
        message - The message of size {@code cipherLen} - ABYTES.
        messageLen - The length of the resulting message will be stored here if not null.
        tag - The received tag will be stored here if not null.
        cipher - The resulting encrypted message.
        cipherLen - The cipher length.
        additionalData - Any authenticated data.
        additionalDataLen - Authenticated data length.
      • cryptoSecretStreamPull

         abstract boolean cryptoSecretStreamPull(SecretStream.State state, Array<byte> message, Array<byte> tag, Array<byte> cipher, int cipherLen)

        Decrypt a message without additional data.

        Parameters:
        state - The state as put into cryptoSecretStreamInitPull.
        message - The message of size {@code cipherLen} - ABYTES.
        tag - The received tag will be stored here if not null.
        cipher - The resulting encrypted message.
        cipherLen - The cipher length.