fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync/* $Id$ */
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync/** @file
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * IPRT - SHA-384 string functions.
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync */
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync/*
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * Copyright (C) 2009-2014 Oracle Corporation
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync *
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * available from http://www.virtualbox.org. This file is free software;
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * General Public License (GPL) as published by the Free Software
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync *
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * The contents of this file may alternatively be used under the terms
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * of the Common Development and Distribution License Version 1.0
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * VirtualBox OSE distribution, in which case the provisions of the
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * CDDL are applicable instead of those of the GPL.
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync *
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * You may elect to license modified versions of this file under the
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync * terms and conditions of either the GPL or the CDDL or both.
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync */
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync/*******************************************************************************
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync* Header Files *
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync*******************************************************************************/
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync#include "internal/iprt.h"
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync#include <iprt/sha.h>
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync#include <iprt/assert.h>
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync#include <iprt/err.h>
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync#include <iprt/string.h>
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsyncRTDECL(int) RTSha384ToString(uint8_t const pabDigest[RTSHA384_HASH_SIZE], char *pszDigest, size_t cchDigest)
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync{
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync return RTStrPrintHexBytes(pszDigest, cchDigest, &pabDigest[0], RTSHA384_HASH_SIZE, 0 /*fFlags*/);
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync}
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsyncRTDECL(int) RTSha384FromString(char const *pszDigest, uint8_t pabDigest[RTSHA384_HASH_SIZE])
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync{
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync return RTStrConvertHexBytes(RTStrStripL(pszDigest), &pabDigest[0], RTSHA384_HASH_SIZE, 0 /*fFlags*/);
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync}
fc659761c3e27dad0ce26752ed131bd4b7763b3bvboxsync