Top Description Fields Constructors Methods
org.python.modules

public Class SHA224Digest

extends MessageDigest
Class Inheritance
Annotations
@Deprecated
Imports
java.security.MessageDigest

Deprecated

use the SHA224 implementation provided in Java 8 and later

SHA-224 as described in RFC 3874. This introduces the SHA224 Digest which has been omitted from the JDK java.security.

This implementation has been borrowed from the Bouncy Castle implementation of SHA2 algorithms.

Since they are MIT Licensed, they are compatible with this project. Their mandatory copyright notice follows.

Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle
(http://www.bouncycastle.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Field Summary

Modifier and TypeField and Description
private static final int
private long
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 byte[]
private int
private int

Constructor Summary

AccessConstructor and Description
public
SHA224Digest()

Standard constructor

public
SHA224Digest(SHA224Digest t)
References Deprecated SHA224Digest is deprecated or references (maybe indirectly) at least one deprecated element.

Copy constructor.

Method Summary

Modifier and TypeMethod and Description
public static int
bigEndianToInt(byte[] bs, int off)

public static long
bigEndianToLong(byte[] bs, int off)

private int
Ch(int x, int y, int z)

public Object
clone()

Overrides java.security.MessageDigest.clone.

Returns a clone if the implementation is cloneable.

public int
doFinal(byte[] out, int outOff)

protected byte[]
engineDigest()

Implements abstract java.security.MessageDigestSpi.engineDigest.

Completes the hash computation by performing final operations such as padding.

protected void
engineReset()

Implements abstract java.security.MessageDigestSpi.engineReset.

Resets the digest for further use.

protected void
engineUpdate(byte
the byte to use for the update.
input
)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified byte.

protected void
engineUpdate(byte[]
the array of bytes to use for the update.
input
,
int
the offset to start from in the array of bytes.
offset
,
int
the number of bytes to use, starting at offset.
len
)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified array of bytes, starting at the specified offset.

public void
public String
public int
public int
public static void
intToBigEndian(int n, byte[] bs, int off)

public static void
longToBigEndian(long n, byte[] bs, int off)

private int
Maj(int x, int y, int z)

protected void
protected void
processLength(long bitLength)

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

public void
reset()

Overrides java.security.MessageDigest.reset.

Resets the digest for further use.

private int
Sum0(int x)

private int
Sum1(int x)

private int
Theta0(int x)

private int
Theta1(int x)

public void
update(byte
the byte with which to update the digest.
in
)

Overrides java.security.MessageDigest.update.

Updates the digest using the specified byte.

public void
update(byte[]
the array of bytes.
in
,
int
the offset to start from in the array of bytes.
inOff
,
int
the number of bytes to use, starting at offset.
len
)

Overrides java.security.MessageDigest.update.

Updates the digest using the specified array of bytes, starting at the specified offset.

Inherited from java.security.MessageDigest:
digestdigestdigestgetAlgorithmgetDigestLengthgetInstancegetInstancegetInstancegetProviderisEqualtoStringupdateupdate

Field Detail

BYTE_LENGTHback to summary
private static final int BYTE_LENGTH
byteCountback to summary
private long byteCount
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
xBufback to summary
private byte[] xBuf
xBufOffback to summary
private int xBufOff
xOffback to summary
private int xOff

Constructor Detail

SHA224Digestback to summary
public SHA224Digest()

Standard constructor

SHA224Digestback to summary
public SHA224Digest(SHA224Digest t)

References Deprecated

SHA224Digest is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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

Method Detail

bigEndianToIntback to summary
public static int bigEndianToInt(byte[] bs, int off)
bigEndianToLongback to summary
public static long bigEndianToLong(byte[] bs, int off)
Chback to summary
private int Ch(int x, int y, int z)
cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.security.MessageDigest.clone.

Doc from java.security.MessageDigest.clone.

Returns a clone if the implementation is cloneable.

Returns:Object

a clone if the implementation is cloneable.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if this is called on an implementation that does not support Cloneable.

doFinalback to summary
public int doFinal(byte[] out, int outOff)
engineDigestback to summary
protected byte[] engineDigest()

Implements abstract java.security.MessageDigestSpi.engineDigest.

Doc from java.security.MessageDigestSpi.engineDigest.

Completes the hash computation by performing final operations such as padding. Once engineDigest has been called, the engine should be reset (see engineReset). Resetting is the responsibility of the engine implementor.

Returns:byte[]

the array of bytes for the resulting hash value.

Annotations
@Override

engineResetback to summary
protected void engineReset()

Implements abstract java.security.MessageDigestSpi.engineReset.

Doc from java.security.MessageDigestSpi.engineReset.

Resets the digest for further use.

Annotations
@Override
engineUpdateback to summary
protected void engineUpdate(byte input)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Doc from java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified byte.

Parameters
input:byte

the byte to use for the update.

Annotations
@Override
engineUpdateback to summary
protected void engineUpdate(byte[] input, int offset, int len)

Implements abstract java.security.MessageDigestSpi.engineUpdate.

Doc from java.security.MessageDigestSpi.engineUpdate.

Updates the digest using the specified array of bytes, starting at the specified offset.

Parameters
input:byte[]

the array of bytes to use for the update.

offset:int

the offset to start from in the array of bytes.

len:int

the number of bytes to use, starting at offset.

Annotations
@Override
finishback to summary
public void finish()
getAlgorithmNameback to summary
public String getAlgorithmName()
getByteLengthback to summary
public int getByteLength()
getDigestSizeback to summary
public int getDigestSize()
intToBigEndianback to summary
public static void intToBigEndian(int n, byte[] bs, int off)
longToBigEndianback to summary
public static void longToBigEndian(long n, byte[] bs, int off)
Majback to summary
private int Maj(int x, int y, int z)
processBlockback to summary
protected void processBlock()
processLengthback to summary
protected void processLength(long bitLength)
processWordback to summary
protected void processWord(byte[] in, int inOff)
resetback to summary
public void reset()

Overrides java.security.MessageDigest.reset.

Doc from java.security.MessageDigest.reset.

Resets the digest for further use.

Annotations
@Override
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)
updateback to summary
public void update(byte in)

Overrides java.security.MessageDigest.update.

Doc from java.security.MessageDigest.update.

Updates the digest using the specified byte.

Parameters
in:byte

the byte with which to update the digest.

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

Overrides java.security.MessageDigest.update.

Doc from java.security.MessageDigest.update.

Updates the digest using the specified array of bytes, starting at the specified offset.

Parameters
in:byte[]

the array of bytes.

inOff:int

the offset to start from in the array of bytes.

len:int

the number of bytes to use, starting at offset.

Annotations
@Override