VirtualBox

Ignore:
Timestamp:
Jul 3, 2014 6:39:21 PM (10 years ago)
Author:
vboxsync
Message:

Added the odd sha-2 algorithms to RTCrDigest and extended the testcases to cover them. Added VBOX_WITH_ALT_HASH_CODE for avoiding the OpenSSL code even for VBoxRT.dll/so/dylib.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/sha224str.cpp

    r51837 r51856  
    11/* $Id$ */
    22/** @file
    3  * IPRT - SHA-256 string functions.
     3 * IPRT - SHA-224 string functions.
    44 */
    55
    66/*
    7  * Copyright (C) 2009-2010 Oracle Corporation
     7 * Copyright (C) 2009-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737
    3838
    39 RTDECL(int) RTSha256ToString(uint8_t const pabDigest[RTSHA256_HASH_SIZE], char *pszDigest, size_t cchDigest)
     39RTDECL(int) RTSha224ToString(uint8_t const pabDigest[RTSHA224_HASH_SIZE], char *pszDigest, size_t cchDigest)
    4040{
    41     return RTStrPrintHexBytes(pszDigest, cchDigest, &pabDigest[0], RTSHA256_HASH_SIZE, 0 /*fFlags*/);
     41    return RTStrPrintHexBytes(pszDigest, cchDigest, &pabDigest[0], RTSHA224_HASH_SIZE, 0 /*fFlags*/);
    4242}
    4343
    4444
    45 RTDECL(int) RTSha256FromString(char const *pszDigest, uint8_t pabDigest[RTSHA256_HASH_SIZE])
     45RTDECL(int) RTSha224FromString(char const *pszDigest, uint8_t pabDigest[RTSHA224_HASH_SIZE])
    4646{
    47     return RTStrConvertHexBytes(RTStrStripL(pszDigest), &pabDigest[0], RTSHA256_HASH_SIZE, 0 /*fFlags*/);
     47    return RTStrConvertHexBytes(RTStrStripL(pszDigest), &pabDigest[0], RTSHA224_HASH_SIZE, 0 /*fFlags*/);
    4848}
    4949
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