Skip to content

Commit

Permalink
aes-gcm-siv: TODO comments for interleaving MAC+encrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Jun 20, 2022
1 parent 479ae5f commit d93b4e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aes-gcm-siv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,10 @@ where
return Err(Error);
}

// TODO(tarcieri): interleave authentication and encryption
let tag = self.compute_tag(associated_data, buffer);
init_ctr(&self.enc_cipher, &tag).apply_keystream_partial(buffer.into());

Ok(tag)
}

Expand All @@ -342,6 +344,8 @@ where
}

self.polyval.update_padded(associated_data);

// TODO(tarcieri): interleave decryption and authentication
init_ctr(&self.enc_cipher, tag).apply_keystream_partial(buffer.into());
self.polyval.update_padded(buffer);

Expand Down

0 comments on commit d93b4e0

Please sign in to comment.