From: Andrey Rys Date: Fri, 15 Mar 2019 10:27:56 +0000 (+0700) Subject: tfprng: use tf_prng_datasize even if no one uses it. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e4b8a1c06635af297a89f2629e22c7aa94103d56;p=tfcrypt.git tfprng: use tf_prng_datasize even if no one uses it. --- diff --git a/VERSION b/VERSION index b1bd38b..8351c19 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -13 +14 diff --git a/tfprng.c b/tfprng.c index 24de6fd..d4370f3 100644 --- a/tfprng.c +++ b/tfprng.c @@ -19,7 +19,7 @@ void tf_prng_seedkey_r(void *sdata, const void *skey) TF_UNIT_TYPE k[TF_NR_KEY_UNITS]; struct tf_prng_data *rprng = sdata; - memset(rprng, 0, sizeof(struct tf_prng_data)); + memset(rprng, 0, tf_prng_datasize()); if (!skey) return; memcpy(k, skey, TF_KEY_SIZE); @@ -52,7 +52,7 @@ void tf_prng_seed_r(void *sdata, TF_UNIT_TYPE seed) struct tf_prng_data *rprng = sdata; size_t x; - memset(rprng, 0, sizeof(struct tf_prng_data)); + memset(rprng, 0, tf_prng_datasize()); for (x = 0; x < TF_NR_KEY_UNITS; x++) k[x] = seed; tfe_init(&rprng->tfe, k); rprng->init = 1;