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); } }
public static void WriteKeyShare(ref WritableBuffer buffer, IKeyshareInstance keyshare) { buffer.WriteBigEndian(keyshare.NamedGroup); buffer.WriteBigEndian((ushort)keyshare.KeyExchangeSize); keyshare.WritePublicKey(ref buffer); }