mirror of
https://github.com/Neo-Desktop/WindowsXPKg
synced 2024-11-16 19:00:59 +02:00
OWORD
This commit is contained in:
parent
eed869981b
commit
f11552509a
@ -8,12 +8,34 @@
|
|||||||
#include "header.h"
|
#include "header.h"
|
||||||
|
|
||||||
class BINK1998 {
|
class BINK1998 {
|
||||||
static void Unpack (QWORD (&pRaw)[2], DWORD &pSerial, DWORD &pHash, QWORD &pSignature);
|
static void Unpack(
|
||||||
static void Pack (QWORD (&pRaw)[2], DWORD pSerial, DWORD pHash, QWORD pSignature);
|
QWORD (&pRaw)[2],
|
||||||
|
DWORD &pSerial,
|
||||||
|
DWORD &pHash,
|
||||||
|
QWORD &pSignature
|
||||||
|
);
|
||||||
|
static void Pack(
|
||||||
|
QWORD (&pRaw)[2],
|
||||||
|
DWORD pSerial,
|
||||||
|
DWORD pHash,
|
||||||
|
QWORD pSignature
|
||||||
|
);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool Verify (EC_GROUP *eCurve, EC_POINT *basePoint, EC_POINT *publicKey, char (&pKey)[25]);
|
static bool Verify(
|
||||||
static void Generate (EC_GROUP *eCurve, EC_POINT *basePoint, BIGNUM *genOrder, BIGNUM *privateKey, DWORD pSerial, char (&pKey)[25]);
|
EC_GROUP *eCurve,
|
||||||
|
EC_POINT *basePoint,
|
||||||
|
EC_POINT *publicKey,
|
||||||
|
char (&pKey)[25]
|
||||||
|
);
|
||||||
|
static void Generate(
|
||||||
|
EC_GROUP *eCurve,
|
||||||
|
EC_POINT *basePoint,
|
||||||
|
BIGNUM *genOrder,
|
||||||
|
BIGNUM *privateKey,
|
||||||
|
DWORD pSerial,
|
||||||
|
char (&pKey)[25]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //WINDOWSXPKG_BINK1998_H
|
#endif //WINDOWSXPKG_BINK1998_H
|
||||||
|
@ -35,7 +35,7 @@ void BINK2002::Pack(
|
|||||||
QWORD (&pRaw)[2],
|
QWORD (&pRaw)[2],
|
||||||
DWORD pChannelID,
|
DWORD pChannelID,
|
||||||
DWORD pHash,
|
DWORD pHash,
|
||||||
QWORD &pSignature,
|
QWORD pSignature,
|
||||||
DWORD pAuthInfo
|
DWORD pAuthInfo
|
||||||
) {
|
) {
|
||||||
// AuthInfo [113..104] <- Signature [103..42] <- Hash [41..11] <- Channel ID [10..1] <- Upgrade [0]
|
// AuthInfo [113..104] <- Signature [103..42] <- Hash [41..11] <- Channel ID [10..1] <- Upgrade [0]
|
||||||
|
@ -8,12 +8,37 @@
|
|||||||
#include "header.h"
|
#include "header.h"
|
||||||
|
|
||||||
class BINK2002 {
|
class BINK2002 {
|
||||||
static void Unpack (QWORD (&pRaw)[2], DWORD &pChannelID, DWORD &pHash, QWORD &pSignature, DWORD &pAuthInfo);
|
static void Unpack(
|
||||||
static void Pack (QWORD (&pRaw)[2], DWORD pChannelID, DWORD pHash, QWORD &pSignature, DWORD pAuthInfo);
|
QWORD (&pRaw)[2],
|
||||||
|
DWORD &pChannelID,
|
||||||
|
DWORD &pHash,
|
||||||
|
QWORD &pSignature,
|
||||||
|
DWORD &pAuthInfo
|
||||||
|
);
|
||||||
|
static void Pack(
|
||||||
|
QWORD (&pRaw)[2],
|
||||||
|
DWORD pChannelID,
|
||||||
|
DWORD pHash,
|
||||||
|
QWORD pSignature,
|
||||||
|
DWORD pAuthInfo
|
||||||
|
);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool Verify (EC_GROUP *eCurve, EC_POINT *basePoint, EC_POINT *publicKey, char (&cdKey)[25]);
|
static bool Verify(
|
||||||
static void Generate (EC_GROUP *eCurve, EC_POINT *basePoint, BIGNUM *genOrder, BIGNUM *privateKey, DWORD pChannelID, DWORD pAuthInfo, char (&pKey)[25]);
|
EC_GROUP *eCurve,
|
||||||
|
EC_POINT *basePoint,
|
||||||
|
EC_POINT *publicKey,
|
||||||
|
char (&cdKey)[25]
|
||||||
|
);
|
||||||
|
static void Generate(
|
||||||
|
EC_GROUP *eCurve,
|
||||||
|
EC_POINT *basePoint,
|
||||||
|
BIGNUM *genOrder,
|
||||||
|
BIGNUM *privateKey,
|
||||||
|
DWORD pChannelID,
|
||||||
|
DWORD pAuthInfo,
|
||||||
|
char (&pKey)[25]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //WINDOWSXPKG_BINK2002_H
|
#endif //WINDOWSXPKG_BINK2002_H
|
||||||
|
@ -30,7 +30,7 @@ QWORD ConfirmationID::residue_sub(QWORD x, QWORD y)
|
|||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
inline QWORD ConfirmationID::__umul128(QWORD a, QWORD b, QWORD* hi)
|
inline QWORD ConfirmationID::__umul128(QWORD a, QWORD b, QWORD* hi)
|
||||||
{
|
{
|
||||||
DQWORD r = (DQWORD)a * (DQWORD)b;
|
OWORD r = (OWORD)a * (OWORD)b;
|
||||||
*hi = r >> 64;
|
*hi = r >> 64;
|
||||||
return (QWORD) r;
|
return (QWORD) r;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ typedef uint32_t DWORD;
|
|||||||
typedef uint64_t QWORD;
|
typedef uint64_t QWORD;
|
||||||
|
|
||||||
#ifdef __SIZEOF_INT128__
|
#ifdef __SIZEOF_INT128__
|
||||||
typedef unsigned __int128 DQWORD;
|
typedef unsigned __int128 OWORD;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
|
Loading…
Reference in New Issue
Block a user