lib/sw_services/xilnvm/examples/xilnvm_bbram_versal_client_example.c
static int XNvm_ValidateAesKey(const char *Key)
{
	int Status = XST_INVALID_PARAM;
	u32 Len;

	if(NULL == Key) {
		goto END;
	}

	Len = Xil_Strnlen(Key, XNVM_MAX_AES_KEY_LEN_IN_CHARS + 1U);

	if ((Len != XNVM_256_BITS_AES_KEY_LEN_IN_CHARS) &&
		(Len != XNVM_128_BITS_AES_KEY_LEN_IN_CHARS)) {
		goto END;
	}

	Status = (int)Xil_ValidateHexStr(Key);
END:
	return Status;
}
/******************************************************************************/
/**
 * @brief	Validate the input string contains valid AES key.
 *
 * @param   	Key - Pointer to AES key.
 *
 *@return	- XST_SUCCESS - On valid input AES key string.
 *		- XST_INVALID_PARAM - On invalid length of the input string.
 *		- XST_FAILURE	- On non hexadecimal character in string
 *
 *******************************************************************************/
@brief       Validate the input string contains valid AES key.
@param       Key - Pointer to AES key.

@return       - XST_SUCCESS - On valid input AES key string.
- XST_INVALID_PARAM - On invalid length of the input string.
- XST_FAILURE   - On non hexadecimal character in string
@brief Validate the input string contains valid AES key . @param Key - Pointer to AES key . @return - XST_SUCCESS - On valid input AES key string . - XST_INVALID_PARAM - On invalid length of the input string . - XST_FAILURE - On non hexadecimal character in string
static int XNvm_ValidateAesKey(const char *Key)
{
	int Status = XST_INVALID_PARAM;
	u32 Len;
	if(NULL == Key) {
		goto END;
	}
	Len = Xil_Strnlen(Key, XNVM_MAX_AES_KEY_LEN_IN_CHARS + 1U);
	if ((Len != XNVM_256_BITS_AES_KEY_LEN_IN_CHARS) &&
		(Len != XNVM_128_BITS_AES_KEY_LEN_IN_CHARS)) {
		goto END;
	}
	Status = (int)Xil_ValidateHexStr(Key);
END:
	return Status;
}
static int XNvm_ValidateAesKey ( const char * Key ) { int Status = XST_INVALID_PARAM ; u32 Len ; if ( NULL == Key ) { goto END ; } Len = Xil_Strnlen ( Key , XNVM_MAX_AES_KEY_LEN_IN_CHARS + 1U ) ; if ( ( Len != XNVM_256_BITS_AES_KEY_LEN_IN_CHARS ) && ( Len != XNVM_128_BITS_AES_KEY_LEN_IN_CHARS ) ) { goto END ; } Status = ( int ) Xil_ValidateHexStr ( Key ) ; END : return Status ; }
@brief       Validate the input string contains valid AES key.
@brief Validate the input string contains valid AES key .