From cb69b4b11be233cb17efcafecfe2ce280b178259 Mon Sep 17 00:00:00 2001 From: Erwin Nindl Date: Thu, 19 Jul 2007 12:14:26 +0000 Subject: * added doc directory * changed AesIcmCypher::getBitStream --- cypher.cpp | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) (limited to 'cypher.cpp') diff --git a/cypher.cpp b/cypher.cpp index 17668a7..76a7d92 100644 --- a/cypher.cpp +++ b/cypher.cpp @@ -31,7 +31,7 @@ #include #include -#include "datatypes.h" +//#include "datatypes.h" #include "cypher.h" @@ -39,9 +39,9 @@ extern "C" { #include } -void Cypher::cypher(Buffer& buf) +void Cypher::cypher(Buffer& buf, seq_nr_t seq_nr, sender_id_t sender_id) { - Buffer stream = getBitStream(buf.getLength()); + Buffer stream = getBitStream(buf.getLength(), seq_nr, sender_id); exor(buf, stream); } @@ -55,7 +55,7 @@ void Cypher::exor(Buffer& buf, const Buffer& bit_stream) catch(std::out_of_range& o) {} } -Buffer NullCypher::getBitStream(u_int32_t length) +Buffer NullCypher::getBitStream(u_int32_t length, seq_nr_t seq_nr, sender_id_t sender_id) { Buffer buf(length); for(u_int32_t i; i> 16); + iv.v32[3] ^= (seq_nr << 16); + + status = cipher_set_iv(cipher, &iv); status = cipher_output(cipher, buf, length); status = cipher_dealloc(cipher); -- cgit v1.2.3