mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Have Transcript::append_message take in AsRef<[u8]>, not &[u8]
Simplifies calling it.
This commit is contained in:
@@ -266,7 +266,7 @@ impl<C: Curve, A: Algorithm<C>> SignMachine<A::Signature> for AlgorithmSignMachi
|
||||
.params
|
||||
.algorithm
|
||||
.transcript()
|
||||
.append_message(b"participant", C::F::from(u64::from(*l)).to_repr().as_ref());
|
||||
.append_message(b"participant", C::F::from(u64::from(*l)).to_repr());
|
||||
}
|
||||
|
||||
if *l == self.params.keys.params().i() {
|
||||
@@ -277,7 +277,7 @@ impl<C: Curve, A: Algorithm<C>> SignMachine<A::Signature> for AlgorithmSignMachi
|
||||
{
|
||||
let mut buf = vec![];
|
||||
addendum.write(&mut buf).unwrap();
|
||||
self.params.algorithm.transcript().append_message(b"addendum", &buf);
|
||||
self.params.algorithm.transcript().append_message(b"addendum", buf);
|
||||
}
|
||||
|
||||
B.insert(*l, commitments);
|
||||
@@ -288,7 +288,7 @@ impl<C: Curve, A: Algorithm<C>> SignMachine<A::Signature> for AlgorithmSignMachi
|
||||
{
|
||||
let mut buf = vec![];
|
||||
preprocess.addendum.write(&mut buf).unwrap();
|
||||
self.params.algorithm.transcript().append_message(b"addendum", &buf);
|
||||
self.params.algorithm.transcript().append_message(b"addendum", buf);
|
||||
}
|
||||
|
||||
B.insert(*l, preprocess.commitments);
|
||||
@@ -298,7 +298,7 @@ impl<C: Curve, A: Algorithm<C>> SignMachine<A::Signature> for AlgorithmSignMachi
|
||||
|
||||
// Re-format into the FROST-expected rho transcript
|
||||
let mut rho_transcript = A::Transcript::new(b"FROST_rho");
|
||||
rho_transcript.append_message(b"message", &C::hash_msg(msg));
|
||||
rho_transcript.append_message(b"message", C::hash_msg(msg));
|
||||
rho_transcript.append_message(
|
||||
b"preprocesses",
|
||||
&C::hash_commitments(
|
||||
@@ -317,7 +317,7 @@ impl<C: Curve, A: Algorithm<C>> SignMachine<A::Signature> for AlgorithmSignMachi
|
||||
// While further code edits would still be required for such a model (having the offset
|
||||
// communicated as a point along with only a single party applying the offset), this means
|
||||
// it wouldn't require a transcript change as well
|
||||
rho_transcript.append_message(b"offset", (C::generator() * offset).to_bytes().as_ref());
|
||||
rho_transcript.append_message(b"offset", (C::generator() * offset).to_bytes());
|
||||
}
|
||||
|
||||
// Generate the per-signer binding factors
|
||||
@@ -329,7 +329,7 @@ impl<C: Curve, A: Algorithm<C>> SignMachine<A::Signature> for AlgorithmSignMachi
|
||||
.params
|
||||
.algorithm
|
||||
.transcript()
|
||||
.append_message(b"rho_transcript", rho_transcript.challenge(b"merge").as_ref());
|
||||
.append_message(b"rho_transcript", rho_transcript.challenge(b"merge"));
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
|
||||
Reference in New Issue
Block a user