4 void tf_ctr_set(void *ctr, const void *sctr, size_t sctrsz)
6 TF_UNIT_TYPE usctr[TF_NR_BLOCK_UNITS];
7 TF_UNIT_TYPE *uctr = ctr;
9 data_to_words(uctr, TF_BLOCK_SIZE);
11 memset(usctr, 0, TF_BLOCK_SIZE);
12 memcpy(usctr, sctr, sctrsz > TF_BLOCK_SIZE ? TF_BLOCK_SIZE : sctrsz);
13 data_to_words(usctr, TF_BLOCK_SIZE);
15 ctr_add(uctr, TF_NR_BLOCK_UNITS, usctr, TF_NR_BLOCK_UNITS);
16 memset(usctr, 0, TF_BLOCK_SIZE);