File tree Expand file tree Collapse file tree 4 files changed +16
-12
lines changed
Expand file tree Collapse file tree 4 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 33#ifndef CRYPTO_H
44#define CRYPTO_H
55
6- #include < tier0/dbg.h> // for Assert & AssertMsg
7- // #include "tier1/passwordhash.h"
8- #include " keypair.h"
9- #include " steam/steamtypes.h" // Salt_t
6+ #include < tier0/platform.h>
107#include " crypto_constants.h"
8+ // #include <tier1/passwordhash.h>
9+ #include " keypair.h"
1110
12- const unsigned int k_cubMD5Hash = 16 ;
13- typedef unsigned char MD5Digest_t[k_cubMD5Hash];
14-
15- const unsigned int k_cubSHA256Hash = 32 ;
16- typedef unsigned char SHA256Digest_t[ k_cubSHA256Hash ];
17-
18- const unsigned int k_cubSHA1Hash = 20 ;
19- typedef uint8 SHADigest_t[ k_cubSHA1Hash ];
11+ class CUtlBuffer ;
2012
2113// Base class for symmetric encryption and decryption context.
2214// A context is used when you want to use the same encryption
Original file line number Diff line number Diff line change 11// ========= Copyright Valve LLC, All rights reserved. ========================
22#include " crypto.h"
3+ #include < tier0/dbg.h>
34
45#ifdef VALVE_CRYPTO_25519_DONNA
56
Original file line number Diff line number Diff line change 11// ========= Copyright Valve LLC, All rights reserved. ========================
22#include " crypto.h"
3+ #include < tier0/dbg.h>
34
45#ifdef STEAMNETWORKINGSOCKETS_CRYPTO_25519_OPENSSL
56
Original file line number Diff line number Diff line change 44#define CRYPTO_CONSTANTS_H
55#pragma once
66
7+ #include <steam/steamtypes.h>
8+
79const int k_nSymmetricBlockSize = 16 ; // AES block size (128 bits)
810const int k_nSymmetricIVSize = 12 ; // length of the IV (must be 12 for BCryptEncrypt/BCryptDecrypt, but OpenSSL is more flexible)
911const int k_nSymmetricGCMTagSize = 16 ; // length in GCM tag (must be 16 for BCryptEncrypt/BCryptDecrypt, but OpenSSL is more flexible)
@@ -18,11 +20,19 @@ const int k_cubRSAEncryptedBlockSize = 128;
1820const int k_cubRSAPlaintextBlockSize = 86 + 1 ; // assume plaintext is text, so add a byte for the trailing \0
1921const uint32 k_cubRSASignature = k_cubRSAEncryptedBlockSize ;
2022
23+ const uint32 k_cubRSA2048Signature = 256 ; // Signature length when using a 2048-bit RSA key
24+
2125const int k_nAESKeyLenMax = k_nSymmetricKeyLen ;
2226const int k_nAESKeyLenMaxEncoded = k_nAESKeyLenMax * 2 ;
2327const int k_nAESKeyBits = k_nSymmetricKeyLen * 8 ; // normal size of AES keys
2428const int k_cchMaxPassphrase = 128 ; // maximum size of a license passphrase
2529
2630const int k_nSHAHashStringLen = 40 ; // length of SHA1 hash when stored as a hex string
2731
32+ const unsigned int k_cubMD5Hash = 16 ;
33+ typedef unsigned char MD5Digest_t [k_cubMD5Hash ];
34+
35+ const unsigned int k_cubSHA256Hash = 32 ;
36+ typedef unsigned char SHA256Digest_t [ k_cubSHA256Hash ];
37+
2838#endif // CRYPTO_CONSTANTS_H
You can’t perform that action at this time.
0 commit comments