Class Nonce


  • public class Nonce
    extends java.lang.Object
    Class representing an unsigned 128 bit value used as nonce;
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SIZE
      Size of the nonce in bytes.
    • Constructor Summary

      Constructors 
      Constructor Description
      Nonce()
      Creates nonce with value 0.
      Nonce​(byte[] input)
      Initializes nonce with given value.
      Nonce​(java.security.SecureRandom secrandom)
      Initializes nonce with random value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dec()
      Decreases the value by one.
      byte[] getAsBytes()
      Returns the value as a byte array.
      void inc()
      Increases the value by one.
      • Methods inherited from class java.lang.Object

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

      • Nonce

        public Nonce()
        Creates nonce with value 0.
      • Nonce

        public Nonce​(byte[] input)
        Initializes nonce with given value.
        Parameters:
        input - The value.
      • Nonce

        public Nonce​(java.security.SecureRandom secrandom)
        Initializes nonce with random value.
        Parameters:
        secrandom - The random number source.
    • Method Detail

      • inc

        public void inc()
        Increases the value by one.
      • dec

        public void dec()
        Decreases the value by one.
      • getAsBytes

        public byte[] getAsBytes()
        Returns the value as a byte array.
        Returns:
        Byte array representing the value, big endian.