@@ -225,47 +225,7 @@ mod type_digest {
225225 }
226226}
227227
228- #[ cfg( feature = "serde" ) ]
229- #[ cfg_attr( doc_cfg, doc( cfg( feature = "serde" ) ) ) ]
230- mod signing_message {
231- use crate :: {
232- Digest , Intent , IntentAppId , IntentScope , IntentVersion , PersonalMessage , SigningDigest ,
233- Transaction , hash:: Hasher ,
234- } ;
235-
236- impl Transaction {
237- pub fn signing_digest ( & self ) -> SigningDigest {
238- const INTENT : Intent = Intent {
239- scope : IntentScope :: TransactionData ,
240- version : IntentVersion :: V0 ,
241- app_id : IntentAppId :: Iota ,
242- } ;
243- let digest = signing_digest ( INTENT , self ) ;
244- digest. into_inner ( )
245- }
246- }
247-
248- fn signing_digest < T : serde:: Serialize + ?Sized > ( intent : Intent , ty : & T ) -> Digest {
249- let mut hasher = Hasher :: new ( ) ;
250- hasher. update ( intent. to_bytes ( ) ) ;
251- bcs:: serialize_into ( & mut hasher, ty) . unwrap ( ) ;
252- hasher. finalize ( )
253- }
254-
255- impl PersonalMessage < ' _ > {
256- pub fn signing_digest ( & self ) -> SigningDigest {
257- const INTENT : Intent = Intent {
258- scope : IntentScope :: PersonalMessage ,
259- version : IntentVersion :: V0 ,
260- app_id : IntentAppId :: Iota ,
261- } ;
262- let digest = signing_digest ( INTENT , & self . 0 ) ;
263- digest. into_inner ( )
264- }
265- }
266- }
267-
268- /// A 1-byte domain separator for hashing Object ID in Iota. It is starting from
228+ /// A 1-byte domain separator for hashing Object ID in IOTA. It is starting from
269229/// 0xf0 to ensure no hashing collision for any ObjectId vs Address which is
270230/// derived as the hash of `flag || pubkey`.
271231#[ derive( Copy , Clone , PartialEq , Eq , Debug , Hash ) ]
0 commit comments