CRYPTO_NUM_LOCKS
CTASSERT((sizeof(locks) / sizeof(*locks)) == CRYPTO_NUM_LOCKS);
if (type < 0 || type >= CRYPTO_NUM_LOCKS)