summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/crypto_api.h
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2013-12-06 13:39:49 +0000
committermarkus <markus@openbsd.org>2013-12-06 13:39:49 +0000
commit8ffbcf6d17e8775510029e60a52819f50c2b6e51 (patch)
treea5e7d241214bd17ce28800908b837349ad6cebe4 /usr.bin/ssh/crypto_api.h
parentnew private key format, bcrypt as KDF by default; details in PROTOCOL.key; (diff)
downloadwireguard-openbsd-8ffbcf6d17e8775510029e60a52819f50c2b6e51.tar.xz
wireguard-openbsd-8ffbcf6d17e8775510029e60a52819f50c2b6e51.zip
support ed25519 keys (hostkeys and user identities) using the public domain
ed25519 reference code from SUPERCOP, see http://ed25519.cr.yp.to/software.html feedback, help & ok djm@
Diffstat (limited to 'usr.bin/ssh/crypto_api.h')
-rw-r--r--usr.bin/ssh/crypto_api.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/usr.bin/ssh/crypto_api.h b/usr.bin/ssh/crypto_api.h
new file mode 100644
index 00000000000..633463dca97
--- /dev/null
+++ b/usr.bin/ssh/crypto_api.h
@@ -0,0 +1,43 @@
+/* $OpenBSD: crypto_api.h,v 1.1 2013/12/06 13:39:49 markus Exp $ */
+
+/* Placed in the public domain. */
+
+#ifndef crypto_api_h
+#define crypto_api_h
+
+#include <stdint.h>
+#include <stdlib.h>
+
+typedef int32_t crypto_int32;
+typedef uint32_t crypto_uint32;
+
+#define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
+
+#define crypto_hashblocks_sha512_STATEBYTES 64U
+#define crypto_hashblocks_sha512_BLOCKBYTES 128U
+
+int crypto_hashblocks_sha512(unsigned char *, const unsigned char *,
+ unsigned long long);
+
+#define crypto_hash_sha512_BYTES 64U
+
+int crypto_hash_sha512(unsigned char *, const unsigned char *,
+ unsigned long long);
+
+int crypto_verify_32(const unsigned char *, const unsigned char *);
+
+#define crypto_sign_BYTES crypto_sign_ed25519_BYTES
+#define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES
+#define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES
+
+#define crypto_sign_ed25519_SECRETKEYBYTES 64U
+#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
+#define crypto_sign_ed25519_BYTES 64U
+
+int crypto_sign_ed25519(unsigned char *, unsigned long long *,
+ const unsigned char *, unsigned long long, const unsigned char *);
+int crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
+ const unsigned char *, unsigned long long, const unsigned char *);
+int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
+
+#endif /* crypto_api_h */