You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
35 lines
874 B
C
35 lines
874 B
C
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
/**
|
|
* Encryption keys: public and private
|
|
*/
|
|
struct FKeyPair
|
|
{
|
|
/** Public decryption key */
|
|
FEncryptionKey PublicKey;
|
|
/** Private encryption key */
|
|
FEncryptionKey PrivateKey;
|
|
|
|
friend FArchive& operator<<(FArchive& Ar, FKeyPair& Pair)
|
|
{
|
|
Ar << Pair.PublicKey.Exponent;
|
|
Ar << Pair.PublicKey.Modulus;
|
|
Ar << Pair.PrivateKey.Exponent;
|
|
Ar << Pair.PrivateKey.Modulus;
|
|
return Ar;
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Generates a prime number table where the max prime number value is less than MaxValue
|
|
*/
|
|
void GeneratePrimeNumberTable(int64 MaxValue, const TCHAR* Filename);
|
|
/**
|
|
* Generates a file with the encryption keys
|
|
*/
|
|
bool GenerateKeys(const TCHAR* KeyFilename);
|
|
|
|
bool SaveKeysToFile(const FKeyPair& Keys, const TCHAR* KeyFilename);
|
|
|
|
bool ReadKeysFromFile(const TCHAR* KeyFilename, FKeyPair& OutKeys); |