mirror of
https://github.com/stefanberger/libtpms
synced 2026-01-16 22:53:27 +00:00
tpm2: rev162: Rename TPM_SYM_MODE_FIRST/LAST to SYM_MODE_FIRST/LAST
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
b8883ba55e
commit
01cc2d07b4
@ -132,8 +132,8 @@ TestHash(
|
||||
#endif
|
||||
#if ALG_SM3_256
|
||||
case ALG_SM3_256_VALUE:
|
||||
#error Missing test case for SM3
|
||||
// There are currently not test vectors for SM3
|
||||
#error Missing test case for SM3 // libtpms added
|
||||
// There are currently no test vectors for SM3
|
||||
// testDigest = &c_SM3_256_digest.b;
|
||||
testDigest = NULL;
|
||||
break;
|
||||
@ -286,7 +286,7 @@ AllModesAreDone(
|
||||
)
|
||||
{
|
||||
TPM_ALG_ID alg;
|
||||
for(alg = TPM_SYM_MODE_FIRST; alg <= TPM_SYM_MODE_LAST; alg++)
|
||||
for(alg = SYM_MODE_FIRST; alg <= SYM_MODE_LAST; alg++)
|
||||
if(TEST_BOTH(alg))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
@ -314,8 +314,8 @@ TestSymmetric(
|
||||
{
|
||||
if(c_symTestValues[index].alg == alg)
|
||||
{
|
||||
for(mode = TPM_SYM_MODE_FIRST;
|
||||
mode <= TPM_SYM_MODE_LAST;
|
||||
for(mode = SYM_MODE_FIRST;
|
||||
mode <= SYM_MODE_LAST;
|
||||
mode++)
|
||||
{
|
||||
if(TEST_BIT(mode, g_implementedAlgorithms)) // libtpms always test implemented modes
|
||||
@ -327,11 +327,11 @@ TestSymmetric(
|
||||
if(AllSymsAreDone(toTest))
|
||||
{
|
||||
// all symmetric algorithms tested so no modes should be set
|
||||
for(alg = TPM_SYM_MODE_FIRST; alg <= TPM_SYM_MODE_LAST; alg++)
|
||||
for(alg = SYM_MODE_FIRST; alg <= SYM_MODE_LAST; alg++)
|
||||
CLEAR_BOTH(alg);
|
||||
}
|
||||
}
|
||||
else if(TPM_SYM_MODE_FIRST <= alg && alg <= TPM_SYM_MODE_LAST)
|
||||
else if(SYM_MODE_FIRST <= alg && alg <= SYM_MODE_LAST)
|
||||
{
|
||||
// Test this mode for all key sizes and algorithms
|
||||
for(index = 0; index < NUM_SYMS; index++)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
/* Structure definitions for the self-test */
|
||||
/* Written by Ken Goldman */
|
||||
/* IBM Thomas J. Watson Research Center */
|
||||
/* $Id: SelfTest.h 1529 2019-11-21 23:29:01Z kgoldman $ */
|
||||
/* $Id: SelfTest.h 1594 2020-03-26 22:15:48Z kgoldman $ */
|
||||
/* */
|
||||
/* Licenses and Notices */
|
||||
/* */
|
||||
@ -55,7 +55,7 @@
|
||||
/* arising in any way out of use or reliance upon this specification or any */
|
||||
/* information herein. */
|
||||
/* */
|
||||
/* (c) Copyright IBM Corp. and others, 2016 - 2019 */
|
||||
/* (c) Copyright IBM Corp. and others, 2016 - 2020 */
|
||||
/* */
|
||||
/********************************************************************************/
|
||||
|
||||
@ -80,11 +80,12 @@
|
||||
typedef UINT32 SYM_INDEX;
|
||||
|
||||
/* These two defines deal with the fact that the TPM_ALG_ID table does not delimit the symmetric
|
||||
mode values with a TPM_SYM_MODE_FIRST and TPM_SYM_MODE_LAST */
|
||||
mode values with a SYM_MODE_FIRST and SYM_MODE_LAST */
|
||||
|
||||
#define TPM_SYM_MODE_FIRST ALG_CTR_VALUE
|
||||
#define TPM_SYM_MODE_LAST ALG_ECB_VALUE
|
||||
#define NUM_SYM_MODES (TPM_SYM_MODE_LAST - TPM_SYM_MODE_FIRST + 1)
|
||||
#define SYM_MODE_FIRST ALG_CTR_VALUE
|
||||
#define SYM_MODE_LAST ALG_ECB_VALUE
|
||||
|
||||
#define NUM_SYM_MODES (SYM_MODE_LAST - SYM_MODE_FIRST + 1)
|
||||
|
||||
/* Define a type to hold a bit vector for the modes. */
|
||||
#if NUM_SYM_MODES <= 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user