Error when a message is passed to a Monero TransactionMachine

This commit is contained in:
Luke Parker 2022-06-10 00:20:59 -04:00
parent 8e8bfabc83
commit e1831ee5af
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -175,13 +175,20 @@ impl StateMachine for TransactionMachine {
fn sign(
&mut self,
mut commitments: HashMap<u16, Vec<u8>>,
// Drop FROST's 'msg' since we calculate the actual message in this function
_: &[u8]
msg: &[u8]
) -> Result<Vec<u8>, FrostError> {
if self.state() != State::Preprocessed {
Err(FrostError::InvalidSignTransition(State::Preprocessed, self.state()))?;
}
if msg.len() != 0 {
Err(
FrostError::InternalError(
"message was passed to the TransactionMachine when it generates its own".to_string()
)
)?;
}
// Add all commitments to the transcript for their entropy
// While each CLSAG will do this as they need to for security, they have their own transcripts
// cloned from this TX's initial premise's transcript. For our TX transcript to have the CLSAG