public void Hash64Async_BigEndian_Throws() { Bits.IsBigEndian = true; Assert.ThrowsAsync <NotSupportedException>(async() => await SipHash24.Hash64Async(new MemoryStream(new byte[0]), new byte[16])); Bits.IsBigEndian = false; }
public void Hash64Async_InvalidKeyLength_Throws() { using (var stream = new MemoryStream(new byte[0])) { Assert.ThrowsAsync <ArgumentException>(async() => await SipHash24.Hash64Async(stream, new byte[15])); } }
public async Task Hash64Async_TestVectors() { for (int i = 0; i < vectors.Length; ++i) { var buffer = getBuffer(i); using var stream = new MemoryStream(buffer); ulong result = await SipHash24.Hash64Async(stream, key); ulong expectedResult = vectors[i]; Assert.AreEqual(expectedResult, result); } }
public void Hash64Async_BigEndian_Throws() { Assert.ThrowsAsync <NotSupportedException>(() => SipHash24.Hash64Async(new MemoryStream(new byte[0]), new byte[16])); }