Search code examples
cryptographycryptoapicng

CryptoAPI: difference Between CALG_* and BCRYPT_*_ALGORITHM


What is the difference between CALG_* and BCRYPT_*_ALGORITHM

for example: SHA_256 is defined both as:

#define CALG_SHA_256 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_SHA_256)

and

#define BCRYPT_SHA256_ALGORITHM L"SHA256"


Solution

  • From my understanding, CALC_* are crypto algorithm from crypto api from day 1.

    BCRYPT are the one for CNG (crypto next gen) which replace (in a long time?) the legacy crypto API.