mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-05 20:30:57 +00:00
Document that we include the message lengths in the transcript.
This commit is contained in:
parent
57a5473cb0
commit
a02190adf3
1 changed files with 6 additions and 1 deletions
|
|
@ -58,12 +58,17 @@ impl BatchTranscript for Transcript {
|
|||
/// Each is also prefixed with their index in the vector.
|
||||
fn append_scalars(&mut self, scalars: &Vec<Scalar>) {
|
||||
for (i, scalar) in scalars.iter().enumerate() {
|
||||
// XXX add message length into transcript
|
||||
self.append_u64(b"", i as u64);
|
||||
self.append_message(b"hram", scalar.as_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
/// Append the lengths of the messages into the transcript.
|
||||
///
|
||||
/// This is done out of an (potential over-)abundance of caution, to guard
|
||||
/// against the unlikely event of collisions. However, a nicer way to do
|
||||
/// this would be to append the message length before the message, but this
|
||||
/// is messy w.r.t. the calculations of the `H(R||A||M)`s above.
|
||||
fn append_message_lengths(&mut self, message_lengths: &Vec<usize>) {
|
||||
for (i, len) in message_lengths.iter().enumerate() {
|
||||
self.append_u64(b"", i as u64);
|
||||
|
|
|
|||
Loading…
Reference in a new issue