diff --git a/matrix_sdk_crypto/src/verification/sas/helpers.rs b/matrix_sdk_crypto/src/verification/sas/helpers.rs index 248c3a28..617a9827 100644 --- a/matrix_sdk_crypto/src/verification/sas/helpers.rs +++ b/matrix_sdk_crypto/src/verification/sas/helpers.rs @@ -63,10 +63,12 @@ pub struct SasIds { /// interactive verification process. pub fn calculate_commitment(public_key: &str, content: impl Into) -> String { let content = content.into().canonical_json(); + let content_string = content.to_string(); encode( Sha256::new() - .chain(&format!("{}{}", public_key, content)) + .chain(&public_key) + .chain(&content_string) .finalize(), ) }