From 711628fbff8bd0b529066eac0d6bdcc328f2ebe3 Mon Sep 17 00:00:00 2001
From: Uros Majstorovic <majstor@majstor.org>
Date: Sat, 6 Jun 2020 14:28:01 +0200
Subject: ecp_rng_t typedef fixed

---
 code/ecp/core.h          | 4 ++--
 code/ecp/cr.h            | 4 ++--
 code/ecp/crypto/crypto.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

(limited to 'code/ecp')

diff --git a/code/ecp/core.h b/code/ecp/core.h
index 419b563..7e37881 100644
--- a/code/ecp/core.h
+++ b/code/ecp/core.h
@@ -149,7 +149,7 @@ struct ECPFragIter;
 #include "rbuf.h"
 #endif
 
-typedef int ecp_rng_t (void *, size_t);
+typedef int (*ecp_rng_t) (void *, size_t);
 
 typedef int ecp_conn_handler_new_t (struct ECPSocket *s, struct ECPConnection *p, unsigned char *msg, size_t sz, struct ECPConnection **c);
 typedef ssize_t ecp_conn_handler_msg_t (struct ECPConnection *c, ecp_seq_t s, unsigned char t, unsigned char *msg, ssize_t sz, struct ECP2Buffer *b);
@@ -237,7 +237,7 @@ typedef struct ECPSockCTable {
 } ECPSockCTable;
 
 typedef struct ECPContext {
-    ecp_rng_t *rng;
+    ecp_rng_t rng;
     ecp_conn_alloc_t *conn_alloc;
     ecp_conn_free_t *conn_free;
     ECPConnHandler *handler[ECP_MAX_CTYPE];
diff --git a/code/ecp/cr.h b/code/ecp/cr.h
index 05a95d7..a8d0dea 100644
--- a/code/ecp/cr.h
+++ b/code/ecp/cr.h
@@ -1,4 +1,4 @@
-int ecp_cr_dh_mkpair(ecp_dh_public_t *pub, ecp_dh_private_t *priv, ecp_rng_t *rand_buf);
+int ecp_cr_dh_mkpair(ecp_dh_public_t *pub, ecp_dh_private_t *priv, ecp_rng_t rand_buf);
 int ecp_cr_dh_shsec(ecp_aead_key_t *shared, ecp_dh_public_t *pub, ecp_dh_private_t *priv);
 unsigned char *ecp_cr_dh_pub_get_buf(ecp_dh_public_t *p);
 void ecp_cr_dh_pub_to_buf(unsigned char *b, ecp_dh_public_t *p);
@@ -8,6 +8,6 @@ unsigned int ecp_cr_dh_pub_hash_fn(unsigned char *p);
 int ecp_cr_dh_pub_hash_eq(unsigned char *p1, unsigned char *p2);
 ssize_t ecp_cr_aead_enc(unsigned char *ct, size_t cl, unsigned char *pt, size_t pl, ecp_aead_key_t *k, unsigned char *n);
 ssize_t ecp_cr_aead_dec(unsigned char *pt, size_t pl, unsigned char *ct, size_t cl, ecp_aead_key_t *k, unsigned char *n) ;
-int ecp_cr_dsa_mkpair(ecp_dsa_public_t *pub, ecp_dsa_private_t *priv, ecp_rng_t *rand_buf);
+int ecp_cr_dsa_mkpair(ecp_dsa_public_t *pub, ecp_dsa_private_t *priv, ecp_rng_t rand_buf);
 int ecp_cr_dsa_sign(unsigned char *sig, unsigned char *m, size_t ml, ecp_dsa_public_t *p, ecp_dsa_private_t *s) ;
 int ecp_cr_dsa_verify(unsigned char *m, size_t ml, unsigned char *sig, ecp_dsa_public_t *p);
diff --git a/code/ecp/crypto/crypto.c b/code/ecp/crypto/crypto.c
index fd3fc9b..ae0b3d3 100644
--- a/code/ecp/crypto/crypto.c
+++ b/code/ecp/crypto/crypto.c
@@ -3,7 +3,7 @@
 
 #include <curve25519.h>
 
-int ecp_cr_dh_mkpair(ecp_dh_public_t *pub, ecp_dh_private_t *priv, ecp_rng_t *rand_buf) {
+int ecp_cr_dh_mkpair(ecp_dh_public_t *pub, ecp_dh_private_t *priv, ecp_rng_t rand_buf) {
     int rv = X25519_keypair(*pub, *priv, rand_buf);
     if (!rv) return ECP_ERR;
     return ECP_OK;
@@ -53,7 +53,7 @@ ssize_t ecp_cr_aead_dec(unsigned char *pt, size_t pl, unsigned char *ct, size_t
     return ol;
 }
 
-int ecp_cr_dsa_mkpair(ecp_dsa_public_t *pub, ecp_dsa_private_t *priv, ecp_rng_t *rand_buf) {
+int ecp_cr_dsa_mkpair(ecp_dsa_public_t *pub, ecp_dsa_private_t *priv, ecp_rng_t rand_buf) {
     unsigned char key[2*ECP_DSA_SIZE_KEY];    
 
     int rv = ED25519_keypair(*pub, key, rand_buf);
-- 
cgit v1.2.3