Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8369427

ACVP 1.1.0.40 is available

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 24
    • security-libs
    • None

      The ML-KEM-encapDecap-FIPS203 format is updated in 1.1.0.40. See https://github.com/usnistgov/ACVP-Server/releases.

      Two new functions are added: "encapsulationKeyCheck" and "decapsulationKeyCheck". Just create an encapsulator or decapsulator with the given key and see if an exception is thrown and compare the result to the "testPassed" field.

      Also, for the "decapsulation" function, "ek" and "dk" are put inside every test case instead of in the test group.

      The following code change is needed:

      diff --git a/test/jdk/sun/security/provider/acvp/ML_KEM_Test.java b/test/jdk/sun/security/provider/acvp/ML_KEM_Test.java
      index c46c6a99e6d..ec47efdc711 100644
      --- a/test/jdk/sun/security/provider/acvp/ML_KEM_Test.java
      +++ b/test/jdk/sun/security/provider/acvp/ML_KEM_Test.java
      @@ -103,18 +103,54 @@ static void encapDecapTest(JSONValue kat, Provider p) throws Exception {
                       }
                       System.out.println();
                   } else if (function.equals("decapsulation")) {
      - var dk = new PrivateKey() {
      - public String getAlgorithm() { return pname; }
      - public String getFormat() { return "RAW"; }
      - public byte[] getEncoded() { return toByteArray(t.get("dk").asString()); }
      - };
                       for (var c : t.get("tests").asArray()) {
      + var dk = new PrivateKey() {
      + public String getAlgorithm() { return pname; }
      + public String getFormat() { return "RAW"; }
      + public byte[] getEncoded() { return toByteArray(c.get("dk").asString()); }
      + };
                           System.out.print(c.get("tcId").asString() + " ");
                           var d = g.newDecapsulator(dk);
                           var k = d.decapsulate(toByteArray(c.get("c").asString()));
                           Asserts.assertEqualsByteArray(toByteArray(c.get("k").asString()), k.getEncoded());
                       }
                       System.out.println();
      + } else if (function.equals("decapsulationKeyCheck")) {
      + for (var c : t.get("tests").asArray()) {
      + var dk = new PrivateKey() {
      + public String getAlgorithm() { return pname; }
      + public String getFormat() { return "RAW"; }
      + public byte[] getEncoded() { return toByteArray(c.get("dk").asString()); }
      + };
      + System.out.print(c.get("tcId").asString() + " ");
      + String actual = "true";
      + try {
      + g.newDecapsulator(dk);
      + } catch (Exception e) {
      + actual = "false";
      + }
      + Asserts.assertEquals(c.get("testPassed").asString(), actual);
      + }
      + System.out.println();
      + } else if (function.equals("encapsulationKeyCheck")) {
      + for (var c : t.get("tests").asArray()) {
      + var ek = new PublicKey() {
      + public String getAlgorithm() { return pname; }
      + public String getFormat() { return "RAW"; }
      + public byte[] getEncoded() { return toByteArray(c.get("ek").asString()); }
      + };
      + System.out.print(c.get("tcId").asString() + " ");
      + String actual = "true";
      + try {
      + g.newEncapsulator(ek);
      + } catch (Exception e) {
      + actual = "false";
      + }
      + Asserts.assertEquals(c.get("testPassed").asString(), actual);
      + }
      + System.out.println();
      + } else {
      + throw new UnsupportedOperationException("Unknown function: " + function);
                   }
               }
           }

            Unassigned Unassigned
            weijun Weijun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: