Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 宏定义的语法;0000“;_C_Sdk_Macros_Xilinx - Fatal编程技术网

C 宏定义的语法;0000“;

C 宏定义的语法;0000“;,c,sdk,macros,xilinx,C,Sdk,Macros,Xilinx,我在使用Xilinx芯片时,在Xilinx SDK(C语言)中遇到了这种语法: 从用户指南中可以看出,值“0000…0000”似乎表示AES的位数(在本例中,应为384位)。这个语法中到底是什么?宏如何指定与常量相对的位数? 那么 他们在哪里说作为评论 /* * ... * The value mentioned in this will be converted to hex buffer and written * into the ZynqMP Ps eFUSE array whe

我在使用Xilinx芯片时,在Xilinx SDK(C语言)中遇到了这种语法:

从用户指南中可以看出,值“0000…0000”似乎表示AES的位数(在本例中,应为384位)。这个语法中到底是什么?宏如何指定与常量相对的位数?

那么

他们在哪里说作为评论

/*
* ...
*   The value mentioned in this will be converted to hex buffer and written
*   into the ZynqMP Ps eFUSE array when write API used. This value should
*   be given in string format. It should be 96 or 64 characters long, valid
*   characters are 0-9,a-f,A-F. Any other character is considered as invalid
*   string and will not burn PPK0 hash.
*...
*/
链接的用户指南中的注释是相同的

他们明确地说这应该是一个96或64个字符的字符串(在您的示例中为96)。这与位计数无关

此外,则用法如下所示:

PsStatus = XilSKey_Efuse_ValidateKey(
                (char *)XSK_EFUSEPS_PPK0_HASH,
                XSK_EFUSEPS_PPK_SHA3_HASH_STRING_LEN_96);


在调用中明确指出(可能是不必要的)这两个函数期望一个指向
char
序列的指针(每个文本字符串在C中都会衰减到该序列)

XSK\u EFUSEPS\u PPK0\u HASH
可用于使用
char HASH\u buffer[]=XSK\u EFUSEPS\u PPK0\u HASH将哈希缓冲区的所有字节设置为
'0'
PsStatus = XilSKey_Efuse_ValidateKey(
                (char *)XSK_EFUSEPS_PPK0_HASH,
                XSK_EFUSEPS_PPK_SHA3_HASH_STRING_LEN_96);
XilSKey_Efuse_ConvertStringToHexBE(
                (char *)XSK_EFUSEPS_PPK0_HASH,
                &PsInstancePtr->Ppk0Hash[0],
                XSK_EFUSEPS_PPK_SHA3HASH_LEN_IN_BITS_384);