@@ -376,6 +376,18 @@ typedef int64_t INT64;
376376 #define WOLFTPM_PERFORM_SELFTEST
377377#endif
378378
379+ /* Chip defaults */
380+ #if defined(WOLFTPM_SLB9672 ) || defined(WOLFTPM_SLB9673 )
381+ #ifndef MAX_RSA_KEY_BITS
382+ #define MAX_RSA_KEY_BITS 4096
383+ #endif
384+ #ifndef MAX_ECC_KEY_BITS
385+ #define MAX_ECC_KEY_BITS 384
386+ #endif
387+ #ifndef HASH_COUNT
388+ #define HASH_COUNT 3
389+ #endif
390+ #endif
379391
380392
381393/* ---------------------------------------------------------------------------*/
@@ -388,10 +400,6 @@ typedef int64_t INT64;
388400#define TPM_SHA384_DIGEST_SIZE 48
389401#define TPM_SHA512_DIGEST_SIZE 64
390402
391- #ifndef MAX_ECC_KEY_BYTES
392- #define MAX_ECC_KEY_BYTES 66
393- #endif
394-
395403#ifndef TPM_MAX_BLOCK_SIZE
396404#define TPM_MAX_BLOCK_SIZE 128
397405#endif
@@ -432,12 +440,15 @@ typedef int64_t INT64;
432440#define MAX_SYM_KEY_BYTES 32
433441#endif
434442#ifndef LABEL_MAX_BUFFER
435- #define LABEL_MAX_BUFFER 48
443+ /* the TCG specification defines a label size not exceed 32 bytes */
444+ #define LABEL_MAX_BUFFER 32
436445#endif
446+
437447#ifndef MAX_RSA_KEY_BITS
438448#define MAX_RSA_KEY_BITS 2048
439449#endif
440450#ifndef MAX_RSA_KEY_BYTES
451+ /* the TCG specification defines an RSA key as two max values */
441452#define MAX_RSA_KEY_BYTES (((MAX_RSA_KEY_BITS+7)/8)*2)
442453#endif
443454
0 commit comments