blob: 281e2f273ddeac493200e4d95a677b2e7360f7c3 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Davide Pesavento10b24be2017-07-12 23:23:46 -04002/*
Davide Pesavento791badb2017-02-03 02:03:18 -05003 * Copyright (c) 2013-2017 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Jeff Thompson3af7e792013-08-23 14:22:11 -070020 */
21
Alexander Afanasyevd409d592014-01-28 18:36:38 -080022#ifndef NDN_UTIL_CRYPTO_HPP
23#define NDN_UTIL_CRYPTO_HPP
24
Davide Pesavento10b24be2017-07-12 23:23:46 -040025/**
26 * @file
27 * @deprecated use <ndn-cxx/util/digest.hpp>
28 */
29
30#include "digest.hpp"
Jeff Thompson3af7e792013-08-23 14:22:11 -070031
Alexander Afanasyevd409d592014-01-28 18:36:38 -080032namespace ndn {
Yingdi Yu21157162014-02-28 13:02:34 -080033namespace crypto {
34
Davide Pesavento10b24be2017-07-12 23:23:46 -040035/**
36 * @brief number of octets in a SHA256 digest
37 * @deprecated use ndn::util::Sha256::DIGEST_SIZE
38 */
39DEPRECATED(const size_t SHA256_DIGEST_SIZE) = util::Sha256::DIGEST_SIZE;
Yingdi Yu21157162014-02-28 13:02:34 -080040
41/**
Davide Pesavento791badb2017-02-03 02:03:18 -050042 * @brief Compute the SHA-256 digest of data.
Yingdi Yu110881d2014-03-04 18:27:29 -080043 *
Yingdi Yu21157162014-02-28 13:02:34 -080044 * @param data Pointer to the input byte array.
45 * @param dataLength The length of data.
Davide Pesavento791badb2017-02-03 02:03:18 -050046 * @return A pointer to a buffer of SHA256_DIGEST_SIZE bytes.
Davide Pesavento10b24be2017-07-12 23:23:46 -040047 *
48 * @deprecated use ndn::util::Sha256::computeDigest()
Yingdi Yu21157162014-02-28 13:02:34 -080049 */
Davide Pesavento10b24be2017-07-12 23:23:46 -040050DEPRECATED()
51inline ConstBufferPtr
52computeSha256Digest(const uint8_t* data, size_t dataLength)
53{
54 return util::Sha256::computeDigest(data, dataLength);
55}
Alexander Afanasyev2fa59392016-07-29 17:24:23 -070056
Yingdi Yu21157162014-02-28 13:02:34 -080057} // namespace crypto
Alexander Afanasyevd409d592014-01-28 18:36:38 -080058} // namespace ndn
Jeff Thompson3af7e792013-08-23 14:22:11 -070059
Alexander Afanasyevd409d592014-01-28 18:36:38 -080060#endif // NDN_UTIL_CRYPTO_HPP