summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-06-06 14:28:01 +0200
committerUros Majstorovic <majstor@majstor.org>2020-06-06 14:28:01 +0200
commit711628fbff8bd0b529066eac0d6bdcc328f2ebe3 (patch)
tree6b7bccbeeb0cb5fb9f14052b892a4ae013a2c6e9
parent7c253d76ff15e81a4c45f828176d7d24b99132e3 (diff)
ecp_rng_t typedef fixed
-rw-r--r--code/ecp/core.h4
-rw-r--r--code/ecp/cr.h4
-rw-r--r--code/ecp/crypto/crypto.c4
3 files changed, 6 insertions, 6 deletions
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);