summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cipher.cpp2
-rw-r--r--keyDerivation.cpp2
-rw-r--r--mpi.cpp2
-rw-r--r--mpi.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/cipher.cpp b/cipher.cpp
index 5103480..b36df1a 100644
--- a/cipher.cpp
+++ b/cipher.cpp
@@ -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;
diff --git a/mpi.cpp b/mpi.cpp
index a2590fa..6ca2d83 100644
--- a/mpi.cpp
+++ b/mpi.cpp
@@ -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_ );
diff --git a/mpi.h b/mpi.h
index c746602..b23c22b 100644
--- a/mpi.h
+++ b/mpi.h
@@ -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;