woody-woodpacker/rsa64/rsa.h

35 lines
542 B
C
Raw Normal View History

2024-04-09 14:55:13 +00:00
#ifndef _RSA_H
#define _RSA_H 1
#include <stdint.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#define RSA_BLOCK_SIZE 128
typedef struct bigint_s {
uint32_t *data;
size_t len;
} bigint_t;
typedef struct rsa_s {
bigint_t p;
bigint_t q;
} rsa_t;
void *protected_malloc(size_t size);
2024-05-23 11:21:06 +00:00
rsa_t rsa_generate_keys();
2024-04-09 14:55:13 +00:00
uint16_t generate_prime();
uint64_t pow_mod(uint64_t nn, uint64_t e, uint64_t mm);
uint16_t get_random_bytes(int fd);
2024-04-09 14:55:13 +00:00
#endif