public final class HKDF extends Object
Constructor and Description |
---|
HKDF(I2PAppContext context)
Thread safe, no state, can be reused
|
Modifier and Type | Method and Description |
---|---|
void |
calculate(byte[] key,
byte[] data,
byte[] out)
One output, no info.
|
void |
calculate(byte[] key,
byte[] data,
byte[] out,
byte[] out2,
int off2)
Two outputs, no info.
|
void |
calculate(byte[] key,
byte[] data,
String info,
byte[] out)
One output with info.
|
void |
calculate(byte[] key,
byte[] data,
String info,
byte[] out,
byte[] out2,
int off2)
Two outputs with info.
|
public HKDF(I2PAppContext context)
public void calculate(byte[] key, byte[] data, byte[] out)
key
- first 32 bytes used as the keyout
- must be exactly 32 bytespublic void calculate(byte[] key, byte[] data, String info, byte[] out)
key
- first 32 bytes used as the keyinfo
- non-null ASCII, "" if noneout
- must be exactly 32 bytespublic void calculate(byte[] key, byte[] data, byte[] out, byte[] out2, int off2)
key
- first 32 bytes used as the keyout
- 32 bytes will be copied to hereout2
- 32 bytes will be copied to here, may be the same as outoff2
- offset for copy to out2public void calculate(byte[] key, byte[] data, String info, byte[] out, byte[] out2, int off2)
key
- first 32 bytes used as the keyinfo
- non-null ASCII, "" if noneout
- 32 bytes will be copied to hereout2
- 32 bytes will be copied to here, may be the same as outoff2
- offset for copy to out2