lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_ValidateHash(const char *Hash, u32 Len)
{
	int Status = XST_FAILURE;
	u32 StrLen = strnlen(Hash, XNVM_EFUSE_PPK_HASH_STRING_LEN);
	u32 Index;

	if ((NULL == Hash) || (Len == 0U)) {
		goto END;
	}

	if (StrLen != Len) {
		goto END;
	}

	for(Index = 0U; Index < StrLen; Index++) {
		if(Xil_IsValidHexChar(&Hash[Index]) != (u32)XST_SUCCESS) {
			goto END;
		}
	}
	Status = XST_SUCCESS;

END :
	return Status;
}
/******************************************************************************/
/**
 * This function is used to validate the input string contains valid PPK hash
 *
 * @param	Hash - Pointer to PPK hash
 *
 * 		Len  - Length of the input string
 *
 * @return
 *	- XST_SUCCESS	- On valid input Ppk Hash string
 *	- XST_INVALID_PARAM - On invalid length of the input string
 *	- XST_FAILURE	- On non hexadecimal character in string
 *
 ******************************************************************************/
This function is used to validate the input string contains valid PPK hash
@param       Hash - Pointer to PPK hash

Len  - Length of the input string


This function is used to validate the input string contains valid PPK hash @param Hash - Pointer to PPK hash Len - Length of the input string
static int XilNvm_ValidateHash(const char *Hash, u32 Len)
{
	int Status = XST_FAILURE;
	u32 StrLen = strnlen(Hash, XNVM_EFUSE_PPK_HASH_STRING_LEN);
	u32 Index;
	if ((NULL == Hash) || (Len == 0U)) {
		goto END;
	}
	if (StrLen != Len) {
		goto END;
	}
	for(Index = 0U; Index < StrLen; Index++) {
		if(Xil_IsValidHexChar(&Hash[Index]) != (u32)XST_SUCCESS) {
			goto END;
		}
	}
	Status = XST_SUCCESS;
END :
	return Status;
}
static int XilNvm_ValidateHash ( const char * Hash , u32 Len ) { int Status = XST_FAILURE ; u32 StrLen = strnlen ( Hash , XNVM_EFUSE_PPK_HASH_STRING_LEN ) ; u32 Index ; if ( ( NULL == Hash ) || ( Len == 0U ) ) { goto END ; } if ( StrLen != Len ) { goto END ; } for ( Index = 0U ; Index < StrLen ; Index ++ ) { if ( Xil_IsValidHexChar ( & Hash [ Index ] ) != ( u32 ) XST_SUCCESS ) { goto END ; } } Status = XST_SUCCESS ; END : return Status ; }
This function is used to validate the input string contains valid PPK hash
 @param       Hash - Pointer to PPK hash
This function is used to validate the input string contains valid PPK hash @param Hash - Pointer to PPK hash