void encode(OutputStream os,boolean include_h) throws IOException {
  int q=params.q;
  os.write(getEncoded(f));
  if (params.basisType == NTRUSigningKeyGenerationParameters.BASIS_TYPE_STANDARD) {
    IntegerPolynomial fPrimeInt=fPrime.toIntegerPolynomial();
    for (int i=0; i < fPrimeInt.coeffs.length; i++) {
      fPrimeInt.coeffs[i]+=q / 2;
    }
    os.write(fPrimeInt.toBinary(q));
  }
 else {
    os.write(getEncoded(fPrime));
  }
  if (include_h) {
    os.write(h.toBinary(q));
  }
}

void encode ( OutputStream os , boolean include_h ) throws IOException { int q = params . q ; os . write ( getEncoded ( f ) ) ; if ( params . basisType == NTRUSigningKeyGenerationParameters . BASIS_TYPE_STANDARD ) { IntegerPolynomial fPrimeInt = fPrime . toIntegerPolynomial ( ) ; for ( int i = 0 ; i < fPrimeInt . coeffs . length ; i ++ ) { fPrimeInt . coeffs [ i ] += q / 2 ; } os . write ( fPrimeInt . toBinary ( q ) ) ; } else { os . write ( getEncoded ( fPrime ) ) ; } if ( include_h ) { os . write ( h . toBinary ( q ) ) ; } }
writes the basis to an output stream
