hkdf.h 909 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef CRYPTO_HKDF_H_
  5. #define CRYPTO_HKDF_H_
  6. #include <stddef.h>
  7. #include <string>
  8. #include "base/containers/span.h"
  9. #include "base/strings/string_piece.h"
  10. #include "crypto/crypto_export.h"
  11. namespace crypto {
  12. CRYPTO_EXPORT
  13. std::string HkdfSha256(base::StringPiece secret,
  14. base::StringPiece salt,
  15. base::StringPiece info,
  16. size_t derived_key_size);
  17. CRYPTO_EXPORT
  18. std::vector<uint8_t> HkdfSha256(base::span<const uint8_t> secret,
  19. base::span<const uint8_t> salt,
  20. base::span<const uint8_t> info,
  21. size_t derived_key_size);
  22. } // namespace crypto
  23. #endif // CRYPTO_HKDF_H_