--- gvpe/src/global.h 2011/03/06 21:01:37 1.25 +++ gvpe/src/global.h 2013/07/13 04:10:29 1.26 @@ -1,6 +1,6 @@ /* global.h -- global variables and constants - Copyright (C) 2003-2008 Marc Lehmann + Copyright (C) 2003-2013 Marc Lehmann This file is part of GVPE. @@ -43,6 +43,8 @@ #define PROTOCOL_MAJOR 0 #define PROTOCOL_MINOR 1 +#define SEED_SIZE 64 // how many octets to seed rng with + #define RSA_KEYBITS 1280 // must be >= 1280 and divisible by 8 #define RSA_KEYLEN ((RSA_KEYBITS) >> 3) #define RSA_OVERHEAD (41 + 1) // well, no define for OAEP in openssl @@ -57,14 +59,16 @@ #define CIPHER ENABLE_CIPHER () #define CIPHER_KEYLEN (EVP_CIPHER_key_length (CIPHER)) #define DIGEST ENABLE_DIGEST () -#define HMAC_KEYLEN (256 >> 3) // number of bits used for the HMAC key (also change CHG_HMAC_KEY) +#define HMAC_KEYLEN (256 >> 3) // number of bits used for the HMAC key #define WINDOWSIZE 512 // sliding window size #define MAX_SEQNO (0xfffffff0U - WINDOWSIZE * 8) -#define CHG_SEQNO 0 // where the seqno starts within the rsa challenge -#define CHG_CIPHER_KEY 4 // where the key starts within the rsa challenge -#define CHG_HMAC_KEY 86 // where the key starts within the rsa challenge (256 bits at the end!) +#define CHG_SEQNO 0 // where the seqno starts within the rsa challenge +#define CHG_CIPHER_KEY (CHG_SEQNO + 4) // where the key starts within the rsa challenge +//#define CHG_HMAC_KEY (CHG_CIPHER_KEY + CIPHER_KEYLEN) // where the key starts within the rsa challenge +#define CHG_HMAC_KEY 86 // where the key starts within the rsa challenge +// 872 rsa bits used // hdr seq len hmac MAC MAC #define VPE_OVERHEAD (4 + 4 + 4 + RAND_SIZE + HMACLENGTH - 6 - 6)