crypto/md5.c
2024-05-14 00:20:29 +02:00

33 lines
630 B
C

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
size_t get_len(const char *in) {
return strlen(in)*8;
}
void convertToBinary(unsigned a) {
/* step 1 */
if (a > 1) convertToBinary(a / 2);
/* step 2 */
printf("%d", a % 2);
}
char *wrap(const uint32_t *in, size_t len) {
size_t bitlen = len*8;
uint32_t *hash[16] = malloc(((bitlen+1+64)/512+((bitlen+1+64)%512>0))*16*32/8);
for (int i = 0; i < len; i++) {
hash[i/16][i%16] = in[i]
}
hash[(len/512+(len%512>0))/16][(len/512+(len%512>0))%16] += 1;
hash[][]
}
int main(int argc, char *argv[argc]) {
wrap("1");
}