aboutsummaryrefslogtreecommitdiff
path: root/crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto.h')
-rw-r--r--crypto.h34
1 files changed, 12 insertions, 22 deletions
diff --git a/crypto.h b/crypto.h
index c7ba816..28bf4eb 100644
--- a/crypto.h
+++ b/crypto.h
@@ -25,11 +25,16 @@
#include <gcrypt.h>
#include <stdint.h>
-/* --- RANDOM --- */
+extern gcry_mpi_point_t ec_gen;
+extern gcry_ctx_t ec_ctx;
-void brandt_rand_poll ();
+void brandt_crypto_init ();
+
+/* --- RANDOM --- */
+
+void brandt_rand_poll ();
/* --- HASHING --- */
@@ -41,31 +46,16 @@ struct brandt_hash_code {
void brandt_hash (const void *block, size_t size, struct brandt_hash_code *ret);
-
/* --- MPI --- */
void brandt_mpi_print_unsigned (void *buf, size_t size, gcry_mpi_t val);
-void brandt_mpi_scan_unsigned (gcry_mpi_t *result, const void *data,
- size_t size);
-
-
+void brandt_mpi_scan_unsigned (gcry_mpi_t *result, const void *data, size_t size);
-/* --- ECDHE --- */
-struct brandt_dhe_skey {
- unsigned char d[256 / 8];
-};
-
-struct brandt_dhe_pkey {
- unsigned char q_y[256 / 8];
-};
+/* --- EC --- */
-void brandt_ecdhe_key_create (struct brandt_dhe_skey *priv);
-void brandt_ecdhe_key_get_public (const struct brandt_dhe_skey *priv,
- struct brandt_dhe_pkey *pub);
-int brandt_ecdhe (const struct brandt_dhe_skey *priv,
- const struct brandt_dhe_pkey *pub,
- struct brandt_hash_code *key_material);
-void brandt_ecdhe_key_clear (struct brandt_dhe_skey *priv);
+void brandt_ec_skey_create (gcry_mpi_t* skey);
+void brandt_ec_pkey_compute (gcry_mpi_point_t* pkey, const gcry_mpi_t skey);
+void brandt_ec_keypair_create (gcry_mpi_point_t* pkey, gcry_mpi_t* skey);
#endif /* ifndef _BRANDT_CRYPTO_H */