/// <summary>
 /// Creates a new GF2nPolynomialElement using the given field <c>Gf</c> and int[] <c>Is</c> as value
 /// </summary>
 /// 
 /// <param name="Gf">The GF2nField to use</param>
 /// <param name="Is">The integer string to assign to this GF2nPolynomialElement</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, int[] Is)
 {
     mField = Gf;
     mDegree = mField.Degree;
     polynomial = new GF2Polynomial(mDegree, Is);
     polynomial.ExpandN(Gf.Degree);
 }
 /// <summary>
 /// Creates a new GF2nPolynomialElement using the given field and Bitstring
 /// </summary>
 /// 
 /// <param name="Gf">The GF2nPolynomialField to use</param>
 /// <param name="Gp">The desired value as Bitstring</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, GF2Polynomial Gp)
 {
     mField = Gf;
     mDegree = mField.Degree;
     polynomial = new GF2Polynomial(Gp);
     polynomial.ExpandN(mDegree);
 }
 /// <summary>
 /// Creates a new GF2nPolynomialElement using the given field <c>f</c> and byte[] <c>os</c> as value. 
 /// <para>The conversion is done according to 1363.</para>
 /// </summary>
 /// 
 /// <param name="Gf">The GF2nField to use</param>
 /// <param name="Os">The octet string to assign to this GF2nPolynomialElement</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, byte[] Os)
 {
     mField = Gf;
     mDegree = mField.Degree;
     polynomial = new GF2Polynomial(mDegree, Os);
     polynomial.ExpandN(mDegree);
 }
示例#4
0
 /// <summary>
 /// Creates a new GF2nPolynomialElement using the given field <c>Gf</c> and int[] <c>Is</c> as value
 /// </summary>
 ///
 /// <param name="Gf">The GF2nField to use</param>
 /// <param name="Is">The integer string to assign to this GF2nPolynomialElement</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, int[] Is)
 {
     m_Field      = Gf;
     m_Degree     = m_Field.Degree;
     m_polynomial = new GF2Polynomial(m_Degree, Is);
     m_polynomial.ExpandN(Gf.Degree);
 }
 /// <summary>
 /// Create a new random GF2nPolynomialElement using the given field and source of randomness
 /// </summary>
 /// 
 /// <param name="Gf">The GF2nField to use</param>
 /// <param name="Rnd">The source of randomness</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, Random Rnd)
 {
     mField = Gf;
     mDegree = mField.Degree;
     polynomial = new GF2Polynomial(mDegree);
     Randomize(Rnd);
 }
示例#6
0
 /// <summary>
 /// Creates a new GF2nPolynomialElement using the given field <c>f</c> and byte[] <c>os</c> as value.
 /// <para>The conversion is done according to 1363.</para>
 /// </summary>
 ///
 /// <param name="Gf">The GF2nField to use</param>
 /// <param name="Os">The octet string to assign to this GF2nPolynomialElement</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, byte[] Os)
 {
     m_Field      = Gf;
     m_Degree     = m_Field.Degree;
     m_polynomial = new GF2Polynomial(m_Degree, Os);
     m_polynomial.ExpandN(m_Degree);
 }
示例#7
0
 /// <summary>
 /// Creates a new GF2nPolynomialElement using the given field and Bitstring
 /// </summary>
 ///
 /// <param name="Gf">The GF2nPolynomialField to use</param>
 /// <param name="Gp">The desired value as Bitstring</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, GF2Polynomial Gp)
 {
     m_Field      = Gf;
     m_Degree     = m_Field.Degree;
     m_polynomial = new GF2Polynomial(Gp);
     m_polynomial.ExpandN(m_Degree);
 }
示例#8
0
 /// <summary>
 /// Create a new random GF2nPolynomialElement using the given field and source of randomness
 /// </summary>
 ///
 /// <param name="Gf">The GF2nField to use</param>
 /// <param name="Rnd">The source of randomness</param>
 public GF2nPolynomialElement(GF2nPolynomialField Gf, Random Rnd)
 {
     m_Field      = Gf;
     m_Degree     = m_Field.Degree;
     m_polynomial = new GF2Polynomial(m_Degree);
     Randomize(Rnd);
 }
 /// <summary>
 /// Create the zero element
 /// </summary>
 /// 
 /// <param name="Gf">The finite field</param>
 /// 
 /// <returns>The zero element in the given finite field</returns>
 public static GF2nPolynomialElement Zero(GF2nPolynomialField Gf)
 {
     GF2Polynomial polynomial = new GF2Polynomial(Gf.Degree);
     return new GF2nPolynomialElement(Gf, polynomial);
 }
 /// <summary>
 /// Create the one element
 /// </summary>
 /// 
 /// <param name="Gf">The finite field</param>
 /// 
 /// <returns>The one element in the given finite field</returns>
 public static GF2nPolynomialElement One(GF2nPolynomialField Gf)
 {
     GF2Polynomial polynomial = new GF2Polynomial(Gf.Degree, new int[] { 1 });
     return new GF2nPolynomialElement(Gf, polynomial);
 }
示例#11
0
        /// <summary>
        /// Create the zero element
        /// </summary>
        ///
        /// <param name="Gf">The finite field</param>
        ///
        /// <returns>The zero element in the given finite field</returns>
        public static GF2nPolynomialElement Zero(GF2nPolynomialField Gf)
        {
            GF2Polynomial polynomial = new GF2Polynomial(Gf.Degree);

            return(new GF2nPolynomialElement(Gf, polynomial));
        }
示例#12
0
        /// <summary>
        /// Create the one element
        /// </summary>
        ///
        /// <param name="Gf">The finite field</param>
        ///
        /// <returns>The one element in the given finite field</returns>
        public static GF2nPolynomialElement One(GF2nPolynomialField Gf)
        {
            GF2Polynomial polynomial = new GF2Polynomial(Gf.Degree, new int[] { 1 });

            return(new GF2nPolynomialElement(Gf, polynomial));
        }