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

View File

@@ -175,13 +175,20 @@ impl StateMachine for TransactionMachine {
fn sign( fn sign(
&mut self, &mut self,
mut commitments: HashMap<u16, Vec<u8>>, mut commitments: HashMap<u16, Vec<u8>>,
// Drop FROST's 'msg' since we calculate the actual message in this function msg: &[u8]
_: &[u8]
) -> Result<Vec<u8>, FrostError> { ) -> Result<Vec<u8>, FrostError> {
if self.state() != State::Preprocessed { if self.state() != State::Preprocessed {
Err(FrostError::InvalidSignTransition(State::Preprocessed, self.state()))?; 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 // 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 // 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 // cloned from this TX's initial premise's transcript. For our TX transcript to have the CLSAG