Top Description Fields Constructors Methods
com.ongres.scram.common.bouncycastle.pbkdf2

public Class SHA256Digest

extends GeneralDigest
implements EncodableDigest
Class Inheritance
All Implemented Interfaces
com.ongres.scram.common.bouncycastle.pbkdf2.EncodableDigest

FIPS 180-2 implementation of SHA-256.
        block  word  digest
SHA-1   512    32    160
SHA-256 512    32    256
SHA-384 1024   64    384
SHA-512 1024   64    512

Field Summary

Modifier and TypeField and Description
private static final int
private int
private int
private int
private int
private int
private int
private int
private int
pack-priv static final int[]
K

private int[]
X

private int

Constructor Summary

AccessConstructor and Description
public
SHA256Digest()

Standard constructor

public
SHA256Digest(SHA256Digest t)

Copy constructor.

public
SHA256Digest(byte[]
the encoded state from the originating digest.
encodedState
)

State constructor - create a digest initialised with the state of a previous one.

Method Summary

Modifier and TypeMethod and Description
private int
Ch(int x, int y, int z)

public Memoable
copy()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.
private void
public int
doFinal(byte[]
the array the digest is to be copied into.
out
,
int
the offset into the out array the digest is to start at.
outOff
)

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Digest.doFinal.

close the digest, producing the final digest value.
public String
public int
getDigestSize()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.
public byte[]
getEncodedState()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.EncodableDigest.getEncodedState.

Return an encoded byte array for the digest's internal state
private int
Maj(int x, int y, int z)

protected void
protected void
protected void
public void
public void
reset(Memoable
an object originally copied from an object of the same type as this instance.
other
)

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Memoable.reset.

Restore a copied object state into this object.
private int
Sum0(int x)

private int
Sum1(int x)

private int
Theta0(int x)

private int
Theta1(int x)

Inherited from com.ongres.scram.common.bouncycastle.pbkdf2.GeneralDigest:
copyInfinishgetByteLengthpopulateStateupdateupdate

Field Detail

DIGEST_LENGTHback to summary
private static final int DIGEST_LENGTH
H1back to summary
private int H1
H2back to summary
private int H2
H3back to summary
private int H3
H4back to summary
private int H4
H5back to summary
private int H5
H6back to summary
private int H6
H7back to summary
private int H7
H8back to summary
private int H8
Kback to summary
pack-priv static final int[] K
Xback to summary
private int[] X
xOffback to summary
private int xOff

Constructor Detail

SHA256Digestback to summary
public SHA256Digest()

Standard constructor

SHA256Digestback to summary
public SHA256Digest(SHA256Digest t)

Copy constructor. This will copy the state of the provided message digest.

SHA256Digestback to summary
public SHA256Digest(byte[] encodedState)

State constructor - create a digest initialised with the state of a previous one.

Parameters
encodedState:byte[]

the encoded state from the originating digest.

Method Detail

Chback to summary
private int Ch(int x, int y, int z)
copyback to summary
public Memoable copy()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Memoable.copy.

Doc from com.ongres.scram.common.bouncycastle.pbkdf2.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.

The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.

copyInback to summary
private void copyIn(SHA256Digest t)
doFinalback to summary
public int doFinal(byte[] out, int outOff)

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Digest.doFinal.

Doc from com.ongres.scram.common.bouncycastle.pbkdf2.Digest.doFinal.

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

Parameters
out:byte[]

the array the digest is to be copied into.

outOff:int

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

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Digest.getAlgorithmName.

Doc from com.ongres.scram.common.bouncycastle.pbkdf2.Digest.getAlgorithmName.

return the algorithm name

Returns:String

the algorithm name

getDigestSizeback to summary
public int getDigestSize()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Digest.getDigestSize.

Doc from com.ongres.scram.common.bouncycastle.pbkdf2.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.

getEncodedStateback to summary
public byte[] getEncodedState()

Implements com.ongres.scram.common.bouncycastle.pbkdf2.EncodableDigest.getEncodedState.

Doc from com.ongres.scram.common.bouncycastle.pbkdf2.EncodableDigest.getEncodedState.

Return an encoded byte array for the digest's internal state

Returns:byte[]

an encoding of the digests internal state.

Majback to summary
private int Maj(int x, int y, int z)
processBlockback to summary
protected void processBlock()

Implements abstract com.ongres.scram.common.bouncycastle.pbkdf2.GeneralDigest.processBlock.

processLengthback to summary
protected void processLength(long bitLength)

Implements abstract com.ongres.scram.common.bouncycastle.pbkdf2.GeneralDigest.processLength.

processWordback to summary
protected void processWord(byte[] in, int inOff)

Implements abstract com.ongres.scram.common.bouncycastle.pbkdf2.GeneralDigest.processWord.

resetback to summary
public void reset()

Overrides com.ongres.scram.common.bouncycastle.pbkdf2.GeneralDigest.reset.

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Digest.reset.

reset the chaining variables

resetback to summary
public void reset(Memoable other)

Implements com.ongres.scram.common.bouncycastle.pbkdf2.Memoable.reset.

Doc from com.ongres.scram.common.bouncycastle.pbkdf2.Memoable.reset.

Restore a copied object state into this object.

Implementations of this method should try to avoid or minimise memory allocation to perform the reset.

Parameters
other:Memoable

an object originally copied from an object of the same type as this instance.

Sum0back to summary
private int Sum0(int x)
Sum1back to summary
private int Sum1(int x)
Theta0back to summary
private int Theta0(int x)
Theta1back to summary
private int Theta1(int x)