808bits

IBM opencryptoki

read from source · 182 mechanisms observed · 3.27.0 development · CPL-1.0 · read at 430a47d, 2026-09-09

opencryptoki is the PKCS#11 stack on IBM Z and on any Linux that wants IBM’s crypto cards, and it ships a software token that needs no hardware at all. It is also the one library here that would not run for me. The front library talks to a daemon over shared memory, and without that daemon the first call fails in a way the specification would call recoverable and the reader will call the end of the road.

No daemon, no library

I built the current source with only the software token enabled and loaded libopencryptoki.so with the same read-only probe as the other pages. C_Initialize returned CKR_FUNCTION_FAILED. The library expects the pkcsslotd daemon to be running, root-owned and installed system-wide, and reports its absence with the code the specification reserves for a failure that leaves the library usable. Nothing is usable. So on this stack that code from C_Initialize means “start the daemon”, and the token-specific reasons come later.

The workhorse code

Across the shared code and the software token, return CKR_FUNCTION_FAILED appears 473 times, against 683 for success. The next most common are CKR_ATTRIBUTE_VALUE_INVALID at 145 and CKR_HOST_MEMORY at 126. The OpenSSL backend alone has 232 mentions of the function-failed code, one for nearly every OpenSSL call that can return an error, so a crypto failure of any kind arrives as this one value with the detail in the trace log. That is the opposite choice from SoftHSMv2, which reports the same failures as the general error, and a test suite that passes on one will see different codes on the other.

The table the probe could not read

The software token’s mechanism list is a static table in soft_specific.c, 182 entries with key size ranges and flags, nineteen of them behind build-time conditions such as the DSA and MD2 switches. That is what the table below is read from, since the daemon could not be run here. Fourteen entries are IBM’s own, in the vendor range: SHA-3 digests and HMACs under CKM_IBM_ names, and post-quantum ML-KEM, ML-DSA and Dilithium. The 3.2 specification now has standard numbers for ML-KEM and ML-DSA, and this table still lists them at IBM’s, which is the usual sequence when a vendor ships before the standard.

Mechanisms the token's own table lists

Read from the static mechanism table in the library's source rather than from a running library, because this one will not initialise without its daemon. It carries the same three facts a live probe reports, the mechanism, its key size range and the operations it is good for, and 19 of its entries sit behind build-time conditions, so a given build may list fewer. The same rows sit beside every other library's on the mechanism table.

182 mechanisms, 14 of them vendor-defined. 0 set CKF_HW, which claims the operation is done in hardware.

