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