首页 > 解决方案 > 为什么在 md5 算法中填充初始长度时会有三位移位

问题描述

// append the len in bits at the end of the buffer.
to_bytes(initial_len*8, msg + new_len);
// initial_len>>29 == initial_len*8>>32, but avoids overflow.
to_bytes(initial_len>>29, msg + new_len + 4);

代码来自https://github.com/pod32g/MD5/blob/master/md5.c

标签: calgorithmmd5

解决方案


推荐阅读