Ejemplo n.º 1
0
 /// <summary>
 /// Computes the field polynomial for a ONB according to IEEE 1363 A.7.2
 /// </summary>
 protected override void ComputeFieldPolynomial()
 {
     if (m_Type == 1)
     {
         FieldPoly = new GF2Polynomial(DegreeN + 1, "ALL");
     }
     else if (m_Type == 2)
     {
         // 1. q = 1
         GF2Polynomial q = new GF2Polynomial(DegreeN + 1, "ONE");
         // 2. p = t+1
         GF2Polynomial p = new GF2Polynomial(DegreeN + 1, "X");
         p.AddToThis(q);
         GF2Polynomial r;
         int           i;
         // 3. for i = 1 to (m-1) do
         for (i = 1; i < DegreeN; i++)
         {
             // r <- q
             r = q;
             // q <- p
             q = p;
             // p = tq+r
             p = q.ShiftLeft();
             p.AddToThis(r);
         }
         FieldPoly = p;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Computes the field polynomial for a ONB according to IEEE 1363 A.7.2
 /// </summary>
 protected override void ComputeFieldPolynomial()
 {
     if (_mType == 1)
     {
         FieldPoly = new GF2Polynomial(DegreeN + 1, "ALL");
     }
     else if (_mType == 2)
     {
         // 1. q = 1
         GF2Polynomial q = new GF2Polynomial(DegreeN + 1, "ONE");
         // 2. p = t+1
         GF2Polynomial p = new GF2Polynomial(DegreeN + 1, "X");
         p.AddToThis(q);
         GF2Polynomial r;
         int i;
         // 3. for i = 1 to (m-1) do
         for (i = 1; i < DegreeN; i++)
         {
             // r <- q
             r = q;
             // q <- p
             q = p;
             // p = tq+r
             p = q.ShiftLeft();
             p.AddToThis(r);
         }
         FieldPoly = p;
     }
 }