-
Notifications
You must be signed in to change notification settings - Fork 1
/
myprog.cpp
43 lines (31 loc) · 912 Bytes
/
myprog.cpp
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
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <limits>
#include <vector>
#include <sstream>
#include <numeric>
#include <cmath>
#include <random>
#include "crypto++/cryptlib.h"
#include "crypto++/shake.h"
using CryptoPP::SHAKE128;
using namespace std;
int main() {
using namespace CryptoPP;
printf("Hello\n\n");
std::string msg = "Yoda said, Do or do not. There is not try.";
std::string digest;
SHAKE128 hash;
hash.Update((const byte*)msg.data(), msg.size());
digest.resize(hash.DigestSize());
hash.Final((byte*)&digest[0]);
std::cout << "Message: " << msg << std::endl;
std::cout << "Digest: ";
//StringSource(digest, true, new Redirector(encoder));
std::cout << std::endl;
return 0;
}
//g++ -I/usr/local/include myprog.cpp -o myprog.out -L/usr/local/lib -lcryptopp
//./myprog.out