made sum_segment comments more explanatory
This commit is contained in:
parent
6e7cdde99d
commit
f754e43e19
@ -26,7 +26,7 @@ extern "C" {
|
||||
//MACROS
|
||||
#define WHY2_SUM_SEGMENT_SIZE 32 //SEGMENT SIZE FOR CALCULATING SUM
|
||||
#define WHY2_SUM_BASE_PRIME 31 //PRIME FOR SUM BASE
|
||||
#define WHY2_SUM_MOD_PRIME 4294967295UL //PRIME FOR SUM MODULUS
|
||||
#define WHY2_SUM_MOD_PRIME 4294967295UL //PRIME FOR SUM MODULUS; 2^32 - 1
|
||||
|
||||
//FUNCTIONS
|
||||
unsigned long long why2_sum_segment(char *input); //CALCULATE SUM++ FOR input; USED FOR PADDING SEED
|
||||
|
@ -21,7 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
unsigned long long why2_sum_segment(char *input) //I ABSOLUTELY DO NOT RECOMMEND USING THIS WITH LARGE KEYS!!!
|
||||
unsigned long long why2_sum_segment(char *input) //THE OUTPUT IS GOING TO GROW A LOT WITH LONG input, BUT IT SHOULDN'T BE A BIG PROBLEM. I TESTED FOR OVERFLOWS UP TO 4096-CHAR input AND ONLY GOT TO (14*10^(-7))% OF FULL ULL RANGE LMAO
|
||||
{
|
||||
unsigned long input_size = strlen(input);
|
||||
unsigned long segmented_input_size = ceil(input_size / (double) WHY2_SUM_SEGMENT_SIZE) * WHY2_SUM_SEGMENT_SIZE; //CALCULATE CLOSEST 32*n (OR WHY2_SUM_SEGMENT_SIZE*n, IF YOU WILL) TO input
|
||||
|
Loading…
x
Reference in New Issue
Block a user