@Test public void testVector20() { final HmacKeyDerivationFunction hkdf = new HmacKeyDerivationFunction(HmacKeyDerivationFunction.HDFK_SHA512, new byte[1]); final byte[] inputBytes = hkdf.createKey(new byte[] { 2, 1, 0 }, 1075); final PointHasher pointHasher = EcCurve.secp384r1.getPointHasher(); EcPoint result = pointHasher.hashToCurve(inputBytes, new byte[] { 10, 20, 30, 40, 50, 60, 70, 80 }); System.out.println("Test Vector Point: " + result); EcPoint expected = new EcPoint( "18472326435799297199540918736210996374391000234188481509606224682026951428999829341873918979570524072852674044990837", "36015316563939518710695405243428908234052604837304134581248705816046899659694854481403243019452630718198370632515308"); Assert.assertEquals(expected, result); }
public EcPoint hashToCurve(final String input) { return this.hashToCurve(input.getBytes(StandardCharsets.UTF_8), null); }
PointHasher { public EcPoint hashToCurve(final String input) { return this.hashToCurve(input.getBytes(StandardCharsets.UTF_8), null); } }
PointHasher { public EcPoint hashToCurve(final String input) { return this.hashToCurve(input.getBytes(StandardCharsets.UTF_8), null); } PointHasher(EcCurve curve); }
PointHasher { public EcPoint hashToCurve(final String input) { return this.hashToCurve(input.getBytes(StandardCharsets.UTF_8), null); } PointHasher(EcCurve curve); BigInteger squareRoot(BigInteger a); EcPoint hashToCurve(final String input); EcPoint hashToCurve(final String input, final byte[] clientSecret); EcPoint hashToCurve(final byte[] input); EcPoint hashToCurve(final byte[] input, final byte[] clientSecret); abstract EcPoint createPointFromInteger(BigInteger t); }
PointHasher { public EcPoint hashToCurve(final String input) { return this.hashToCurve(input.getBytes(StandardCharsets.UTF_8), null); } PointHasher(EcCurve curve); BigInteger squareRoot(BigInteger a); EcPoint hashToCurve(final String input); EcPoint hashToCurve(final String input, final byte[] clientSecret); EcPoint hashToCurve(final byte[] input); EcPoint hashToCurve(final byte[] input, final byte[] clientSecret); abstract EcPoint createPointFromInteger(BigInteger t); static final BigInteger TWO; static final BigInteger THREE; static final BigInteger FOUR; }