@@ -338,7 +338,7 @@ void wc_Sha3_384_Free(wc_Sha3* sha)
338338 (void )sha ;
339339}
340340#else
341- # error PKA =1 only supported with HASH=SHA3
341+ # error HW_SHA3 =1 only supported with HASH=SHA3
342342#endif
343343
344344/* CSU PUF */
@@ -573,33 +573,17 @@ int csu_aes_key_zero(void)
573573 return ret ;
574574}
575575
576- #ifdef CSU_PUF_ROT
577- #define KEY_WRAP_SZ 32
578- /* Red (sensitive key), Black (protected key), Grey (unknown) */
579- /* Example key to encrypt */
580- static const uint8_t XALIGNED (32 ) redKey [KEY_WRAP_SZ ] = {
581- 0x64 , 0xF0 , 0x3A , 0xFD , 0x7D , 0x0C , 0x70 , 0xD2 ,
582- 0x59 , 0x1C , 0xDF , 0x34 , 0x30 , 0x5F , 0x7B , 0x8A ,
583- 0x5B , 0xA4 , 0x59 , 0x3C , 0x0A , 0x0E , 0x1B , 0x8C ,
584- 0x5E , 0xCD , 0xFF , 0x9F , 0x59 , 0x00 , 0x19 , 0x2C
585- };
586- /* Example IV to use for wrapping */
587- static const uint8_t XALIGNED (32 ) blackIv [AES_GCM_TAG_SZ ] = {
588- 0xD1 , 0x42 , 0xAC , 0x7C , 0x56 , 0x0F , 0x15 , 0x8B ,
589- 0xA9 , 0x5A , 0x21 , 0x31
590- };
591- static uint8_t XALIGNED (32 ) blackKey [KEY_WRAP_SZ + AES_GCM_TAG_SZ ];
592- #endif
593-
594576int csu_init (void )
595577{
596578 int ret = 0 ;
597579#ifdef CSU_PUF_ROT
580+ #if 0
598581 uint32_t syndrome [CSU_PUF_SYNDROME_WORDS ];
599582 uint32_t chash = 0 , aux = 0 ;
600583 #if defined(DEBUG_CSU ) && DEBUG_CSU >= 1
601584 uint32_t idx ;
602585 #endif
586+ #endif
603587#endif
604588 uint32_t reg1 = pmu_mmio_read (CSU_IDCODE );
605589 uint32_t reg2 = pmu_mmio_read (CSU_VERSION );
@@ -637,6 +621,10 @@ int csu_init(void)
637621 pmu_efuse_read (ZYNQMP_EFUSE_PUF_AUX , & reg2 , sizeof (reg2 ));
638622 wolfBoot_printf ("eFuse PUF CHASH 0x%08x, AUX 0x%08x\n" , reg1 , reg2 );
639623
624+ /* CSU PUF only supported with eFuses */
625+ /* Keeping code for reference in future generations like Versal */
626+ /* Red (sensitive key), Black (protected key), Grey (unknown) */
627+ #if 0
640628 memset (syndrome , 0 , sizeof (syndrome ));
641629 ms = hal_timer_ms ();
642630 ret = csu_puf_register (syndrome , & chash , & aux );
@@ -676,6 +664,7 @@ int csu_init(void)
676664 }
677665 wolfBoot_printf ("\n" );
678666 #endif
667+ #endif
679668 }
680669#endif
681670
0 commit comments