Lines Matching refs:m
40 fn add_to(&self, m: &mut Message) -> Result<()> { in add_to()
41 for a in &m.attributes.0 { in add_to()
51 let length = m.length; in add_to()
53 m.length += (MESSAGE_INTEGRITY_SIZE + ATTRIBUTE_HEADER_SIZE) as u32; in add_to()
54 m.write_length(); // writing length to m.Raw in add_to()
55 let v = new_hmac(&self.0, &m.raw); // calculating HMAC for adjusted m.Raw in add_to()
56 m.length = length; // changing m.Length back in add_to()
58 m.add(ATTR_MESSAGE_INTEGRITY, &v); in add_to()
87 pub fn check(&self, m: &mut Message) -> Result<()> { in check()
88 let v = m.get(ATTR_MESSAGE_INTEGRITY)?; in check()
93 let length = m.length as usize; in check()
97 for a in &m.attributes.0 { in check()
106 m.length -= size_reduced as u32; in check()
107 m.write_length(); in check()
109 let start_of_hmac = MESSAGE_HEADER_SIZE + m.length as usize in check()
111 let b = &m.raw[..start_of_hmac]; // data before integrity attribute in check()
113 m.length = length as u32; in check()
114 m.write_length(); // writing length back in check()