From f7e95217e936da34d7124aaced590692eb515923 Mon Sep 17 00:00:00 2001 From: Viktor Mladenovski Date: Fri, 20 May 2011 14:10:59 +0200 Subject: Initial contribution of loader_communication ST-Ericsson ID: 326913 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204 Change-Id: I171cfc2ee458a8a0a91a1916137d131f0f7ecee5 --- source/security_algorithms/SecurityAlgorithms.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 source/security_algorithms/SecurityAlgorithms.cpp (limited to 'source/security_algorithms/SecurityAlgorithms.cpp') diff --git a/source/security_algorithms/SecurityAlgorithms.cpp b/source/security_algorithms/SecurityAlgorithms.cpp new file mode 100644 index 0000000..1d92e57 --- /dev/null +++ b/source/security_algorithms/SecurityAlgorithms.cpp @@ -0,0 +1,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; +} -- cgit v1.2.3