Skip to content

Commit 2815611

Browse files
committed
Java 1.4 compatibility
1 parent 0e3b490 commit 2815611

File tree

6 files changed

+2183
-5
lines changed

6 files changed

+2183
-5
lines changed

core/src/main/jdk1.4/org/bouncycastle/crypto/digests/AsconDigest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import org.bouncycastle.crypto.DataLengthException;
66
import org.bouncycastle.crypto.Digest;
7+
import org.bouncycastle.crypto.ExtendedDigest;
78
import org.bouncycastle.crypto.OutputLengthException;
89

910
/* ASCON v1.2 Digest, https://ascon.iaik.tugraz.at/ .
@@ -13,7 +14,7 @@
1314
* ASCON v1.2 Digest with reference to C Reference Impl from: https://github.com/ascon/ascon-c .
1415
*/
1516
public class AsconDigest
16-
implements Digest
17+
implements ExtendedDigest
1718
{
1819
public static class AsconParameters
1920
{
@@ -57,6 +58,7 @@ public AsconDigest(AsconParameters parameters)
5758
private long x3;
5859
private long x4;
5960
private final int CRYPTO_BYTES = 32;
61+
protected final int ASCON_HASH_RATE = 8;
6062
private final int ASCON_PB_ROUNDS;
6163

6264
private long ROR(long x, int n)
@@ -135,6 +137,11 @@ public int getDigestSize()
135137
return CRYPTO_BYTES;
136138
}
137139

140+
public int getByteLength()
141+
{
142+
return ASCON_HASH_RATE;
143+
}
144+
138145
@Override
139146
public void update(byte in)
140147
{

0 commit comments

Comments
 (0)