// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
protected HMACSHA1 algo;
+ [SetUp]
+ protected override void SetUp ()
+ {
+ hash = HMACSHA1.Create ();
+ (hash as KeyedHashAlgorithm).Key = new byte [8];
+ }
+
[Test]
public void Constructors ()
{
public void CheckA (string testName, byte[] key, byte[] data, byte[] result)
{
+#if NET_2_0
+ algo = new HMACSHA1 (key, true);
+#else
algo = new HMACSHA1 (key);
+#endif
byte[] hmac = algo.ComputeHash (data);
AssertEquals (testName + "a1", result, hmac);
AssertEquals (testName + "a2", result, algo.Hash);
public void CheckB (string testName, byte[] key, byte[] data, byte[] result)
{
+#if NET_2_0
+ algo = new HMACSHA1 (key, false);
+#else
algo = new HMACSHA1 (key);
+#endif
byte[] hmac = algo.ComputeHash (data, 0, data.Length);
AssertEquals (testName + "b1", result, hmac);
AssertEquals (testName + "b2", result, algo.Hash);