@Test public void testVector10() { final HmacKeyDerivationFunction hkdf = new HmacKeyDerivationFunction(HmacKeyDerivationFunction.HDFK_SHA512, new byte[0]); final byte[] inputBytes = hkdf.createKey(new byte[] { 0, 1, 2 }, 4096); final PointHasher pointHasher = EcCurve.secp256r1.getPointHasher(); EcPoint result = pointHasher.hashToCurve(inputBytes); System.out.println("Test Vector Point: " + result); EcPoint expected = new EcPoint( "11039227954369684306746808884983317744276427225717600742461221298580750897006", "36016287457661471590508534387087399559446866035089773400149980103149827256280"); 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; }