Class Aes256Ctr32

  • All Implemented Interfaces:
    org.signal.libsignal.internal.NativeHandleGuard.Owner

    
    public class Aes256Ctr32
    extends NativeHandleGuard.SimpleOwner
                        

    Implements the AES-256-CTR stream cipher with a 12-byte nonce and an initial counter.

    CTR mode is built on XOR, so encrypting and decrypting are the same operation.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Aes256Ctr32(Array<byte> key, Array<byte> nonce, int initialCtr)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void process(Array<byte> data) Encrypts the plaintext, or decrypts the ciphertext, in data, in place, advancing the state of the cipher.
      void process(Array<byte> data, int offset, int length) Encrypts the plaintext, or decrypts the ciphertext, in data, in place, advancing the state of the cipher.
      • Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.SimpleOwner

        unsafeNativeHandleWithoutGuard
      • Methods inherited from class org.signal.libsignal.internal.NativeHandleGuard.Owner

        guard, guardedMap, guardedMapChecked, guardedRun, guardedRunChecked
      • Methods inherited from class java.lang.Object

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

      • Aes256Ctr32

        Aes256Ctr32(Array<byte> key, Array<byte> nonce, int initialCtr)
    • Method Detail

      • process

         void process(Array<byte> data)

        Encrypts the plaintext, or decrypts the ciphertext, in data, in place, advancing the state of the cipher.

      • process

         void process(Array<byte> data, int offset, int length)

        Encrypts the plaintext, or decrypts the ciphertext, in data, in place, advancing the state of the cipher.

        Bytes outside the designated offset/length are unchanged.