1 /* This file includes functions that were extracted from the TPM2
2  * source, but were present in files not included in compilation.
3  */
4 #include "Global.h"
5 #include "CryptoEngine.h"
6 
_cpri__GetSymmetricBlockSize(TPM_ALG_ID symmetricAlg,UINT16 keySizeInBits)7 INT16 _cpri__GetSymmetricBlockSize(
8   TPM_ALG_ID symmetricAlg,      // IN: the symmetric algorithm
9   UINT16 keySizeInBits          // IN: the key size
10   )
11 {
12    switch (symmetricAlg)
13    {
14 #ifdef TPM_ALG_AES
15    case TPM_ALG_AES:
16 #endif
17 #ifdef TPM_ALG_SM4 // Both AES and SM4 use the same block size
18    case TPM_ALG_SM4:
19 #endif
20        if(keySizeInBits != 0) // This is mostly to have a reference to
21               // keySizeInBits for the compiler
22               return 16;
23          else
24              return 0;
25          break;
26     default:
27         return 0;
28     }
29 }
30