You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the Java Card 3.0.5 API, the keyLength parameter passed to the KeyBuilder.buildKey method is the key size in bits.
In the KeyBuilder tests configs, the key sizes are specified in bytes for TYPE_HMAC keys (64/128) which leads to incorrect results:
see JCAlgTest/AlgTest_JClient/src/algtestjclient/SingleModeTest.java:
KEYBUILDER_TEST_CFGS.put("TYPE_HMAC_TRANSIENT_RESET#2.2.2", new KBTestCfg(JCConsts.KeyBuilder_TYPE_HMAC_TRANSIENT_RESET, (short) 64));
KEYBUILDER_TEST_CFGS.put("TYPE_HMAC_TRANSIENT_DESELECT#2.2.2", new KBTestCfg(JCConsts.KeyBuilder_TYPE_HMAC_TRANSIENT_DESELECT, (short) 64));
KEYBUILDER_TEST_CFGS.put("TYPE_HMAC LENGTH_HMAC_SHA_1_BLOCK_64#2.2.2", new KBTestCfg(JCConsts.KeyBuilder_TYPE_HMAC, (short) 64));
KEYBUILDER_TEST_CFGS.put("TYPE_HMAC LENGTH_HMAC_SHA_256_BLOCK_64#2.2.2", new KBTestCfg(JCConsts.KeyBuilder_TYPE_HMAC, (short) 64));
KEYBUILDER_TEST_CFGS.put("TYPE_HMAC LENGTH_HMAC_SHA_384_BLOCK_64#2.2.2", new KBTestCfg(JCConsts.KeyBuilder_TYPE_HMAC, (short) 128));
KEYBUILDER_TEST_CFGS.put("TYPE_HMAC LENGTH_HMAC_SHA_512_BLOCK_64#2.2.2", new KBTestCfg(JCConsts.KeyBuilder_TYPE_HMAC, (short) 128));
The text was updated successfully, but these errors were encountered:
nc-adnan
changed the title
Incorrect key length in KeyBuilder tests with TYPE_HMAC keys
Incorrect key length used in KeyBuilder tests with TYPE_HMAC keys
Feb 14, 2023
Thank you @nc-adnan for reporting, it will take longer to fix this issue due to need for re-measurement of existing results for these six values. So I'm leaving the issue open for now.
According to the Java Card 3.0.5 API, the
keyLength
parameter passed to theKeyBuilder.buildKey
method is the key size in bits.In the KeyBuilder tests configs, the key sizes are specified in bytes for
TYPE_HMAC
keys (64/128) which leads to incorrect results:see JCAlgTest/AlgTest_JClient/src/algtestjclient/SingleModeTest.java:
The text was updated successfully, but these errors were encountered: