renamed why2_checksum_segment to why2_sum_segment
it isn't that safe to be considered a checksum and the name checksum can be misleading. i am going to use it for getting padding size
This commit is contained in:
parent
c71b5275b5
commit
c0e9381642
@ -28,7 +28,7 @@ extern "C" {
|
|||||||
#define WHY2_CHECKSUM_PRIME 11 //PRIME NUMBER FOR ROTATION
|
#define WHY2_CHECKSUM_PRIME 11 //PRIME NUMBER FOR ROTATION
|
||||||
|
|
||||||
//FUNCTIONS
|
//FUNCTIONS
|
||||||
unsigned long why2_checksum_segment(char *input); //TOO LONG TO EXPLAIN, DEAL WITH IT. TREAT IT LIKE A NORMAL CHECKSUM
|
unsigned long why2_sum_segment(char *input); //TOO LONG TO EXPLAIN, DEAL WITH IT. TREAT IT LIKE A NORMAL CHECKSUM
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
unsigned long why2_checksum_segment(char *input) //I ABSOLUTELY DO NOT RECOMMEND USING THIS WITH LARGE KEYS!!!
|
unsigned long why2_sum_segment(char *input) //I ABSOLUTELY DO NOT RECOMMEND USING THIS WITH LARGE KEYS!!!
|
||||||
{
|
{
|
||||||
unsigned long input_size = strlen(input);
|
unsigned long input_size = strlen(input);
|
||||||
unsigned long segmented_input_size = ceil(input_size / (double) WHY2_CHECKSUM_SEGMENT_SIZE) * WHY2_CHECKSUM_SEGMENT_SIZE; //CALCULATE CLOSEST 4*n TO input
|
unsigned long segmented_input_size = ceil(input_size / (double) WHY2_CHECKSUM_SEGMENT_SIZE) * WHY2_CHECKSUM_SEGMENT_SIZE; //CALCULATE CLOSEST 4*n TO input
|
||||||
|
Loading…
x
Reference in New Issue
Block a user