Class Polynomial

java.lang.Object
org.bouncycastle.pqc.math.ntru.Polynomial
Direct Known Subclasses:
HPSPolynomial, HRSSPolynomial

public abstract class Polynomial extends Object
  • Field Details

    • coeffs

      public short[] coeffs
      An array of coefficients
    • params

      protected NTRUParameterSet params
  • Constructor Details

  • Method Details

    • 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:
    • sqFromBytes

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

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

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

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

      public void s3FromBytes(byte[] msg)
      Unpack a S3 polynomial
      Parameters:
      msg - byte array of packed polynomial
      See Also:
    • sqMul

      public void sqMul(Polynomial a, Polynomial b)
    • rqMul

      public void rqMul(Polynomial a, Polynomial b)
    • s3Mul

      public void s3Mul(Polynomial a, Polynomial b)
    • lift

      public abstract void lift(Polynomial a)
      Parameters:
      a -
      See Also:
    • rqToS3

      public void rqToS3(Polynomial a)
    • r2Inv

      public void r2Inv(Polynomial a)
    • rqInv

      public void rqInv(Polynomial a)
    • s3Inv

      public void s3Inv(Polynomial a)
    • z3ToZq

      public void z3ToZq()
    • trinaryZqToZ3

      public void trinaryZqToZ3()