public static CalculateK ( IDigest digest, |
||
digest | IDigest | |
N | ||
g | ||
return |
private BigInteger CalculateS() { BigInteger k = Srp6Utilities.CalculateK(digest, N, g); BigInteger exp = u.Multiply(x).Add(privA); BigInteger tmp = g.ModPow(x, N).Multiply(k).Mod(N); return(B.Subtract(tmp).Mod(N).ModPow(exp, N)); }
public virtual BigInteger GenerateServerCredentials() { BigInteger bigInteger = Srp6Utilities.CalculateK(this.digest, this.N, this.g); this.privB = this.SelectPrivateValue(); this.pubB = bigInteger.Multiply(this.v).Mod(this.N).Add(this.g.ModPow(this.privB, this.N)).Mod(this.N); return(this.pubB); }
private BigInteger CalculateS() { BigInteger val = Srp6Utilities.CalculateK(this.digest, this.N, this.g); BigInteger e = this.u.Multiply(this.x).Add(this.privA); BigInteger n = this.g.ModPow(this.x, this.N).Multiply(val).Mod(this.N); return(this.B.Subtract(n).Mod(this.N).ModPow(e, this.N)); }
private BigInteger CalculateS() { BigInteger val = Srp6Utilities.CalculateK(digest, N, g); BigInteger e = u.Multiply(x).Add(privA); BigInteger n = g.ModPow(x, N).Multiply(val).Mod(N); return(B.Subtract(n).Mod(N).ModPow(e, N)); }
/** * Generates the server's credentials that are to be sent to the client. * @return The server's public value to the client */ public virtual BigInteger GenerateServerCredentials() { BigInteger k = Srp6Utilities.CalculateK(digest, N, g); this.privB = SelectPrivateValue(); this.pubB = k.Multiply(v).Mod(N).Add(g.ModPow(privB, N)).Mod(N); return(pubB); }