Enum Byte16ArrayArithmetic

    • Field Detail

      • ONE

        public static final byte[] ONE
        The 128-bit value 1.
    • Method Detail

      • values

        public static Byte16ArrayArithmetic[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Byte16ArrayArithmetic c : Byte16ArrayArithmetic.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Byte16ArrayArithmetic valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • addInto

        public static void addInto​(byte[] counter,
                                   long delta)
        counter += delta
        Parameters:
        counter - the variable-sized input and the result
        delta - the long-sized input
      • addInto

        public static void addInto​(byte[] counter,
                                   byte[] delta)
        counter += delta. Inputs must be the same length.
        Parameters:
        counter - the first input and the result
        delta - the second input
      • multiplyInto

        public static void multiplyInto​(byte[] counter,
                                        byte[] mult)
        counter *= multiplier
        Parameters:
        counter - the first input and the result
        mult - the second input
      • multiplyIntoAndAddInto

        public static void multiplyIntoAndAddInto​(byte[] counter,
                                                  byte[] mult,
                                                  byte[] add)
        counter *= mult; counter += add
        Parameters:
        counter - the first input and the result
        mult - the input to multiply by
        add - the input to add after multiplying
      • unsignedShiftRight

        public static void unsignedShiftRight​(byte[] shifted,
                                              int bits)
        shifted >>>= bits From this source.
        Parameters:
        shifted - the array input and the result
        bits - how many bits to shift by
      • unsignedShiftRightLeast64

        public static long unsignedShiftRightLeast64​(byte[] shifted,
                                                     int bits)
        Returns the lower 64 bits of the shifted input. From this source.
        Parameters:
        shifted - the array input and the result
        bits - how many bits to shift by
        Returns:
        (long)(shifted >>> bits)
      • shiftedMost

        public static long shiftedMost​(int bits,
                                       long oldMost,
                                       long oldLeast)
        Returns the upper 64 bits of (oldMost << 64LL + oldLeast) >>> bits.
        Parameters:
        bits - how many bits to shift by
        oldMost - upper 64 bits of input
        oldLeast - lower 64 bits of input
        Returns:
        the upper 64 bits of (oldMost << 64LL + oldLeast) >>> bits
      • shiftedLeast

        public static long shiftedLeast​(int bits,
                                        long oldMost,
                                        long oldLeast)
        Returns the lower 64 bits of (oldMost << 64LL + oldLeast) >>> bits.
        Parameters:
        bits - how many bits to shift by
        oldMost - upper 64 bits of input
        oldLeast - lower 64 bits of input
        Returns:
        the lower 64 bits of (oldMost << 64LL + oldLeast) >>> bits
      • rotateRight

        public static void rotateRight​(byte[] shifted,
                                       int bits)
        shifted = (shifted >>> bits) | shifted << (128 - bits)
        Parameters:
        shifted - the array input and the result
        bits - how many bits to shift by
      • rotateRightLeast64

        public static long rotateRightLeast64​(byte[] shifted,
                                              int bits)
        Returns the lower 64 bits of the result when the input is rotated.
        Parameters:
        shifted - the array input and the result
        bits - how many bits to shift by
        Returns:
        (long) ((shifted >>> bits) | shifted << (128 - bits))