@Test
  public void testEcdsa() throws Exception {
    ECParameterSpec ecParams = EllipticCurves.getNistP256Params();
    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("EC");
    keyGen.initialize(ecParams);
    KeyPair keyPair = keyGen.generateKeyPair();
    ECPublicKey pub = (ECPublicKey) keyPair.getPublic();
    ECPrivateKey priv = (ECPrivateKey) keyPair.getPrivate();
    EcdsaSignJce signer = new EcdsaSignJce(priv, HashType.SHA256, EcdsaEncoding.DER);
    EcdsaVerifyJce verifier = new EcdsaVerifyJce(pub, HashType.SHA256, EcdsaEncoding.DER);

    byte[] msg = Random.randBytes(20);
    testSigningSameMessage(signer, verifier, false, msg, 5, 20);
    testSigningDistinctMessages(signer, verifier, false, 64, 5, 20);
  }
Sign the same message concurrently in multiple threads. The purpose of this test is to find
non-deterministic signatures schemes, that reuse nonces when signing concurrently.
java_src/src/test/java/com/google/crypto/tink/subtle/SignatureThreadSafetyTest.java