smuellerDD/acvpparser

Safe primes response not generated (Null json.partial file )

shilpa-1992 opened this issue · 13 comments

Hello Team,

I have tried to acvp-parserto run request for safe primes. (safePrimes_keyGen (response.json file not gererated)
safePrimes_keyVer (response.json file not gererated).

I have made few modification to backend_openssl.c for the build.
Could you please clarify me the code part which takes the call for safeprimes ( code part necessary for the response generation of safe prime).

Regards,

/*
* TODO change to
* BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn);
* BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn);
* BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
* BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
* BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
*/
Could you please let me know the relevance of this code part.

Regards,

ACVPParser (23:29:56) Error: DSA_generate_key() failed
ACVPParser (23:29:56) Error: Test execution failed
ACVPParser (23:29:56) Error: Parsing processdata failed

Above log is observed while running testvector-request for
"algorithm": "safePrimes",
"mode": "keyGen",
"revision": "1.0",

Any clue what might have caused the failure.
testvector-response.json is with partial output

same time the test vector for
"algorithm": "safePrimes",
"mode": "keyVer",
"revision": "1.0", Generated the response file.

Regards,

In my openssl APIs making the safeprimes directly accessible instead of adding the PQG values .
so i have enabled the below code part

       BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn);
       BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn);
       BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
       BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
       BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);

Please let me know what all are the changes need to make in code to the values from bn above.

It is not clear to me , could you please explain a bit more.
which all files needs modification ? Is the modification is required only for openssl_dh_set_param (backend_openssl.c ) .
where to replace the call to the parser-internal safeprime (could you please mention those function call ) calls ?

"-> get p, g, q from the OpenSSL API " with below code part will that happen or am i missing somthing ( do i need to add something more here)

      BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn);
      BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn);
      BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
      BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
      BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
            struct safeprimes *p_safeprime;

            CKINT(acvp_safeprime_get(safeprime, &p_safeprime));

            CKINT_O0(BN_hex2bn(&p, p_safeprime->p));
            CKINT_O0(BN_hex2bn(&q, p_safeprime->q));
            CKINT_O0(BN_hex2bn(&g, p_safeprime->g));

For the same test vector i have run more than once and i could see that the ephemeralPublicIutX ,ephemeralPublicIutY and z is different , is that the expected . Any clue, what might have caused this.