From 8d1e8591cf51e4d1b76ecf3d20cf8e15c50d70ed Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Tue, 31 May 2016 01:51:07 +0300 Subject: [PATCH] sxt: added skel for sxtkeys; --- include/Makefile.am | 3 ++- include/sxt/sxtkey.h | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 include/sxt/sxtkey.h diff --git a/include/Makefile.am b/include/Makefile.am index 91af4bc..a852e68 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -4,4 +4,5 @@ nobase_include_HEADERS = sxmp/sxmp.h sxmp/errno.h sxmp/limits.h sxmp/version.h \ sexpr/sexp_memory.h sexpr/sexp_ops.h sexpr/sexp_vis.h \ tdata/bitwise.h tdata/idx_allocator.h tdata/macro.h tdata/tree.h \ tdata/usrtc.h tdata/list.h tdata/ctrie.h \ - ydaemon/ydaemon.h ydaemon/cache.h ydaemon/dataobject.h + ydaemon/ydaemon.h ydaemon/cache.h ydaemon/dataobject.h \ + sxt/sxtkey.h diff --git a/include/sxt/sxtkey.h b/include/sxt/sxtkey.h new file mode 100644 index 0000000..04e2b6d --- /dev/null +++ b/include/sxt/sxtkey.h @@ -0,0 +1,50 @@ +/* + * Secure eXtended Message Passing framework + * Secure eXtended Transport layer implementation: (libsxt) + * - very similar to SSH2/TLS + * - using already proven and tested crypto algos + * - better than TLS for message passing + * + * PublicPrivateKeyPairs operation API + * + * Copyright (c) 2014 by Aris Adamantiadis + * (c) Alexander Vdolainen 2016 + * + * libsxmp is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libsxmp is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see ."; + * + */ + +#ifndef __SXT_SXTKEY_H__ +#define __SXT_SXTKEY_H__ + +/* some taken code , copyright left in the header */ +#define ED25519_PK_LEN 32 +#define ED25519_SK_LEN 64 +#define ED25519_SIG_LEN 64 + +typedef uint8_t ed25519_pubkey[ED25519_PK_LEN]; +typedef uint8_t ed25519_privkey[ED25519_SK_LEN]; +typedef uint8_t ed25519_signature[ED25519_SIG_LEN]; + +/* here the supported types in SXT */ +#define PPKP_ED25519 0xa + +typedef struct sxtkey_type { + uint8_t type; + uint8_t flags; + ed25519_pubkey pubkey; + ed25519_privkey privkey; +} sxtkey_t; + +#endif /* __SXT_SXTKEY_H__ */