@Test public void testComputePrf_rfc589vector1() throws Exception { HashType hash = HashType.SHA256; byte[] ikm = Hex.decode("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"); byte[] salt = Hex.decode("000102030405060708090a0b0c"); byte[] info = Hex.decode("f0f1f2f3f4f5f6f7f8f9"); byte[] expectedResult = Hex.decode( "3cb25f25faacd57a90434f64d0362f2a" + "2d2d0a90cf1a5a4c5db02d56ecc4c5bf" + "34007208d5b887185865"); HkdfStreamingPrf prf = new HkdfStreamingPrf(hash, ikm, salt); InputStream input = prf.computePrf(info); byte[] output = new byte[expectedResult.length]; assertThat(input.read(output)).isEqualTo(expectedResult.length); assertThat(output).isEqualTo(expectedResult); }
@Override public InputStream computePrf(final byte[] input) { return new HkdfInputStream(input); }
HkdfStreamingPrf implements StreamingPrf { @Override public InputStream computePrf(final byte[] input) { return new HkdfInputStream(input); } }
HkdfStreamingPrf implements StreamingPrf { @Override public InputStream computePrf(final byte[] input) { return new HkdfInputStream(input); } HkdfStreamingPrf(final HashType hashType, final byte[] ikm, final byte[] salt); }
HkdfStreamingPrf implements StreamingPrf { @Override public InputStream computePrf(final byte[] input) { return new HkdfInputStream(input); } HkdfStreamingPrf(final HashType hashType, final byte[] ikm, final byte[] salt); @Override InputStream computePrf(final byte[] input); }
HkdfStreamingPrf implements StreamingPrf { @Override public InputStream computePrf(final byte[] input) { return new HkdfInputStream(input); } HkdfStreamingPrf(final HashType hashType, final byte[] ikm, final byte[] salt); @Override InputStream computePrf(final byte[] input);  }