ta/wallet_ta.c
/** Instantiate a HMAC_DRBG state using some seed material.
  * In the terminology of NIST SP 800-90A, the seed material consists of
  * entropy_input, nonce and personalization_string concatenated together.
  * It is the responsibility of the caller to perform this concatenation.
  * This function doesn't do the concatenation because that would require
  * dynamic memory allocation. This function is only used by the TA
  * itself.
  * \param session_data A data pointer to a session context.
  * \param state The HMAC_DRBG state to instantiate.
  * \param seed_material The seed material to seed the HMAC_DRBG state with.
  *                      This may be of arbitrary length and will usually
  *                      consist of several entropy sources concatenated
  *                      together.
  * \param seed_material_length Length of seed material in bytes.
  */
Instantiate a HMAC_DRBG state using some seed material.
In the terminology of NIST SP 800-90A, the seed material consists of
entropy_input, nonce and personalization_string concatenated together.
It is the responsibility of the caller to perform this concatenation.
This function doesn't do the concatenation because that would require
dynamic memory allocation. This function is only used by the TA
itself.
\param session_data A data pointer to a session context.
\param state The HMAC_DRBG state to instantiate.
\param seed_material The seed material to seed the HMAC_DRBG state with.
This may be of arbitrary length and will usually
consist of several entropy sources concatenated
together.
\param seed_material_length Length of seed material in bytes.
Instantiate a HMAC_DRBG state using some seed material . In the terminology of NIST SP 800 - 90A the seed material consists of entropy_input nonce and personalization_string concatenated together . It is the responsibility of the caller to perform this concatenation . This function doesn ' t do the concatenation because that would require dynamic memory allocation . This function is only used by the TA itself . \ param session_data A data pointer to a session context . \ param state The HMAC_DRBG state to instantiate . \ param seed_material The seed material to seed the HMAC_DRBG state with . This may be of arbitrary length and will usually consist of several entropy sources concatenated together . \ param seed_material_length Length of seed material in bytes .
static void drbg_instantiate_internal(Session_data * session_data, HMACDRBGState *state, const uint8_t *seed_material, const unsigned int seed_material_length)
{
	TEE_MemFill((uint8_t*)(state->key), 0x00, (uint32_t)sizeof(state->key));
	TEE_MemFill((uint8_t*)(state->v), 0x01, (uint32_t)sizeof(state->v));
	drbg_update_internal(session_data,
						state,
						seed_material,
						seed_material_length);
}
static void drbg_instantiate_internal ( Session_data * session_data , HMACDRBGState * state , const uint8_t * seed_material , const unsigned int seed_material_length ) { TEE_MemFill ( ( uint8_t * ) ( state -> key ) , 0x00 , ( uint32_t ) sizeof ( state -> key ) ) ; TEE_MemFill ( ( uint8_t * ) ( state -> v ) , 0x01 , ( uint32_t ) sizeof ( state -> v ) ) ; drbg_update_internal ( session_data , state , seed_material , seed_material_length ) ; }
Instantiate a HMAC_DRBG state using some seed material.
Instantiate a HMAC_DRBG state using some seed material .