![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.crypto.digests.AsconHash256 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcprov-jdk14 Show documentation
Show all versions of bcprov-jdk14 Show documentation
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.4.
The newest version!
package org.bouncycastle.crypto.digests;
import org.bouncycastle.util.Pack;
/**
* Ascon-Hash256 was introduced in NIST Special Publication (SP) 800-232
* (Initial Public Draft).
*
* Additional details and the specification can be found in:
* NIST SP 800-232 (Initial Public Draft).
* For reference source code and implementation details, please see:
* Reference, highly optimized, masked C and
* ASM implementations of Ascon (NIST SP 800-232).
*
*/
public class AsconHash256
extends AsconBaseDigest
{
public AsconHash256()
{
reset();
}
protected long pad(int i)
{
return 0x01L << (i << 3);
}
protected long loadBytes(final byte[] bytes, int inOff)
{
return Pack.littleEndianToLong(bytes, inOff);
}
protected long loadBytes(final byte[] bytes, int inOff, int n)
{
return Pack.littleEndianToLong(bytes, inOff, n);
}
protected void setBytes(long w, byte[] bytes, int inOff)
{
Pack.longToLittleEndian(w, bytes, inOff);
}
protected void setBytes(long w, byte[] bytes, int inOff, int n)
{
Pack.longToLittleEndian(w, bytes, inOff, n);
}
public String getAlgorithmName()
{
return "Ascon-Hash256";
}
public void reset()
{
super.reset();
/* initialize */
x0 = -7269279749984954751L;
x1 = 5459383224871899602L;
x2 = -5880230600644446182L;
x3 = 4359436768738168243L;
x4 = 1899470422303676269L;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy