public Authority(DeserializeContext context, BaseParameters parameters) { Index = context.ReadInt32(); this.polynomial = context.ReadObject<Polynomial>(); if (!context.ReadBoolean()) { this.secretKeyPart = context.ReadBigInt(); } this.parameters = parameters; }
/// <summary> /// Create one's own polynomial. /// </summary> /// <param name="degree">Degress of the polynomial. Equal to the cryptographic thereshold.</param> public void CreatePolynomial() { if (this.polynomial != null) throw new InvalidOperationException("Polynom already created."); this.polynomial = new Polynomial(); while (this.polynomial.Degree < this.parameters.Thereshold) { this.polynomial.AddCoefficient(this.parameters.Random()); } }