2020-07-28 05:19:17 +03:00
|
|
|
#ifndef URCRYPT_H
|
|
|
|
#define URCRYPT_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2020-08-01 03:30:09 +03:00
|
|
|
#include <stdbool.h>
|
2020-07-31 00:40:47 +03:00
|
|
|
#include <string.h>
|
2020-08-06 02:06:04 +03:00
|
|
|
|
2020-07-28 05:19:17 +03:00
|
|
|
#include <ed25519.h>
|
|
|
|
#include <ge-additions.h>
|
|
|
|
|
2020-08-06 02:06:04 +03:00
|
|
|
#include <openssl/aes.h>
|
|
|
|
|
2020-07-31 20:50:46 +03:00
|
|
|
int urcrypt_ed_point_add(uint8_t a[32], uint8_t b[32], uint8_t out[32]);
|
2020-07-28 05:19:17 +03:00
|
|
|
int urcrypt_ed_scalarmult(uint8_t a[32], uint8_t b[32], uint8_t out[32]);
|
2020-07-31 21:55:02 +03:00
|
|
|
void urcrypt_ed_scalarmult_base(uint8_t a[32], uint8_t out[32]);
|
2020-08-01 00:21:02 +03:00
|
|
|
int urcrypt_ed_add_scalarmult_scalarmult_base(uint8_t a[32],
|
|
|
|
uint8_t a_point[32],
|
|
|
|
uint8_t b[32],
|
|
|
|
uint8_t out[32]);
|
2020-08-01 00:46:19 +03:00
|
|
|
int urcrypt_ed_add_double_scalarmult(uint8_t a[32],
|
|
|
|
uint8_t a_point[32],
|
|
|
|
uint8_t b[32],
|
|
|
|
uint8_t b_point[32],
|
|
|
|
uint8_t out[32]);
|
2020-08-06 02:06:04 +03:00
|
|
|
|
2020-08-01 02:31:56 +03:00
|
|
|
void urcrypt_ed_puck(uint8_t seed[32], uint8_t out[32]);
|
2020-08-01 02:56:39 +03:00
|
|
|
void urcrypt_ed_shar(uint8_t public[32], uint8_t seed[32], uint8_t out[32]);
|
2020-07-31 00:40:47 +03:00
|
|
|
void urcrypt_ed_sign(uint8_t *message,
|
|
|
|
size_t length,
|
|
|
|
uint8_t seed[32],
|
2020-08-01 02:31:56 +03:00
|
|
|
uint8_t out[64]);
|
2020-07-28 05:19:17 +03:00
|
|
|
|
2020-08-01 03:30:09 +03:00
|
|
|
bool urcrypt_ed_veri(uint8_t *message, size_t length,
|
|
|
|
uint8_t signature[64], uint8_t public[32]);
|
2020-08-06 02:06:04 +03:00
|
|
|
|
|
|
|
int urcrypt_aes_ecba_en(uint8_t key[16], uint8_t block[16], uint8_t out[16]);
|
|
|
|
int urcrypt_aes_ecba_de(uint8_t key[16], uint8_t block[16], uint8_t out[16]);
|
|
|
|
int urcrypt_aes_ecbb_en(uint8_t key[24], uint8_t block[16], uint8_t out[16]);
|
|
|
|
int urcrypt_aes_ecbb_de(uint8_t key[24], uint8_t block[16], uint8_t out[16]);
|
|
|
|
int urcrypt_aes_ecbc_en(uint8_t key[32], uint8_t block[16], uint8_t out[16]);
|
|
|
|
int urcrypt_aes_ecbc_de(uint8_t key[32], uint8_t block[16], uint8_t out[16]);
|
2020-07-28 05:19:17 +03:00
|
|
|
#endif
|