/*
 * Copyright (c) 2008-2009 David Muller <roxon@users.sourceforge.net>.
 * All rights reserved. Use of the code is allowed under the
 * Artistic License 2.0 terms, as specified in the LICENSE file
 * distributed with this code, or available from
 * http://www.opensource.org/licenses/artistic-license-2.0.php
 */
package org.pwsafe.lib.crypto;

import org.pwsafe.lib.Util;

import junit.framework.TestCase;

/**
 * Test SHA256.
 * 
 * @author Glen Smith
 */
public class SHA256PwsTest extends TestCase {

	public void testDigest() {

		String data = "abc";
		byte[] digest = SHA256Pws.digest(data.getBytes());

		String result = Util.bytesToHex(digest);
		assertEquals("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", result);

	}

}

@@ -360,63 +360,63 @@
 ort 
-org.pwsafe.lib.Util;%0D%0A%0D%0Aimport junit.framework.TestCase
+junit.framework.TestCase;%0D%0A%0D%0Aimport org.pwsafe.lib.Util
 ;%0D%0A%0D
@@ -575,16 +575,55 @@
 %22abc%22;%0D%0A
+%09%09SHA256Pws hasher = new SHA256Pws();%0D%0A
 %09%09byte%5B%5D
@@ -632,25 +632,22 @@
 igest = 
-SHA256Pws
+hasher
 .digest(

Fix Trac #10 Improve SHA256Pws.digest Performance