public static byte[] Secret(HandshakeCredentials credentials, byte[] publicKey) { BigInteger xa = new BigInteger(Reverse(Padding(credentials.PrivateKey, 21))); BigInteger yb = new BigInteger(Reverse(Padding(publicKey, 97))); BigInteger secret = BigInteger.ModPow(yb, xa, Prime); return(Padding(Reverse(secret.ToByteArray()), 96)); }
public HandshakeNegotiatorPassive(NetworkPool pool, NetworkConnection connection, HandshakeNegotiatorPassiveContext context, HandshakeNegotiatorHooks hooks) { this.context = context; this.hooks = hooks; this.connection = new HandshakeConnection(pool, connection, hooks); this.credentials = HandshakeCryptography.Generate(); this.keys = new HandshakeKeyContainer(); }
public HandshakeKeyExchangeMessage(HandshakeCredentials credentials) { this.credentials = credentials; }