@@ -269,17 +269,17 @@ func (h *md5Hash) Sum(in []byte) []byte {
269269}
270270
271271const (
272- sha5Magic = "md5\x01 "
273- sha5MarshaledSize = len (sha5Magic ) + 4 * 4 + 64 + 8
272+ md5Magic = "md5\x01 "
273+ md5MarshaledSize = len (md5Magic ) + 4 * 4 + 64 + 8
274274)
275275
276276func (h * md5Hash ) MarshalBinary () ([]byte , error ) {
277277 d := (* md5State )(h .shaState ())
278278 if d == nil {
279- return nil , errors .New ("crypto/sha1 : can't retrieve hash state" )
279+ return nil , errors .New ("crypto/md5 : can't retrieve hash state" )
280280 }
281- b := make ([]byte , 0 , sha5MarshaledSize )
282- b = append (b , sha5Magic ... )
281+ b := make ([]byte , 0 , md5MarshaledSize )
282+ b = append (b , md5Magic ... )
283283 b = appendUint32 (b , d .h [0 ])
284284 b = appendUint32 (b , d .h [1 ])
285285 b = appendUint32 (b , d .h [2 ])
@@ -291,17 +291,17 @@ func (h *md5Hash) MarshalBinary() ([]byte, error) {
291291}
292292
293293func (h * md5Hash ) UnmarshalBinary (b []byte ) error {
294- if len (b ) < len (sha5Magic ) || string (b [:len (sha5Magic )]) != sha5Magic {
295- return errors .New ("crypto/sha1 : invalid hash state identifier" )
294+ if len (b ) < len (md5Magic ) || string (b [:len (md5Magic )]) != md5Magic {
295+ return errors .New ("crypto/md5 : invalid hash state identifier" )
296296 }
297- if len (b ) != sha5MarshaledSize {
298- return errors .New ("crypto/sha1 : invalid hash state size" )
297+ if len (b ) != md5MarshaledSize {
298+ return errors .New ("crypto/md5 : invalid hash state size" )
299299 }
300300 d := (* md5State )(h .shaState ())
301301 if d == nil {
302- return errors .New ("crypto/sha1 : can't retrieve hash state" )
302+ return errors .New ("crypto/md5 : can't retrieve hash state" )
303303 }
304- b = b [len (sha5Magic ):]
304+ b = b [len (md5Magic ):]
305305 b , d .h [0 ] = consumeUint32 (b )
306306 b , d .h [1 ] = consumeUint32 (b )
307307 b , d .h [2 ] = consumeUint32 (b )
0 commit comments