diff options
author | Erwin Nindl <nine@wirdorange.org> | 2007-12-11 16:35:07 +0000 |
---|---|---|
committer | Erwin Nindl <nine@wirdorange.org> | 2007-12-11 16:35:07 +0000 |
commit | b6f796adf863d1800c03bc2519108a9ea6f532bf (patch) | |
tree | 5ce09d8e0f1270b1f9d50f935f90dc3b8d14d765 /keyDerivation.cpp | |
parent | replay protection works again (diff) |
* added mpi operator
* kd iv generation fix
Diffstat (limited to 'keyDerivation.cpp')
-rw-r--r-- | keyDerivation.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/keyDerivation.cpp b/keyDerivation.cpp index afe20f6..809a354 100644 --- a/keyDerivation.cpp +++ b/keyDerivation.cpp @@ -124,11 +124,16 @@ void KeyDerivation::generate(satp_prf_label label, seq_nr_t seq_nr, Buffer& key, r = static_cast<long unsigned int>(seq_nr / ( 0x01 << ld_kdr_ )); r = r.mul2exp(8); - key_id = r + Mpi(static_cast<long unsigned int>(label)); + key_id = r + static_cast<long unsigned int>(label); Mpi salt = Mpi(salt_.getBuf(), salt_.getLength()); iv = key_id ^ salt; + std::cout << "KeyDerivation::generate: r_len: "<< r.getLen() << std::endl; + std::cout << "KeyDerivation::generate: key_id_len: "<< key_id.getLen() << std::endl; + std::cout << "KeyDerivation::generate: salt_len: "<< salt.getLen() << std::endl; + std::cout << "KeyDerivation::generate: iv_len: "<< iv.getLen() << std::endl; + err = gcry_cipher_reset( cipher_ ); if( err ) cLog.msg(Log::PRIO_ERR) << "KeyDerivation::generate: Failed to reset cipher: " << gpg_strerror( err ); |