Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FEncryption Namespace Reference

Functions

template<typename IntType >
static IntType CalculateGCD (IntType ValueA, IntType ValueB)
 
template<typename IntType >
static IntType CalculateMultiplicativeInverseOfExponent (IntType Exponent, IntType Totient)
 
template<typename IntType >
static void GenerateKeyPair (const IntType &P, const IntType &Q, FEncryptionKey &PublicKey, FEncryptionKey &PrivateKey)
 
template<typename IntType >
static IntType ModularPow (IntType Base, IntType Exponent, IntType Modulus)
 
template<typename IntType >
static void EncryptBytes (IntType *EncryptedData, const uint8 *Data, const int64 DataLength, const FEncryptionKey &EncryptionKey)
 
template<typename IntType >
static void DecryptBytes (uint8 *DecryptedData, const IntType *Data, const int64 DataLength, const FEncryptionKey &DecryptionKey)
 
static void EncryptSignature (const FDecryptedSignature &InUnencryptedSignature, FEncryptedSignature &OutEncryptedSignature, const FEncryptionKey &EncryptionKey)
 
static void DecryptSignature (const FEncryptedSignature &InEncryptedSignature, FDecryptedSignature &OutUnencryptedSignature, const FEncryptionKey &EncryptionKey)
 

Detailed Description

Math utils for encryption.

Function Documentation

◆ CalculateGCD()

template<typename IntType >
static IntType FEncryption::CalculateGCD ( IntType ValueA,
IntType ValueB )
static

Greatest common divisor of ValueA and ValueB.

Definition at line 1053 of file BigInt.h.

◆ CalculateMultiplicativeInverseOfExponent()

template<typename IntType >
static IntType FEncryption::CalculateMultiplicativeInverseOfExponent ( IntType Exponent,
IntType Totient )
static

Multiplicative inverse of exponent using extended GCD algorithm.

Extended gcd: ax + by = gcd(a, b), where a = exponent, b = fi(n), gcd(a, b) = gcd(e, fi(n)) = 1, fi(n) is the Euler's totient function of n We only care to find d = x, which is our multiplicatve inverse of e (a).

Definition at line 1106 of file BigInt.h.

◆ DecryptBytes()

template<typename IntType >
static void FEncryption::DecryptBytes ( uint8 * DecryptedData,
const IntType * Data,
const int64 DataLength,
const FEncryptionKey & DecryptionKey )
static

Decrypts a stream of bytes

Definition at line 1203 of file BigInt.h.

◆ DecryptSignature()

static void FEncryption::DecryptSignature ( const FEncryptedSignature & InEncryptedSignature,
FDecryptedSignature & OutUnencryptedSignature,
const FEncryptionKey & EncryptionKey )
static

Definition at line 1302 of file BigInt.h.

◆ EncryptBytes()

template<typename IntType >
static void FEncryption::EncryptBytes ( IntType * EncryptedData,
const uint8 * Data,
const int64 DataLength,
const FEncryptionKey & EncryptionKey )
static

Encrypts a stream of bytes

Definition at line 1191 of file BigInt.h.

◆ EncryptSignature()

static void FEncryption::EncryptSignature ( const FDecryptedSignature & InUnencryptedSignature,
FEncryptedSignature & OutEncryptedSignature,
const FEncryptionKey & EncryptionKey )
static

Definition at line 1297 of file BigInt.h.

◆ GenerateKeyPair()

template<typename IntType >
static void FEncryption::GenerateKeyPair ( const IntType & P,
const IntType & Q,
FEncryptionKey & PublicKey,
FEncryptionKey & PrivateKey )
static

Generate Key Pair for encryption and decryption.

Definition at line 1146 of file BigInt.h.

◆ ModularPow()

template<typename IntType >
static IntType FEncryption::ModularPow ( IntType Base,
IntType Exponent,
IntType Modulus )
static

Raise Base to power of Exponent in mod Modulus.

Definition at line 1171 of file BigInt.h.