private bool IsMultStepShareLegal(MultStepBCaseShare recvShareFromPlayer_i, MultStepVerificationPoly recvVerifcationPolynomial) { if (!IsRecvShareLegal(recvShareFromPlayer_i)) { return(false); } var RxPolynomial = recvVerifcationPolynomial.RxPolynomial; Zp Ratpoint0 = Zp.EvalutePolynomialAtPoint(RxPolynomial, new Zp(Prime, 0)); if (!Ratpoint0.Equals(new Zp(Prime, 0))) { return(false); } int w = NumTheoryUtils.GetFieldMinimumPrimitive(Prime); var w_InMyIndex = new Zp(Prime, NumTheoryUtils.ModPow(w, Party.Id, Prime)); Zp RjFromPublicPolynomial = Zp.EvalutePolynomialAtPoint(RxPolynomial, w_InMyIndex); Zp temp = recvShareFromPlayer_i.AShare.ConstMul(recvShareFromPlayer_i.BShare).ConstSub(recvShareFromPlayer_i.AbShare); Zp RjFromRecvPrivateInfo = w_InMyIndex.ConstMul(recvShareFromPlayer_i.RShare).ConstAdd(temp); if (!RjFromPublicPolynomial.Equals(RjFromRecvPrivateInfo)) { return(false); } return(true); }
public static bool CheckSharedSecrets(Zp secret, int numberOfPlayers, int polynomDeg, int prime) { return secret.Equals(Recombine(Share(secret, numberOfPlayers, polynomDeg), polynomDeg, prime)); }
public static bool CheckSharedSecrets(Zp secret, int numberOfPlayers, int polynomDeg, int prime) { return(secret.Equals(Recombine(Share(secret, numberOfPlayers, polynomDeg), polynomDeg, prime))); }