Class Polynomial

    • Field Detail

      • coeffs

        public short[] coeffs
        An array of coefficients
    • Method Detail

      • mod3PhiN

        public void mod3PhiN()
      • modQPhiN

        public void modQPhiN()
      • sqToBytes

        public abstract byte[] sqToBytes​(int len)
        Pack Sq polynomial as a byte array
        Parameters:
        len - array length of packed polynomial
        Returns:
        See Also:
        NTRU specification section 1.8.5
      • sqFromBytes

        public abstract void sqFromBytes​(byte[] a)
        Unpack a Sq polynomial
        Parameters:
        a - byte array of packed polynomial
        See Also:
        NTRU specification section 1.8.6
      • rqSumZeroToBytes

        public byte[] rqSumZeroToBytes​(int len)
        Pack a Rq0 polynomial as a byte array
        Parameters:
        len - array length of packed polynomial
        Returns:
        See Also:
        NTRU specification section 1.8.3
      • rqSumZeroFromBytes

        public void rqSumZeroFromBytes​(byte[] a)
        Unpack a Rq0 polynomial
        Parameters:
        a - byte array of packed polynomial
        See Also:
        NTRU specification section 1.8.4
      • s3ToBytes

        public byte[] s3ToBytes​(int messageSize)
        Pack an S3 polynomial as a byte array
        Parameters:
        messageSize - array length of packed polynomial
        Returns:
        See Also:
        NTRU specification section 1.8.7
      • s3FromBytes

        public void s3FromBytes​(byte[] msg)
        Unpack a S3 polynomial
        Parameters:
        msg - byte array of packed polynomial
        See Also:
        NTRU specification section 1.8.8
      • z3ToZq

        public void z3ToZq()
      • trinaryZqToZ3

        public void trinaryZqToZ3()