|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javacard.security.Checksum com.licel.jcardsim.crypto.CRC16
public class CRC16
Field Summary |
---|
Fields inherited from class javacard.security.Checksum |
---|
ALG_ISO3309_CRC16, ALG_ISO3309_CRC32 |
Constructor Summary | |
---|---|
CRC16()
|
Method Summary | |
---|---|
short |
doFinal(byte[] inBuff,
short inOffset,
short inLength,
byte[] outBuff,
short outOffset)
Generates a CRC checksum of all/last input data. |
byte |
getAlgorithm()
Gets the Checksum algorithm. |
void |
init(byte[] bArray,
short bOff,
short bLen)
Resets and initializes the Checksum object with the algorithm specific
Note:
The ALG_ISO3309_CRC16 algorithm expects 2 bytes of parameter information in
bArray representing the initial checksum value. |
void |
update(byte[] inBuff,
short inOffset,
short inLength)
Accumulates a partial checksum of the input data. |
Methods inherited from class javacard.security.Checksum |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CRC16()
Method Detail |
---|
public byte getAlgorithm()
Checksum
Checksum.ALG_ISO3309_CRC16
getAlgorithm
in class Checksum
public void init(byte[] bArray, short bOff, short bLen) throws CryptoException
Checksum
Checksum
object with the algorithm specific
Note:
bArray
representing the initial checksum value.
bArray
representing the initial checksum value.
bArray
- byte array containing algorithm specific initialization informationbOff
- offset within bArray
where the algorithm specific data beginsbLen
- byte length of algorithm specific parameter data.
CryptoException
- with the following reason codes:
CryptoException.ILLEGAL_VALUE
if a byte array parameter option is not supported by the algorithm or if
the bLen
is an incorrect byte length for the algorithm specific data.
public short doFinal(byte[] inBuff, short inOffset, short inLength, byte[] outBuff, short outOffset)
Checksum
inOffset
and continuing on until the
byte at (inOffset+inLength-1)
of the inBuff
array. Within
each byte the processing proceeds from the least significant bit to the most.
Completes and returns the checksum computation.
The Checksum
object is reset to the initial state(state upon construction)
when this method completes.
Note:
Checksum.init(byte[], short, short)
method.
The input and output buffer data may overlap.
inBuff
- the input buffer of data to be checksummedinOffset
- the offset into the input buffer at which to begin checksum generationinLength
- the byte length to checksumoutBuff
- the output buffer, may be the same as the input bufferoutOffset
- the offset into the output buffer where the resulting checksum value begins
outBuff
public void update(byte[] inBuff, short inOffset, short inLength)
Checksum
inOffset
and continuing on until the
byte at (inOffset+inLength-1)
of the inBuff
array. Within
each byte the processing proceeds from the least significant bit to the most.
This method requires temporary storage of intermediate results.
This may result in additional resource consumption and/or slow performance.
This method should only be used if all the input data required for the checksum
is not available in one byte array. The Checksum.html#doFinal(byte[], short, short, byte[], short)
doFinal(byte[], short, short, byte[], short)
method is recommended whenever possible.
Note:
inLength
is 0 this method does nothing.
inBuff
- the input buffer of data to be checksummedinOffset
- the offset into the input buffer at which to begin checksum generationinLength
- the byte length to checksumChecksum.doFinal(byte[], short, short, byte[], short)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |