Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.digests

public Class SparkleDigest

extends Object
implements ExtendedDigest
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.Digest
Imports
org.bouncycastle.crypto.DataLengthException, .ExtendedDigest, .OutputLengthException, org.bouncycastle.crypto.engines.SparkleEngine, org.bouncycastle.util.Arrays, .Integers, .Pack

Sparkle v1.2, based on the current round 3 submission, https://sparkle-lwc.github.io/ Reference C implementation: https://github.com/cryptolu/sparkle Specification: https://csrc.nist.gov/CSRC/media/Projects/lightweight-cryptography/documents/finalist-round/updated-spec-doc/sparkle-spec-final.pdf

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static enum

Field Summary

Modifier and TypeField and Description
private String
private final int
private final byte[]
private int
private static final int
private static final int
private final int
private final int
private final int[]
private final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
doFinal(byte[]
the array the digest is to be copied into.
output
,
int
the offset into the out array the digest is to start at.
outOff
)

Implements org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value.
private static int
ELL(int x)

public String
public int
getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.
public int
getDigestSize()

Implements org.bouncycastle.crypto.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.
private void
processBlock(byte[] buf, int off, int steps)

public void
reset()

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.
public void
update(byte
the input byte to be entered.
input
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.
public void
update(byte[]
the byte array containing the data.
in
,
int
the offset into the byte array where the data starts.
inOff
,
int
the length of the data.
len
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a block of bytes.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmNameback to summary
private String algorithmName
DIGEST_BYTESback to summary
private final int DIGEST_BYTES
m_bufback to summary
private final byte[] m_buf
m_bufPosback to summary
private int m_bufPos
RATE_BYTESback to summary
private static final int RATE_BYTES
RATE_WORDSback to summary
private static final int RATE_WORDS
SPARKLE_STEPS_BIGback to summary
private final int SPARKLE_STEPS_BIG
SPARKLE_STEPS_SLIMback to summary
private final int SPARKLE_STEPS_SLIM
stateback to summary
private final int[] state
STATE_WORDSback to summary
private final int STATE_WORDS

Constructor Detail

SparkleDigestback to summary
public SparkleDigest(SparkleDigest.SparkleParameters sparkleParameters)

Method Detail

doFinalback to summary
public int doFinal(byte[] output, int outOff)

Implements org.bouncycastle.crypto.Digest.doFinal.

Doc from org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value. The doFinal call leaves the digest reset.

Parameters
output:byte[]

the array the digest is to be copied into.

outOff:int

the offset into the out array the digest is to start at.

Annotations
@Override
ELLback to summary
private static int ELL(int x)
getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

Doc from org.bouncycastle.crypto.Digest.getAlgorithmName.

return the algorithm name

Returns:String

the algorithm name

Annotations
@Override
getByteLengthback to summary
public int getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Doc from org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.

Returns:int

byte length of the digests internal buffer.

Annotations
@Override
getDigestSizeback to summary
public int getDigestSize()

Implements org.bouncycastle.crypto.Digest.getDigestSize.

Doc from org.bouncycastle.crypto.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.

Returns:int

the size, in bytes, of the digest produced by this message digest.

Annotations
@Override
processBlockback to summary
private void processBlock(byte[] buf, int off, int steps)
resetback to summary
public void reset()

Implements org.bouncycastle.crypto.Digest.reset.

Doc from org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

Annotations
@Override
updateback to summary
public void update(byte input)

Implements org.bouncycastle.crypto.Digest.update.

Doc from org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.

Parameters
input:byte

the input byte to be entered.

Annotations
@Override
updateback to summary
public void update(byte[] in, int inOff, int len)

Implements org.bouncycastle.crypto.Digest.update.

Doc from org.bouncycastle.crypto.Digest.update.

update the message digest with a block of bytes.

Parameters
in:byte[]

the byte array containing the data.

inOff:int

the offset into the byte array where the data starts.

len:int

the length of the data.

Annotations
@Override
org.bouncycastle.crypto.digests back to summary

public Class SparkleDigest.Friend

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final SparkleDigest.Friend

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final SparkleDigest.Friend INSTANCE

Constructor Detail

Friendback to summary
private Friend()
org.bouncycastle.crypto.digests back to summary

public final Enum SparkleDigest.SparkleParameters

extends Enum<SparkleDigest.SparkleParameters>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SparkleDigest.SparkleParameters
public static final SparkleDigest.SparkleParameters

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SparkleDigest.SparkleParameters
public static SparkleDigest.SparkleParameters[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ESCH256back to summary
public static final SparkleDigest.SparkleParameters ESCH256
ESCH384back to summary
public static final SparkleDigest.SparkleParameters ESCH384

Constructor Detail

SparkleParametersback to summary
private SparkleParameters()

Method Detail

valueOfback to summary
public static SparkleDigest.SparkleParameters valueOf(String name)
valuesback to summary
public static SparkleDigest.SparkleParameters[] values()