-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sha3.hpp.md
68 lines (40 loc) · 1.2 KB
/
sha3.hpp.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
```cpp
/*
<fpaste ../../src/copyright.md>
*/
#pragma once
#include <filesystem>
#include "lxr/key256.hpp"
#include "sizebounded/sizebounded.hpp"
````
namespace [lxr](namespace.list) {
# class Sha3_256
// implementations exist for [OpenSSL](sha3_openssl.cpp.md)
// and [Crypto++](sha3_cryptopp.cpp.md)
{
>public:
>static Key256 [hash](sha3_functions.cpp.md)(std::string const &);
>static Key256 [hash](sha3_functions.cpp.md)(const char[], int length);
>static Key256 [hash](sha3_functions.cpp.md)(std::filesystem::path const &);
>Sha3_256();
>~Sha3_256();
>static constexpr unsigned int datasz { 1024*64 };
>int [process](sha3_functions.cpp.md)(int inlen, sizebounded<unsigned char, Sha3_256::datasz> const & inbuf);
>Key256 [finish](sha3_functions.cpp.md)();
>private:
>struct pimpl;
>std::unique_ptr<pimpl> _pimpl;
>Sha3_256(Sha3_256 const &) = delete;
>Sha3_256 & operator=(Sha3_256 const &) = delete;
};
```cpp
} // namespace
```
# // C binding interface
```cpp
#include "lxr/lxr-cbindings.hpp"
```
extern `"C"` EXPORT
CKey256* [hash_Sha3_256](sha3_cbindings.cpp.md)(int len, const char *s);
extern `"C"` EXPORT
CKey256* [filehash_Sha3_256](sha3_cbindings.cpp.md)(const char * fp);