|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #ifndef BPHYSTOOLS_SIMPLEENCRYPTER_H
15 #define BPHYSTOOLS_SIMPLEENCRYPTER_H
41 typedef unsigned long long int ULLI_t;
60 virtual std::pair<std::string, std::string>
genKeyPair();
74 virtual void setPubKey(std::string keystr);
243 #endif // BPHYSTOOLS_SIMPLEENCRYPTER_H
ULLI_t decryptFPECycle(ULLI_t a) const
Decrypt using format preserving encryption w.r.t.
virtual ULLI_t genPrime() const
Find a prime number.
SimpleEncrypter(const std::string &name="SimpleEncrypter")
Main constructor.
virtual ULLI_t encrypt(ULLI_t x)
Encrypt a positive integer value.
virtual std::pair< ULLI_t, ULLI_t > decodeKeyString(std::string str) const
Decode hex string to two integers.
virtual ULLI_t genDecryptionExponent(ULLI_t phi, ULLI_t e) const
Find decryption exponent.
virtual void setPubKey(std::string keystr)
Set public key.
virtual ULLI_t floatBitsToInt(float val) const
virtual std::pair< std::string, std::string > genKeyPair()
Generate private and public keys.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
ULLI_t encryptFPECycle(ULLI_t a) const
virtual ULLI_t genCoprime(ULLI_t n) const
Find a coprime number.
ULLI_t powerMod(ULLI_t a, ULLI_t d, ULLI_t n) const
Exponentiate a with d observing modulus n.
Provide simple asymmetric encryption for blinding of float values.
bool isOkForEnc()
Check setup readiness for encryption.
bool m_isOkForEnc
indicates that keys are set and range checks are ok
virtual void setPrivKey(std::string keystr)
Set private key.
ULLI_t decryptInternal(ULLI_t x) const
Decrypt integer (internal)
virtual ULLI_t greatestCommonDenominator(ULLI_t n1, ULLI_t n2) const
Find greatest common denominator.
virtual ~SimpleEncrypter()
Default destructor.
virtual bool isPrime(ULLI_t n) const
Check for being a prime number.
static const unsigned int m_MAXHEXDIGITS
maximum number of hex digits for key parts
virtual void genKeyPairInternal()
Class mimicking the AthMessaging class from the offline software.
static const ULLI_t m_MAXRANGE
unsigned long long int ULLI_t
virtual float intBitsToFloat(ULLI_t val) const
Interpret bits of integer as floating point number.
virtual std::string getPrivKey() const
Get private key.
virtual ULLI_t decrypt(ULLI_t x)
Decrypt a positive integer value.
ULLI_t encryptInternal(ULLI_t x) const
Encrypt integer (internal)
ULLI_t m_e
encryption exponent: public key part II
long long int LLI_t
Useful typedefs.
ULLI_t m_d
decryption exponent: private key part II
virtual std::string getPubKey() const
Get public key.
bool isOkForDec()
Check setup readiness for decryption.
virtual std::string keyToString(ULLI_t a, ULLI_t b) const
static const ULLI_t m_MINRANGE