]> git.meshlink.io Git - meshlink/blobdiff - src/ecdsa.h
Avoid allocating packet buffers unnecessarily.
[meshlink] / src / ecdsa.h
index ef10fe718363b7f87220eeae141d6492c1940f7c..6da3d2f403ebec58d4ff10a5b9c3f3e3c751b39d 100644 (file)
@@ -1,6 +1,9 @@
+#ifndef MESHLINK_ECDSA_H
+#define MESHLINK_ECDSA_H
+
 /*
     ecdsa.h -- ECDSA key handling
-    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io>
+    Copyright (C) 2014, 2017 Guus Sliepen <guus@meshlink.io>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef __MESHLINK_ECDSA_H__
-#define __MESHLINK_ECDSA_H__
-
 #ifndef __MESHLINK_ECDSA_INTERNAL__
 typedef struct ecdsa ecdsa_t;
 #endif
 
+extern ecdsa_t *ecdsa_set_private_key(const void *p) __attribute__((__malloc__));
 extern ecdsa_t *ecdsa_set_base64_public_key(const char *p) __attribute__((__malloc__));
+extern ecdsa_t *ecdsa_set_public_key(const void *p) __attribute__((__malloc__));
 extern char *ecdsa_get_base64_public_key(ecdsa_t *ecdsa);
+extern const void *ecdsa_get_public_key(ecdsa_t *ecdsa) __attribute__((__malloc__));
+extern const void *ecdsa_get_private_key(ecdsa_t *ecdsa) __attribute__((__malloc__));
 extern ecdsa_t *ecdsa_read_pem_public_key(FILE *fp) __attribute__((__malloc__));
 extern ecdsa_t *ecdsa_read_pem_private_key(FILE *fp) __attribute__((__malloc__));
 extern size_t ecdsa_size(ecdsa_t *ecdsa);