wxMaxima
Loading...
Searching...
No Matches
sha256.h
1/*
2** Name: sha256.h
3** Purpose: SHA-256 hashing
4** Copyright: (c) 2024-2024 Ulrich Telle
5** SPDX-License-Identifier: MIT
6*/
7
8// SHA-256. Adapted from LibTomCrypt (Public Domain).
9
10#pragma once
11#ifndef WXPDFDOC_CRYPTO_SHA256_H_
12#define WXPDFDOC_CRYPTO_SHA256_H_
13
14#include <cstdint>
15
16namespace wxpdfdoc {
17namespace crypto {
18
20{
21 std::uint64_t length;
22 std::uint32_t state[8];
23 std::uint32_t curlen;
24 unsigned char buf[64];
25};
26
27void sha_init(sha256_state& md);
28void sha_process(sha256_state& md, const void* in, std::uint32_t inlen);
29void sha_done(sha256_state& md, void* out);
30
31} // namespace crypto
32} // namespace wxpdfdoc
33
34#endif // WXPDFDOC_CRYPTO_SHA256_H_
Definition: sha256.h:20