/// <summary> /// Tests random polynomials of degree (n+1) until an irreducible is found and stores the result in <c>field polynomial</c>. /// This can take very long for huge degrees. /// </summary> /// /// <returns>Returns true</returns> private bool TestRandom() { int l; bool done = false; FieldPoly = new GF2Polynomial(DegreeN + 1); l = 0; while (!done) { l++; FieldPoly.Randomize(); FieldPoly.SetBit(DegreeN); FieldPoly.SetBit(0); if (FieldPoly.IsIrreducible()) { done = true; return(done); } } return(done); }
/// <summary> /// Tests random polynomials of degree (n+1) until an irreducible is found and stores the result in <c>field polynomial</c>. /// This can take very long for huge degrees. /// </summary> /// /// <returns>Returns true</returns> private bool TestRandom() { int l; bool done = false; FieldPoly = new GF2Polynomial(DegreeN + 1); l = 0; while (!done) { l++; FieldPoly.Randomize(); FieldPoly.SetBit(DegreeN); FieldPoly.SetBit(0); if (FieldPoly.IsIrreducible()) { done = true; return done; } } return done; }
/// <summary> /// Assign a random value to this GF2nPolynomialElement using the specified source of randomness /// </summary> /// /// <param name="Rnd">The source of randomness</param> private void Randomize(Random Rnd) { polynomial.ExpandN(mDegree); polynomial.Randomize(Rnd); }
/// <summary> /// Assign a random value to this GF2nPolynomialElement using the specified source of randomness /// </summary> /// /// <param name="Rnd">The source of randomness</param> private void Randomize(Random Rnd) { m_polynomial.ExpandN(m_Degree); m_polynomial.Randomize(Rnd); }