diff --git a/include/ircd/ircd.h b/include/ircd/ircd.h index 5bc4eb3a0..20780d06a 100644 --- a/include/ircd/ircd.h +++ b/include/ircd/ircd.h @@ -50,6 +50,7 @@ #include "json/json.h" #include "cbor/cbor.h" #include "openssl.h" +#include "pbc.h" #include "fmt.h" #include "http.h" #include "http2/http2.h" diff --git a/include/ircd/pbc.h b/include/ircd/pbc.h new file mode 100644 index 000000000..12666e850 --- /dev/null +++ b/include/ircd/pbc.h @@ -0,0 +1,19 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 Jason Volk +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice is present in all copies. The +// full license for this software is available in the LICENSE file. + +#pragma once +#define HAVE_IRCD_PBC_H + +/// Pairing-Based Cryptography +namespace ircd::pbc +{ + IRCD_EXCEPTION(ircd::error, error) + +} diff --git a/ircd/Makefile.am b/ircd/Makefile.am index 33e3f0414..72e15b796 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -51,6 +51,7 @@ libircd_la_LDFLAGS = \ @JS_LDFLAGS@ \ @BOOST_LDFLAGS@ \ @SSL_LDFLAGS@ \ + @PBC_LDFLAGS@ \ @CRYPTO_LDFLAGS@ \ @SODIUM_LDFLAGS@ \ @MAGIC_LDFLAGS@ \ @@ -64,6 +65,7 @@ libircd_la_LIBADD = \ @ROCKSDB_LIBS@ \ @JS_LIBS@ \ @BOOST_LIBS@ \ + @PBC_LIBS@ \ @SSL_LIBS@ \ @CRYPTO_LIBS@ \ @SODIUM_LIBS@ \ @@ -119,6 +121,9 @@ endif if SODIUM libircd_la_SOURCES += sodium.cc endif +if PBC +libircd_la_SOURCES += pbc.cc +endif libircd_la_SOURCES += openssl.cc libircd_la_SOURCES += rfc1459.cc libircd_la_SOURCES += rfc3986.cc @@ -210,6 +215,9 @@ net_dns_resolver.lo: AM_CPPFLAGS := ${ASIO_UNIT_CPPFLAGS} ${AM_CPPFLAGS} openssl.lo: AM_CPPFLAGS := @SSL_CPPFLAGS@ @CRYPTO_CPPFLAGS@ ${AM_CPPFLAGS} parse.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} parse.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} +if PBC +pbc.lo: AM_CPPFLAGS := @PBC_CPPFLAGS@ ${AM_CPPFLAGS} +endif rfc1459.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} rfc1459.lo: AM_CXXFLAGS := ${SPIRIT_UNIT_CXXFLAGS} ${AM_CXXFLAGS} rfc3986.lo: AM_CPPFLAGS := ${SPIRIT_UNIT_CPPFLAGS} ${AM_CPPFLAGS} diff --git a/ircd/pbc.cc b/ircd/pbc.cc new file mode 100644 index 000000000..0965b2258 --- /dev/null +++ b/ircd/pbc.cc @@ -0,0 +1,36 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2020 Jason Volk +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice is present in all copies. The +// full license for this software is available in the LICENSE file. + +#include + +namespace ircd::pbc +{ + static void init() __attribute__((constructor)); + + extern info::versions version_api, version_abi; +} + +decltype(ircd::pbc::version_api) +ircd::pbc::version_api +{ + "pbc", info::versions::API, 0 +}; + +decltype(ircd::pbc::version_abi) +ircd::pbc::version_abi +{ + "pbc", info::versions::ABI, 0 +}; + +void +ircd::pbc::init() +{ + +}