-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcommon.h
31 lines (21 loc) · 910 Bytes
/
common.h
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
#ifndef COMMON_H
#define COMMON_H
#include <stdexcept>
#include <map>
#include <vector>
#include <string>
#include <tuple>
extern std::string sdk_token;
const uint32_t IVLengthInBytes = 12;
const uint32_t AESKeyLengthInBytes = 32;
const uint32_t AESKeyWithIVLengthInBytes = AESKeyLengthInBytes + IVLengthInBytes;
const uint32_t AETagSizeInBytes = 2;
constexpr int OPENSSL_SUCCESS = 1;
constexpr int BMP_HEADER_SIZE = 54;
std::vector<uint8_t> xorVectors(const std::vector<uint8_t> otp, const std::vector<uint8_t> &data);
std::string byteVecToHexStr(std::vector<uint8_t>& bytes);
size_t hexCharToInt(char input);
std::vector<uint8_t> hexStrToByteVec(std::string& str);
std::string curlRequest(const std::string& fqdn, const std::string& filename, const std::vector<std::string>& headers);
void uploadFileToCodespace(const std::string& filename, const std::string& codespaceName);
#endif /* COMMON_H */