VirtualBox

Changeset 33229 in vbox for trunk/include


Ignore:
Timestamp:
Oct 19, 2010 1:23:02 PM (14 years ago)
Author:
vboxsync
Message:

DIGEST_LEN, not STRING_LEN as the terminator is not included

File:
1 edited

Legend:

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

    r33228 r33229  
    3939#define RTSHA1_HASH_SIZE    20
    4040/** The length of a SHA-1 digest string. The terminator is not included. */
    41 #define RTSHA1_STRING_LEN  (40)
     41#define RTSHA1_DIGEST_LEN  (40)
    4242
    4343/**
     
    9797 * @param   pszDigest   Where to return the stringified digest.
    9898 * @param   cchDigest   The size of the output buffer. Should be at least
    99  *                      RTSHA1_STRING_LEN + 1 bytes.
     99 *                      RTSHA1_DIGEST_LEN + 1 bytes.
    100100 */
    101101RTDECL(int) RTSha1ToString(uint8_t const pabDigest[RTSHA1_HASH_SIZE], char *pszDigest, size_t cchDigest);
     
    142142#define RTSHA256_HASH_SIZE      32
    143143/** The length of a SHA-256 digest string. The terminator is not included. */
    144 #define RTSHA256_STRING_LEN     64
     144#define RTSHA256_DIGEST_LEN     64
    145145
    146146/**
     
    200200 * @param   pszDigest   Where to return the stringified digest.
    201201 * @param   cchDigest   The size of the output buffer. Should be at least
    202  *                      RTSHA256_STRING_LEN + 1 bytes.
     202 *                      RTSHA256_DIGEST_LEN + 1 bytes.
    203203 */
    204204RTDECL(int) RTSha256ToString(uint8_t const pabDigest[RTSHA256_HASH_SIZE], char *pszDigest, size_t cchDigest);
     
    221221#define RTSHA512_HASH_SIZE      64
    222222/** The length of a SHA-512 digest string. The terminator is not included. */
    223 #define RTSHA512_STRING_LEN     128
     223#define RTSHA512_DIGEST_LEN     128
    224224
    225225/**
     
    279279 * @param   pszDigest   Where to return the stringified digest.
    280280 * @param   cchDigest   The size of the output buffer. Should be at least
    281  *                      RTSHA512_STRING_LEN + 1 bytes.
     281 *                      RTSHA512_DIGEST_LEN + 1 bytes.
    282282 */
    283283RTDECL(int) RTSha512ToString(uint8_t const pabDigest[RTSHA512_HASH_SIZE], char *pszDigest, size_t cchDigest);
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