VirtualBox

Changeset 21918 in vbox


Ignore:
Timestamp:
Jul 31, 2009 3:42:31 PM (15 years ago)
Author:
vboxsync
Message:

IPRT: Added RTMd5().

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/md5.h

    r20374 r21918  
    5757
    5858/**
     59 * Compute the MD5 hash of the data.
     60 *
     61 * @param   pvBuf       Pointer to data.
     62 * @param   cbBuf       Length of data (in bytes).
     63 * @param   pabDigest   Where to store the hash.
     64 *                      (What's passed is a pointer to the caller's buffer.)
     65 */
     66RTDECL(void) RTMd5(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTMD5HASHSIZE]);
     67
     68/**
    5969 * Initialize MD5 context.
    6070 *
     
    7585 * Compute the MD5 hash of the data.
    7686 *
    77  * @param   pabDigest  Where to store the hash.
    78  *                     (What's passed is a pointer to the caller's buffer.)
    79  * @param   pCtx       Pointer to the MD5 context.
     87 * @param   pabDigest   Where to store the hash.
     88 *                      (What's passed is a pointer to the caller's buffer.)
     89 * @param   pCtx        Pointer to the MD5 context.
    8090 */
    8191RTDECL(void) RTMd5Final(uint8_t pabDigest[RTMD5HASHSIZE], PRTMD5CONTEXT pCtx);
     
    8595/** @} */
    8696
    87 #endif /* !__iprt_md5_h__ */
     97#endif
     98
  • trunk/src/VBox/Runtime/common/checksum/md5.cpp

    r21337 r21918  
    205205}
    206206RT_EXPORT_SYMBOL(RTMd5Final);
     207
     208
     209RTDECL(void) RTMd5(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTMD5HASHSIZE])
     210{
     211    RTMD5CONTEXT Ctx;
     212    RTMd5Init(&Ctx);
     213    RTMd5Update(&Ctx, pvBuf, cbBuf);
     214    RTMd5Final(pabDigest, &Ctx);
     215}
     216RT_EXPORT_SYMBOL(RTMd5);
    207217
    208218
     
    306316    buf[3] += d;
    307317}
     318
     319
     320
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette