Exemplo n.º 1
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)
 {
     mField     = Gf;
     mDegree    = mField.Degree;
     polynomial = new GF2Polynomial(mDegree, Is);
     polynomial.ExpandN(Gf.Degree);
 }
Exemplo n.º 2
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)
 {
     mField     = Gf;
     mDegree    = mField.Degree;
     polynomial = new GF2Polynomial(Gp);
     polynomial.ExpandN(mDegree);
 }
Exemplo n.º 3
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)
 {
     mField     = Gf;
     mDegree    = mField.Degree;
     polynomial = new GF2Polynomial(mDegree, Os);
     polynomial.ExpandN(mDegree);
 }
Exemplo n.º 4
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)
 {
     mField     = Gf;
     mDegree    = mField.Degree;
     polynomial = new GF2Polynomial(mDegree);
     Randomize(Rnd);
 }
 /// <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 <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);
 }
 /// <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>
 /// 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);
 }
Exemplo n.º 9
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));
        }
Exemplo n.º 10
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));
        }
 /// <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);
 }