summaryrefslogtreecommitdiff
path: root/source/security_algorithms/SecurityAlgorithms.cpp
blob: 1d92e579e8e74166e91c1ced113bd73ee3e40c29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/******************************************************************************
*
* Copyright (C) ST-Ericsson SA 2011
* License terms: 3-clause BSD license
*
******************************************************************************/
#include "SecurityAlgorithms.h"
#include "sha2.h"

int SecurityAlgorithms::SHA256(unsigned char *pData, unsigned long ulDataLen, unsigned char *pDigest)
{
    SHA256_CTX	c256;
	SHA256_Init(&c256);
	SHA256_Update(&c256, pData, ulDataLen);
	SHA256_Final(pDigest, &c256);

	return 0;
}