MechanismHexKeysOperations
CKM_RSA_PKCS_KEY_PAIR_GEN0x00000000512–16384generate_key_pair
CKM_RSA_PKCS0x00000001512–16384encrypt, decrypt, wrap, unwrap, sign, verify, sign_recover, verify_recover, encapsulate, decapsulate
CKM_RSA_X_5090x00000003512–16384encrypt, decrypt, wrap, unwrap, sign, verify, sign_recover, verify_recover
CKM_MD2_RSA_PKCS0x00000004512–16384sign, verify
CKM_MD5_RSA_PKCS0x00000005512–16384sign, verify
CKM_SHA1_RSA_PKCS0x00000006512–16384sign, verify
CKM_RSA_PKCS_OAEP0x00000009512–16384encrypt, decrypt, wrap, unwrap, encapsulate, decapsulate
CKM_RSA_PKCS_PSS0x0000000D512–16384sign, verify
CKM_SHA1_RSA_PKCS_PSS0x0000000E512–16384sign, verify
CKM_ML_KEM_KEY_PAIR_GEN0x0000000F800–1568generate_key_pair
CKM_DSA_KEY_PAIR_GEN0x00000010512–1024generate_key_pair
CKM_DSA0x00000011512–1024sign, verify
CKM_ML_KEM0x00000017800–1568encapsulate, decapsulate
CKM_ML_DSA_KEY_PAIR_GEN0x0000001C1312–2592generate_key_pair
CKM_ML_DSA0x0000001D1312–2592sign, verify
CKM_HASH_ML_DSA0x0000001F1312–2592sign, verify
CKM_DH_PKCS_KEY_PAIR_GEN0x00000020512–8192generate_key_pair
CKM_DH_PKCS_DERIVE0x00000021512–8192derive, encapsulate, decapsulate
CKM_HASH_ML_DSA_SHA2240x000000231312–2592sign, verify
CKM_HASH_ML_DSA_SHA2560x000000241312–2592sign, verify
CKM_HASH_ML_DSA_SHA3840x000000251312–2592sign, verify
CKM_HASH_ML_DSA_SHA5120x000000261312–2592sign, verify
CKM_HASH_ML_DSA_SHA3_2240x000000271312–2592sign, verify
CKM_HASH_ML_DSA_SHA3_2560x000000281312–2592sign, verify
CKM_HASH_ML_DSA_SHA3_3840x000000291312–2592sign, verify
CKM_HASH_ML_DSA_SHA3_5120x0000002A1312–2592sign, verify
CKM_HASH_ML_DSA_SHAKE1280x0000002B1312–2592sign, verify
CKM_HASH_ML_DSA_SHAKE2560x0000002C1312–2592sign, verify
CKM_SHA256_RSA_PKCS0x00000040512–16384sign, verify
CKM_SHA384_RSA_PKCS0x00000041512–16384sign, verify
CKM_SHA512_RSA_PKCS0x00000042512–16384sign, verify
CKM_SHA256_RSA_PKCS_PSS0x00000043512–16384sign, verify
CKM_SHA384_RSA_PKCS_PSS0x00000044512–16384sign, verify
CKM_SHA512_RSA_PKCS_PSS0x00000045512–16384sign, verify
CKM_SHA224_RSA_PKCS0x00000046512–16384sign, verify
CKM_SHA224_RSA_PKCS_PSS0x00000047512–16384sign, verify
CKM_SHA512_2240x00000048-digest
CKM_SHA512_224_HMAC0x00000049112–2048sign, verify
CKM_SHA512_224_HMAC_GENERAL0x0000004A112–2048sign, verify
CKM_SHA512_224_KEY_DERIVATION0x0000004B8–224derive
CKM_SHA512_2560x0000004C-digest
CKM_SHA512_256_HMAC0x0000004D128–2048sign, verify
CKM_SHA512_256_HMAC_GENERAL0x0000004E128–2048sign, verify
CKM_SHA512_256_KEY_DERIVATION0x0000004F8–256derive
CKM_SHA3_256_RSA_PKCS0x00000060512–16384sign, verify
CKM_SHA3_384_RSA_PKCS0x00000061512–16384sign, verify
CKM_SHA3_512_RSA_PKCS0x00000062512–16384sign, verify
CKM_SHA3_256_RSA_PKCS_PSS0x00000063512–16384sign, verify
CKM_SHA3_384_RSA_PKCS_PSS0x00000064512–16384sign, verify
CKM_SHA3_512_RSA_PKCS_PSS0x00000065512–16384sign, verify
CKM_SHA3_224_RSA_PKCS0x00000066512–16384sign, verify
CKM_SHA3_224_RSA_PKCS_PSS0x00000067512–16384sign, verify
CKM_DES_KEY_GEN0x000001208–8generate
CKM_DES_ECB0x000001218–8encrypt, decrypt, wrap, unwrap
CKM_DES_CBC0x000001228–8encrypt, decrypt, wrap, unwrap
CKM_DES_CBC_PAD0x000001258–8encrypt, decrypt, wrap, unwrap
CKM_DES3_KEY_GEN0x0000013124–24generate
CKM_DES3_ECB0x0000013224–24encrypt, decrypt, wrap, unwrap
CKM_DES3_CBC0x0000013324–24encrypt, decrypt, wrap, unwrap
CKM_DES3_MAC0x0000013416–24sign, verify
CKM_DES3_MAC_GENERAL0x0000013516–24sign, verify
CKM_DES3_CBC_PAD0x0000013624–24encrypt, decrypt, wrap, unwrap
CKM_DES3_CMAC_GENERAL0x0000013716–24sign, verify
CKM_DES3_CMAC0x0000013816–24sign, verify
CKM_DES_OFB640x0000015024–24encrypt, decrypt, wrap, unwrap
CKM_DES_CFB640x0000015224–24encrypt, decrypt, wrap, unwrap
CKM_DES_CFB80x0000015324–24encrypt, decrypt, wrap, unwrap
CKM_MD20x00000200-digest
CKM_MD2_HMAC0x000002018–2048sign, verify
CKM_MD2_HMAC_GENERAL0x000002028–2048sign, verify
CKM_MD50x00000210-digest
CKM_MD5_HMAC0x000002118–2048sign, verify
CKM_MD5_HMAC_GENERAL0x000002128–2048sign, verify
CKM_SHA_10x00000220-digest
CKM_SHA_1_HMAC0x0000022180–2048sign, verify
CKM_SHA_1_HMAC_GENERAL0x0000022280–2048sign, verify
CKM_SHA2560x00000250-digest
CKM_SHA256_HMAC0x00000251128–2048sign, verify
CKM_SHA256_HMAC_GENERAL0x00000252128–2048sign, verify
CKM_SHA2240x00000255-digest
CKM_SHA224_HMAC0x00000256112–2048sign, verify
CKM_SHA224_HMAC_GENERAL0x00000257112–2048sign, verify
CKM_SHA3840x00000260-digest
CKM_SHA384_HMAC0x00000261192–2048sign, verify
CKM_SHA384_HMAC_GENERAL0x00000262192–2048sign, verify
CKM_SHA5120x00000270-digest
CKM_SHA512_HMAC0x00000271256–2048sign, verify
CKM_SHA512_HMAC_GENERAL0x00000272256–2048sign, verify
CKM_SHA3_2560x000002B0-digest
CKM_SHA3_256_HMAC0x000002B1128–2048sign, verify
CKM_SHA3_256_HMAC_GENERAL0x000002B2128–2048sign, verify
CKM_SHA3_256_KEY_GEN0x000002B380–2048generate
CKM_SHA3_2240x000002B5-digest
CKM_SHA3_224_HMAC0x000002B6112–2048sign, verify
CKM_SHA3_224_HMAC_GENERAL0x000002B7112–2048sign, verify
CKM_SHA3_224_KEY_GEN0x000002B880–2048generate
CKM_SHA3_3840x000002C0-digest
CKM_SHA3_384_HMAC0x000002C1192–2048sign, verify
CKM_SHA3_384_HMAC_GENERAL0x000002C2192–2048sign, verify
CKM_SHA3_384_KEY_GEN0x000002C380–2048generate
CKM_SHA3_5120x000002D0-digest
CKM_SHA3_512_HMAC0x000002D1256–2048sign, verify
CKM_SHA3_512_HMAC_GENERAL0x000002D2256–2048sign, verify
CKM_SHA3_512_KEY_GEN0x000002D380–2048generate
CKM_GENERIC_SECRET_KEY_GEN0x0000035080–2048generate
CKM_SSL3_PRE_MASTER_KEY_GEN0x0000037048–48generate
CKM_SSL3_MASTER_KEY_DERIVE0x0000037148–48derive
CKM_SSL3_KEY_AND_MAC_DERIVE0x0000037248–48derive
CKM_SSL3_MD5_MAC0x00000380384–384sign, verify
CKM_SSL3_SHA1_MAC0x00000381384–384sign, verify
CKM_SHA1_KEY_DERIVATION0x000003928–160derive
CKM_SHA256_KEY_DERIVATION0x000003938–256derive
CKM_SHA384_KEY_DERIVATION0x000003948–384derive
CKM_SHA512_KEY_DERIVATION0x000003958–512derive
CKM_SHA224_KEY_DERIVATION0x000003968–224derive
CKM_SHA3_256_KEY_DERIVATION0x000003978–256derive
CKM_SHA3_224_KEY_DERIVATION0x000003988–224derive
CKM_SHA3_384_KEY_DERIVATION0x000003998–384derive
CKM_SHA3_512_KEY_DERIVATION0x0000039A8–512derive
CKM_SHAKE_128_KEY_DERIVATION0x0000039B8–2048derive
CKM_SHAKE_256_KEY_DERIVATION0x0000039C8–2048derive
CKM_ECDSA_KEY_PAIR_GEN0x00001040160–521generate_key_pair, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA0x00001041160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA10x00001042160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA2240x00001043160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA2560x00001044160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA3840x00001045160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA5120x00001046160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA3_2240x00001047160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA3_2560x00001048160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA3_3840x00001049160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDSA_SHA3_5120x0000104A160–521sign, verify, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_ECDH1_DERIVE0x00001050160–521derive, ec_oid, ec_f_p, ec_uncompress, ec_compress, encapsulate, decapsulate
CKM_ECDH1_COFACTOR_DERIVE0x00001051160–521derive, ec_oid, ec_f_p, ec_uncompress, ec_compress, encapsulate, decapsulate
CKM_ECDH_AES_KEY_WRAP0x00001053160–521wrap, unwrap, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_RSA_AES_KEY_WRAP0x00001054512–16384wrap, unwrap
CKM_EC_EDWARDS_KEY_PAIR_GEN0x00001055255–448generate_key_pair, ec_oid, ec_f_p, ec_compress
CKM_EC_MONTGOMERY_KEY_PAIR_GEN0x00001056255–448generate_key_pair, ec_oid, ec_f_p, ec_compress
CKM_EDDSA0x00001057255–448sign, verify, ec_oid, ec_f_p, ec_compress
CKM_AES_XTS0x0000107132–64encrypt, decrypt, wrap, unwrap
CKM_AES_XTS_KEY_GEN0x0000107232–64generate
CKM_AES_KEY_GEN0x0000108016–32generate
CKM_AES_ECB0x0000108116–32encrypt, decrypt, wrap, unwrap
CKM_AES_CBC0x0000108216–32encrypt, decrypt, wrap, unwrap
CKM_AES_MAC0x0000108316–32sign, verify
CKM_AES_MAC_GENERAL0x0000108416–32sign, verify
CKM_AES_CBC_PAD0x0000108516–32encrypt, decrypt, wrap, unwrap
CKM_AES_CTR0x0000108616–32encrypt, decrypt, wrap, unwrap
CKM_AES_GCM0x0000108716–32encrypt, decrypt, wrap, unwrap
CKM_AES_CMAC0x0000108A16–32sign, verify
CKM_AES_CMAC_GENERAL0x0000108B16–32sign, verify
CKM_AES_OFB0x0000210416–32encrypt, decrypt, wrap, unwrap
CKM_AES_CFB80x0000210616–32encrypt, decrypt, wrap, unwrap
CKM_AES_CFB1280x0000210716–32encrypt, decrypt, wrap, unwrap
CKM_AES_KEY_WRAP0x0000210932–64encrypt, decrypt, wrap, unwrap
CKM_AES_KEY_WRAP_PAD0x0000210A32–64encrypt, decrypt, wrap, unwrap
CKM_AES_KEY_WRAP_KWP0x0000210B32–64encrypt, decrypt, wrap, unwrap
CKM_AES_KEY_WRAP_PKCS70x0000210C32–64encrypt, decrypt, wrap, unwrap
CKM_SHA_1_KEY_GEN0x0000400380–2048generate
CKM_SHA224_KEY_GEN0x0000400480–2048generate
CKM_SHA256_KEY_GEN0x0000400580–2048generate
CKM_SHA384_KEY_GEN0x0000400680–2048generate
CKM_SHA512_KEY_GEN0x0000400780–2048generate
CKM_SHA512_224_KEY_GEN0x0000400880–2048generate
CKM_SHA512_256_KEY_GEN0x0000400980–2048generate
CKM_ECDH_X_AES_KEY_WRAP0x00004038255–448wrap, unwrap, ec_oid, ec_f_p, ec_compress
CKM_ECDH_COF_AES_KEY_WRAP0x00004039160–521wrap, unwrap, ec_oid, ec_f_p, ec_uncompress, ec_compress
CKM_PUB_KEY_FROM_PRIV_KEY0x0000403A-derive
CKM_IBM_SHA3_2240x80010001-digest
CKM_IBM_SHA3_2560x80010002-digest
CKM_IBM_SHA3_3840x80010003-digest
CKM_IBM_SHA3_5120x80010004-digest
CKM_IBM_DILITHIUM0x80010023256–256generate_key_pair, sign, verify
CKM_IBM_SHA3_224_HMAC0x80010025112–2048sign, verify
CKM_IBM_SHA3_256_HMAC0x80010026128–2048sign, verify
CKM_IBM_SHA3_384_HMAC0x80010027192–2048sign, verify
CKM_IBM_SHA3_512_HMAC0x80010028256–2048sign, verify
CKM_IBM_ML_DSA_KEY_PAIR_GEN0x800100351312–2592generate_key_pair
CKM_IBM_ML_DSA0x800100361312–2592sign, verify
CKM_IBM_ML_KEM_KEY_PAIR_GEN0x80010037800–1568generate_key_pair
CKM_IBM_ML_KEM0x80010038800–1568derive
CKM_IBM_ML_KEM_WITH_ECDH0x8001FF01800–1568derive

source · opencryptoki soft token, from soft_stdll/soft_specific.c · 3.27.0 development · 430a47d · 2026-09-10

Return values with a note for this library

  • CKR_FUNCTION_FAILED · A recoverable failure. The library is still usable and the token unchanged, so this one is worth investigating rather than restarting.
  • CKR_CRYPTOKI_NOT_INITIALIZED · The library has no state in this process. In a process where two components share one module, the interesting case is the one that undid it.

How this page was made

Read from the source at the commit linked above. The return site counts are text searches over usr/lib/common and usr/lib/soft_stdll. The mechanism table is parsed from the soft token's static list and the vendor mechanism numbers from the project's public header, both at the same commit. The library was built here with only the software token and probed once, which produced the C_Initialize finding and nothing else.

Scope. A development commit on the main branch, one day before reading, after the 3.26 release. Distribution packages are older and list fewer mechanisms. The table shows every entry in the source including the conditional ones, so a particular build exposes at most this list.

Sources

Names and numbers only. No vendor documentation text is reproduced here.