aboutsummaryrefslogtreecommitdiff
path: root/src/crypto.hh
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-20 06:00:16 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-20 06:00:16 -0300
commitd3b92e110a06c6bb2bc0214319b390059bdf7c4a (patch)
tree51293060ad930091625645cc62a1df26eb90fa59 /src/crypto.hh
parentbd3a6a04601749cbde007eaabf803fb602ee2783 (diff)
downloadgame-d3b92e110a06c6bb2bc0214319b390059bdf7c4a.tar.gz
game-d3b92e110a06c6bb2bc0214319b390059bdf7c4a.zip
more work on `communication.cc`
Diffstat (limited to 'src/crypto.hh')
-rw-r--r--src/crypto.hh37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/crypto.hh b/src/crypto.hh
index e90996c..7561ce5 100644
--- a/src/crypto.hh
+++ b/src/crypto.hh
@@ -6,28 +6,28 @@
// TODO(fusion): We might want to scrap this implementation and use OpenSSL instead.
struct vlong_flex_unit{
- uint32 n;
- uint32 *a;
- uint32 z;
+ uint32 n;
+ uint32 *a;
+ uint32 z;
};
struct vlong_value: vlong_flex_unit {
- uint32 share;
+ uint32 share;
};
struct vlong{
- vlong_value *value;
- int negative;
+ vlong_value *value;
+ int negative;
};
struct vlong_montgomery{
- vlong R;
- vlong R1;
- vlong m;
- vlong n1;
- vlong T;
- vlong k;
- uint32 N;
+ vlong R;
+ vlong R1;
+ vlong m;
+ vlong n1;
+ vlong T;
+ vlong k;
+ uint32 N;
};
struct TRSAPrivateKey{
@@ -37,16 +37,17 @@ struct TRSAPrivateKey{
// DATA
// =================
- vlong m_PrimeP;
- vlong m_PrimeQ;
- vlong m_U;
- vlong m_DP;
- vlong m_DQ;
+ vlong m_PrimeP;
+ vlong m_PrimeQ;
+ vlong m_U;
+ vlong m_DP;
+ vlong m_DQ;
};
struct TXTEASymmetricKey{
TXTEASymmetricKey(void);
~TXTEASymmetricKey(void);
+ void init(TReadBuffer *Buffer);
void encrypt(uint8 *Data); // single 8 bytes block
void decrypt(uint8 *Data); // single 8 bytes block