mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
added configure flag --with-python-binding
This commit is contained in:
@@ -59,6 +59,12 @@ Pretty Curved Privacy - File encryption using eliptic curve cryptography.
|
|||||||
# generate usage.h
|
# generate usage.h
|
||||||
(cd src && ./usage.sh)
|
(cd src && ./usage.sh)
|
||||||
|
|
||||||
|
# generate pypcp types
|
||||||
|
bindings/py/gencffi.pl include/pcp/defines.h include/pcp/structs.h include/pcp/key.h \
|
||||||
|
include/pcp/buffer.h include/pcp/context.h include/pcp/mac.h \
|
||||||
|
include/pcp/ed.h include/pcp/crypto.h include/pcp/vault.h \
|
||||||
|
include/pcp/pcpstream.h include/pcp/z85.h > bindings/py/pypcp/raw.py
|
||||||
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ install:
|
|||||||
python setup.py install
|
python setup.py install
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build pypcp/*.pyc
|
||||||
19
configure.ac
19
configure.ac
@@ -294,8 +294,27 @@ fi
|
|||||||
CFLAGS="$CFLAGS -Werror -Wextra -O2"
|
CFLAGS="$CFLAGS -Werror -Wextra -O2"
|
||||||
CXXFLAGS="$CFLAGS"
|
CXXFLAGS="$CFLAGS"
|
||||||
|
|
||||||
|
AC_ARG_WITH([python-binding],
|
||||||
|
[AS_HELP_STRING([--with-python-binding],
|
||||||
|
[Enable python binding])],
|
||||||
|
[python="yes"],
|
||||||
|
[])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AC_SUBST(PACKAGE_VERSION)
|
AC_SUBST(PACKAGE_VERSION)
|
||||||
|
|
||||||
# Specify output files
|
# Specify output files
|
||||||
AC_CONFIG_FILES([Makefile include/Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile libpcp/libpcp1.pc bindings/cpp/Makefile])
|
AC_CONFIG_FILES([Makefile include/Makefile libpcp/Makefile src/Makefile man/Makefile tests/Makefile libpcp/libpcp1.pc bindings/cpp/Makefile])
|
||||||
|
|
||||||
|
|
||||||
|
if test "x$python" = "xyes"; then
|
||||||
|
if python -c "import cffi" > /dev/null 2>&1; then
|
||||||
|
AC_CONFIG_FILES([bindings/py/Makefile])
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([python or cffi is not installed])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ extern "C" {
|
|||||||
#include "pcp/config.h"
|
#include "pcp/config.h"
|
||||||
#include "pcp/base85.h"
|
#include "pcp/base85.h"
|
||||||
#include "pcp/buffer.h"
|
#include "pcp/buffer.h"
|
||||||
|
#include "pcp/config.h"
|
||||||
#include "pcp/context.h"
|
#include "pcp/context.h"
|
||||||
#include "pcp/crypto.h"
|
#include "pcp/crypto.h"
|
||||||
#include "pcp/defines.h"
|
#include "pcp/defines.h"
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
.\"
|
.\"
|
||||||
.IX Title "PCP1 1"
|
.IX Title "PCP1 1"
|
||||||
.TH PCP1 1 "2014-09-29" "PCP 0.2.3" "USER CONTRIBUTED DOCUMENTATION"
|
.TH PCP1 1 "2014-12-14" "PCP 0.2.3" "USER CONTRIBUTED DOCUMENTATION"
|
||||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||||
.\" way too many mistakes in technical documents.
|
.\" way too many mistakes in technical documents.
|
||||||
.if n .ad l
|
.if n .ad l
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ int main() {
|
|||||||
Pcpstream *clear_in, *crypt_out, *clear_out;
|
Pcpstream *clear_in, *crypt_out, *clear_out;
|
||||||
PCPCTX *ptx;
|
PCPCTX *ptx;
|
||||||
char message[] = "hello world";
|
char message[] = "hello world";
|
||||||
|
printf("hh: %ld\n", sizeof(UT_hash_handle));
|
||||||
/* we always need a context */
|
/* we always need a context */
|
||||||
ptx = ptx_new();
|
ptx = ptx_new();
|
||||||
|
|
||||||
@@ -15,6 +15,8 @@ int main() {
|
|||||||
alice = pcpkey_new();
|
alice = pcpkey_new();
|
||||||
bob = pcpkey_new();
|
bob = pcpkey_new();
|
||||||
|
|
||||||
|
pcpkey_setowner(alice, "alicia", "alicia@local");
|
||||||
|
|
||||||
/* get the public parts of them */
|
/* get the public parts of them */
|
||||||
alicepub = pcpkey_pub_from_secret(alice);
|
alicepub = pcpkey_pub_from_secret(alice);
|
||||||
bobpub = pcpkey_pub_from_secret(bob);
|
bobpub = pcpkey_pub_from_secret(bob);
|
||||||
|
|||||||
Reference in New Issue
Block a user