public void enrollment(String pass) { BigInteger e, d, n; genRSAKeys(out e, out d, out n); BigInteger gp = gengp(pass); int cnt = slist.Length; BigInteger[] yrand = genyi(cnt, gp); BigInteger[] shares = genshares(gp, yrand); BigInteger Km = genmaster(shares); BigInteger proofPKm = genproof(gp, Km); byte[] Uk = cryptU(d, Km); for (int i = 0; i < cnt; i++) { messC1 m = new messC1(name, yrand[i], e, Uk, proofPKm); sendenroll(slist[i], m); } enrolled = true; Console.WriteLine("\n{0}: Enrollemnt Succesful !", name); }
public void accept(messC2 m, BigInteger p) { String c = m.getA(); if (balist[c] > 2) { Console.WriteLine("\nCLIENT {0} BLOCKED !", c); rep = null; } else { messC1 c1 = clist[c]; messL l = new messL(c, m.getQ(), c1.getV(), DateTime.Now); alist.Add(l); BigInteger R = m.getQ().modPow(c1.getyi(), p); //Console.WriteLine("\nRi: " + R); rep = new messS1(R, c1.getUk(), c1.getproof()); } }
private void sendenroll(cserver cs, messC1 m) { cs.enroll(m); }
public void enroll(messC1 m) { clist.Add(m.getA(), m); balist.Add(m.getA(), 0); }