smuellerDD / acvpparser

ACVP Parser for invocation of cryptographic implementations using the ACVP JSON test vectors
https://www.chronox.de/acvpparser
Other
36 stars 27 forks source link

RSA KeyGen parse bitlens Issues #59

Closed yangjinlin01 closed 1 year ago

yangjinlin01 commented 1 year ago

My test vector is: "algorithm": "RSA", "mode": "keyGen", "revision": "FIPS186-4", "isSample": true, "testGroups": [ { "tgId": 1, "infoGeneratedByServer": true, "modulo": 2048, "testType": "AFT", "keyFormat": "standard", "primeTest": "tblC2", "randPQ": "B.3.6", "pubExp": "random", "tests": [ { "tcId": 1, "bitlens": [ 499, 241, 345, 374 ], "xP:".."", "xQ": "..", "xP1": "..", "xP2": "..", "xQ1": "..", "xQ2": "..", "e": ".." } I want parse bitlens,xP,xQ and send to openssl_rsa_keygen. Now, i have add code : /{"bitlens",..................................................................................................},/ {"e", {.data.buf = &rsa_keygen_vector.e, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT| FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, {"xP", {.data.buf = &rsa_keygen_vector.xp, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT| FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, {"xP1", {.data.buf = &rsa_keygen_vector.xp1, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT | FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, {"xP2", {.data.buf = &rsa_keygen_vector.xp2, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT | FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, {"xQ", {.data.buf = &rsa_keygen_vector.xq, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT| FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, {"xQ1", {.data.buf = &rsa_keygen_vector.xq1, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT | FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, {"xQ2", {.data.buf = &rsa_keygen_vector.xq2, PARSER_BIN}, FLAG_OP_ASYM_TYPE_KEYGEN | FLAG_OP_AFT | FLAG_OP_RSA_PQ_B36_PRIMES | FLAG_OP_RSA_CRT}, }; for empty arrays */ const struct json_array rsa_keygen_test = SET_ARRAY(rsa_keygen_test_entries, &rsa_keygen_testresult); I have xP, xQ etc correct to openssl_rsa_keygen,but how to parse bitlens to rsa_keygen_vector.bitlen? Thanks!

yangjinlin01 commented 1 year ago

i have sovle it .

yangjinlin01 commented 1 year ago

i have sovle it .