Ejemplo n.º 1
0
 public unsafe void SetDheDerivedValue(IKeyshareInstance keyShare)
 {
     if (keyShare != null)
     {
         keyShare.DeriveSecret(CryptoProvider.HashProvider, CipherSuite.HashType, _secret, _hashSize, _secret, _hashSize);
     }
     else
     {
         HkdfFunctions.HkdfExtract(CryptoProvider.HashProvider, CipherSuite.HashType, null, 0, _secret, _hashSize, _secret, _hashSize);
     }
 }
Ejemplo n.º 2
0
 public static void WriteKeyShare(ref WritableBuffer buffer, IKeyshareInstance keyshare)
 {
     buffer.WriteBigEndian(keyshare.NamedGroup);
     buffer.WriteBigEndian((ushort)keyshare.KeyExchangeSize);
     keyshare.WritePublicKey(ref buffer);
 }