Make use of <hash-used/> from XEP-0300.
At any time during the lifetime of the file transfer session, the File Sender can communicate the checksum of the file to the File Receiver.
This can be done in the session-initiate message if the File Sender already knows the checksum, as shown above in Example 3.
-After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:5' namespace. The <checksum/> element SHOULD contain 'creator' and 'name' attributes sufficient to identitfy the content the checksum belongs to. Additionally, the <checksum/> element MUST contain a <file/> element which MUST contain at least one <hash/> element qualified by the 'urn:xmpp:hashes:2' namespace. Each <hash/> element contains a checksum of the file data produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.
+After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:5' namespace. In such a case however, the session-initiate message MUST contain a <hash-used/> element. The <checksum/> element SHOULD contain 'creator' and 'name' attributes sufficient to identitfy the content the checksum belongs to. Additionally, the <checksum/> element MUST contain a <file/> element which MUST contain at least one <hash/> or <hash-used/> element qualified by the 'urn:xmpp:hashes:2' namespace. Each <hash/> element contains a checksum of the file data produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.
Add hash-used element
An XMPP protocol can include more than one instance of the <hash/> element, as long as each one has a different value for the 'algo' attribute:
2AfMGH8O7UNPTvUVAM9aK13mpCY=
2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU= ]]>
+ In certain scenarios it makes sense to communicate the hash algorithm that is used prior to the calculation of the hash value.
+]]>
The value of the 'algo' attribute MUST be one of the values from the &ianahashes; maintained by &IANA;, or one of the values defined in the following table.