public final class HMAC256Generator extends HMACGenerator
_available
コンストラクタ | 説明 |
---|---|
HMAC256Generator(I2PAppContext context) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
protected I2PHMac |
acquire() |
推奨されていません。
unused (not even by Syndie)
|
Hash |
calculate(SessionKey key,
byte[] data) |
推奨されていません。
unused (not even by Syndie)
|
void |
calculate(SessionKey key,
byte[] data,
int offset,
int length,
byte[] target,
int targetOffset) |
Calculate the HMAC of the data with the given key.
|
boolean |
verify(SessionKey key,
byte[] curData,
int curOffset,
int curLength,
byte[] origMAC,
int origMACOffset,
int origMACLength) |
Verify the MAC inline, reducing some unnecessary memory churn.
|
acquireTmp, releaseTmp
public HMAC256Generator(I2PAppContext context)
context
- unusedprotected I2PHMac acquire()
acquire
クラス内 HMACGenerator
java.lang.UnsupportedOperationException
- since 0.9.12public Hash calculate(SessionKey key, byte[] data)
calculate
クラス内 HMACGenerator
java.lang.UnsupportedOperationException
- alwayspublic void calculate(SessionKey key, byte[] data, int offset, int length, byte[] target, int targetOffset)
calculate
クラス内 HMACGenerator
target
- out parameter the first 16 bytes contain the HMAC, the last 16 bytes are zerotargetOffset
- offset into target to put the hmacjava.lang.UnsupportedOperationException
- if the JVM does not support itjava.lang.IllegalArgumentException
- for bad key or target too smallpublic boolean verify(SessionKey key, byte[] curData, int curOffset, int curLength, byte[] origMAC, int origMACOffset, int origMACLength)
verify
クラス内 HMACGenerator
key
- session key to verify the MAC withcurData
- MAC to verifycurOffset
- index into curData to MACcurLength
- how much data in curData do we want to run the HMAC overorigMAC
- what do we expect the MAC of curData to equalorigMACOffset
- index into origMACorigMACLength
- how much of the MAC do we want to verify, use 32 for HMAC256