Move HMac to I2PHMac, as jrandom implemented changes that make it

incompatible with the HMac in the android libraries.
This commit is contained in:
zzz
2009-03-13 18:27:29 +00:00
parent d26ac84126
commit 5a8b3eb8f3
3 changed files with 21 additions and 15 deletions

View File

@@ -42,8 +42,12 @@ import org.bouncycastle.crypto.Mac;
* a frequently used buffer (called on doFinal). changes released into the public
* domain in 2005.
*
* This is renamed from HMac because the constructor HMac(digest, sz) does not exist
* in the standard bouncycastle library, thus it conflicts in JVMs that contain the
* standard library (Android).
*
*/
public class HMac
public class I2PHMac
implements Mac
{
private final static int BLOCK_LENGTH = 64;
@@ -56,12 +60,12 @@ implements Mac
private byte[] inputPad = new byte[BLOCK_LENGTH];
private byte[] outputPad = new byte[BLOCK_LENGTH];
public HMac(
public I2PHMac(
Digest digest)
{
this(digest, digest.getDigestSize());
}
public HMac(
public I2PHMac(
Digest digest, int sz)
{
this.digest = digest;