cleaned up logs, added 128bit logger started working on second phase of rsa: keygen
This commit is contained in:
25
helper.c
Normal file
25
helper.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void print_uint128(unsigned __int128 n) {
|
||||
if (n == 0) {
|
||||
printf("0\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// A 128-bit number can have up to 39 decimal digits
|
||||
char buffer[40];
|
||||
int i = 0;
|
||||
|
||||
// Extract digits from right to left
|
||||
while (n > 0) {
|
||||
buffer[i++] = (n % 10) + '0'; // Convert math digit to character
|
||||
n /= 10;
|
||||
}
|
||||
|
||||
// Print them in reverse order (left to right)
|
||||
while (i > 0) {
|
||||
putchar(buffer[--i]);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
Reference in New Issue
Block a user