~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/md5.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
 * Final wrapup - pad to 64-byte boundary with the bit pattern 
108
108
 * 1 0* (64-bit count of bits processed, MSB-first)
109
109
 */
110
 
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
 
110
void MD5Final(unsigned char digest[MD5LENGTH], struct MD5Context *ctx)
111
111
{
112
112
    unsigned count;
113
113
    unsigned char *p;
144
144
 
145
145
    MD5Transform(ctx->buf, (uint32_t *) ctx->in);
146
146
    byteReverse((unsigned char *) ctx->buf, 4);
147
 
    memcpy(digest, ctx->buf, 16);
 
147
    memcpy(digest, ctx->buf, MD5LENGTH);
148
148
    memset(ctx, 0, sizeof(*ctx));       /* In case it's sensitive */
149
149
}
150
150