diff options
-rw-r--r-- | cipher.cpp | 2 | ||||
-rw-r--r-- | keyDerivation.cpp | 2 | ||||
-rw-r--r-- | mpi.cpp | 2 | ||||
-rw-r--r-- | mpi.h | 2 |
4 files changed, 4 insertions, 4 deletions
@@ -145,7 +145,7 @@ void AesIcmCipher::calc(u_int8_t* in, u_int32_t ilen, u_int8_t* out, u_int32_t o ctr = salt.mul2exp(16) ^ sid.mul2exp(64) ^ seq.mul2exp(16); // TODO: hardcoded size - u_int32_t written; + size_t written; u_int8_t *ctr_buf = ctr.getNewBuf(&written); // TODO: hardcoded size err = gcry_cipher_setctr( cipher_, ctr_buf, written ); // TODO: hardcoded size delete[] ctr_buf; diff --git a/keyDerivation.cpp b/keyDerivation.cpp index ac69f80..aafde10 100644 --- a/keyDerivation.cpp +++ b/keyDerivation.cpp @@ -137,7 +137,7 @@ void AesIcmKeyDerivation::generate(satp_prf_label label, seq_nr_t seq_nr, Buffer Mpi x(128); // TODO: hardcoded size x = key_id ^ salt; - u_int32_t written; + size_t written; u_int8_t *ctr_buf = x.mul2exp(16).getNewBuf(&written); // TODO: hardcoded size err = gcry_cipher_setctr( cipher_ , ctr_buf, written ); delete[] ctr_buf; @@ -156,7 +156,7 @@ Mpi Mpi::mul2exp(u_int32_t e) const } //TODO: problem, seems as gcry_mpi_(a)print doesn't work for mpi values of '0' -u_int8_t* Mpi::getNewBuf(u_int32_t* written) const +u_int8_t* Mpi::getNewBuf(size_t* written) const { u_int8_t* res_cpy; gcry_mpi_aprint( GCRYMPI_FMT_STD, &res_cpy, written, val_ ); @@ -70,7 +70,7 @@ public: * @param buf_len size of the new buffer that is returned * @return a byte buffer of size buf_len */ - u_int8_t *getNewBuf(u_int32_t* written) const; + u_int8_t *getNewBuf(size_t* written) const; std::string getHexDump() const; u_int32_t getLength() const; |