private static Salt SessionSecret(Salt clientKeyBits, byte[] serverKeyBits)
            {
                Salt sessionSecret = Salt.FromBytes(
                    Hash.SHA256(
                        new CombinedStream(
                            clientKeyBits.ToStream(),
                            new MemoryStream(serverKeyBits, false)
                            )
                        ).ToArray()
                    );

                return(sessionSecret);
            }
Example #2
0
 /// <summary> Returns a stream that combines the salt and data </summary>
 public static Stream CombineStream(Salt salt, Stream data)
 {
     return(new IO.CombinedStream(salt.ToStream(), data));
 }