openGPMP
Open Source Mathematics Package
|
Class for encryption and decryption using the RedPike algorithm. More...
#include <redpike.hpp>
Public Member Functions | |
void | encrypt (uint32_t *x, const uint32_t *k) |
Encrypts the given data using the RedPike algorithm. More... | |
void | decrypt (uint32_t *x, const uint32_t *k) |
Decrypts the given data using the RedPike algorithm. More... | |
Private Member Functions | |
uint32_t | rotl (uint32_t X, int R) |
Performs left rotation on the given value. More... | |
uint32_t | rotr (uint32_t X, int R) |
Performs right rotation on the given value. More... | |
Private Attributes | |
uint32_t | CONST = 0x9E3779B9 |
Constant value used in the RedPike algorithm. More... | |
int | ROUNDS = 16 |
Number of rounds in the RedPike algorithm. More... | |
Class for encryption and decryption using the RedPike algorithm.
Definition at line 48 of file redpike.hpp.
void gpmp::nt::RedPike::decrypt | ( | uint32_t * | x, |
const uint32_t * | k | ||
) |
Decrypts the given data using the RedPike algorithm.
x | Pointer to the data to be decrypted |
k | Pointer to the key used for decryption |
Definition at line 70 of file redpike.cpp.
void gpmp::nt::RedPike::encrypt | ( | uint32_t * | x, |
const uint32_t * | k | ||
) |
Encrypts the given data using the RedPike algorithm.
x | Pointer to the data to be encrypted |
k | Pointer to the key used for encryption |
Definition at line 48 of file redpike.cpp.
|
private |
Performs left rotation on the given value.
X | Value to be rotated |
R | Number of bits to rotate left by |
Definition at line 40 of file redpike.cpp.
|
private |
Performs right rotation on the given value.
X | Value to be rotated |
R | Number of bits to rotate right by |
Definition at line 44 of file redpike.cpp.
|
private |
Constant value used in the RedPike algorithm.
Definition at line 70 of file redpike.hpp.
|
private |
Number of rounds in the RedPike algorithm.
Definition at line 75 of file redpike.hpp.