@Test public void testVector26() { 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.secp521r1.getPointHasher(); EcPoint result = pointHasher.hashToCurve(inputBytes); System.out.println("Test Vector Point: " + result); EcPoint expected = new EcPoint( "6637700257754665590564945745229128177714476830594010797342647503072236721750820446208564359250646631193691178633006744780460946014010326706138578765770702899", "4753983695885564962207201996196774516739708536137737835837298240909635858516954081526626337766420596488749975714290697655337755136291881229840237401694181151"); 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; }