-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shuffler.h
27 lines (24 loc) · 931 Bytes
/
Shuffler.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
#pragma once
#include <vector>
/**
* @brief The CShuffler class provides functions for shuffling and unshuffling data using a key.
*/
class CShuffler {
public:
/**
* @brief Shuffle the data using the provided key.
* @param key The key used for shuffling.
* @param data Pointer to the data to be shuffled.
* @param dataLen The length of the data in bytes.
* @return True if the shuffling is successful, false otherwise.
*/
static bool Shuffle(const std::vector<uint8_t>& key, uint8_t* data, uint64_t dataLen);
/**
* @brief Unshuffle the data using the provided key.
* @param key The key used for unshuffling.
* @param data Pointer to the data to be unshuffled.
* @param dataLen The length of the data in bytes.
* @return True if the unshuffling is successful, false otherwise.
*/
static bool Unshuffle(const std::vector<uint8_t>& key, uint8_t* data, uint64_t dataLen);
};