From: Rudolf Polzer Date: Thu, 5 Aug 2010 04:57:32 +0000 (+0200) Subject: add 32bit d0_blind_id lib X-Git-Tag: xonotic-v0.1.0preview~125^2~72 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=b912d56bc73318be455c5f4bd0f58d9909afca58;ds=sidebyside add 32bit d0_blind_id lib --- diff --git a/misc/builddeps/dp.linux32/bin/blind_id b/misc/builddeps/dp.linux32/bin/blind_id new file mode 100755 index 00000000..2c37fff3 Binary files /dev/null and b/misc/builddeps/dp.linux32/bin/blind_id differ diff --git a/misc/builddeps/dp.linux32/include/d0_blind_id/d0.h b/misc/builddeps/dp.linux32/include/d0_blind_id/d0.h new file mode 100644 index 00000000..db7555d9 --- /dev/null +++ b/misc/builddeps/dp.linux32/include/d0_blind_id/d0.h @@ -0,0 +1,13 @@ +#ifndef __D0_H__ +#define __D0_H__ + +#include // size_t + +#define EXPORT __attribute__((__visibility__("default"))) +#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#define BOOL int + +extern void *(*d0_malloc)(size_t len); +extern void (*d0_free)(void *p); + +#endif diff --git a/misc/builddeps/dp.linux32/include/d0_blind_id/d0_blind_id.h b/misc/builddeps/dp.linux32/include/d0_blind_id/d0_blind_id.h new file mode 100644 index 00000000..cc5afba4 --- /dev/null +++ b/misc/builddeps/dp.linux32/include/d0_blind_id/d0_blind_id.h @@ -0,0 +1,45 @@ +#ifndef __D0_BLIND_ID_H__ +#define __D0_BLIND_ID_H__ + +#include "d0.h" + +typedef struct d0_blind_id_s d0_blind_id_t; +typedef BOOL (*d0_fastreject_function) (const d0_blind_id_t *ctx, void *pass); + +EXPORT WARN_UNUSED_RESULT d0_blind_id_t *d0_blind_id_new(void); +EXPORT void d0_blind_id_free(d0_blind_id_t *a); +EXPORT void d0_blind_id_clear(d0_blind_id_t *ctx); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_copy(d0_blind_id_t *ctx, const d0_blind_id_t *src); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_generate_private_key(d0_blind_id_t *ctx, int k); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_generate_private_key_fastreject(d0_blind_id_t *ctx, int k, d0_fastreject_function reject, void *pass); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_read_private_key(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_read_public_key(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_write_private_key(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_write_public_key(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_fingerprint64_public_key(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_generate_private_id_modulus(d0_blind_id_t *ctx); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_read_private_id_modulus(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_write_private_id_modulus(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_generate_private_id_start(d0_blind_id_t *ctx); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_generate_private_id_request(d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_answer_private_id_request(const d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_finish_private_id_request(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_read_private_id_request_camouflage(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_write_private_id_request_camouflage(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_read_private_id(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_read_public_id(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_write_private_id(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_write_public_id(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_authenticate_with_private_id_start(d0_blind_id_t *ctx, BOOL is_first, BOOL send_modulus, char *message, size_t msglen, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_authenticate_with_private_id_challenge(d0_blind_id_t *ctx, BOOL is_first, BOOL recv_modulus, const char *inbuf, size_t inbuflen, char *outbuf, size_t *outbuflen, BOOL *status); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_authenticate_with_private_id_response(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_authenticate_with_private_id_verify(d0_blind_id_t *ctx, const char *inbuf, size_t inbuflen, char *msg, size_t *msglen, BOOL *status); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_fingerprint64_public_id(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); +EXPORT WARN_UNUSED_RESULT BOOL d0_blind_id_sessionkey_public_id(const d0_blind_id_t *ctx, char *outbuf, size_t *outbuflen); // can only be done after successful key exchange, this performs a modpow; key length is limited by SHA_DIGESTSIZE for now; also ONLY valid after successful d0_blind_id_authenticate_with_private_id_verify/d0_blind_id_fingerprint64_public_id + +EXPORT void d0_blind_id_INITIALIZE(void); +EXPORT void d0_blind_id_SHUTDOWN(void); + +EXPORT void d0_blind_id_util_sha256(char *out, const char *in, size_t n); + +#endif diff --git a/misc/builddeps/dp.linux32/include/d0_blind_id/d0_rijndael.h b/misc/builddeps/dp.linux32/include/d0_blind_id/d0_rijndael.h new file mode 100644 index 00000000..59db778a --- /dev/null +++ b/misc/builddeps/dp.linux32/include/d0_blind_id/d0_rijndael.h @@ -0,0 +1,21 @@ +// from http://www.efgh.com/software/rijndael.htm (public domain) + +#ifndef H__RIJNDAEL +#define H__RIJNDAEL + +#include "d0.h" + +EXPORT int d0_rijndael_setup_encrypt(unsigned long *rk, const unsigned char *key, + int keybits); +EXPORT int d0_rijndael_setup_decrypt(unsigned long *rk, const unsigned char *key, + int keybits); +EXPORT void d0_rijndael_encrypt(const unsigned long *rk, int nrounds, + const unsigned char plaintext[16], unsigned char ciphertext[16]); +EXPORT void d0_rijndael_decrypt(const unsigned long *rk, int nrounds, + const unsigned char ciphertext[16], unsigned char plaintext[16]); + +#define D0_RIJNDAEL_KEYLENGTH(keybits) ((keybits)/8) +#define D0_RIJNDAEL_RKLENGTH(keybits) ((keybits)/8+28) +#define D0_RIJNDAEL_NROUNDS(keybits) ((keybits)/32+6) + +#endif diff --git a/misc/builddeps/dp.linux32/lib/libd0_blind_id.a b/misc/builddeps/dp.linux32/lib/libd0_blind_id.a new file mode 100644 index 00000000..14c55913 Binary files /dev/null and b/misc/builddeps/dp.linux32/lib/libd0_blind_id.a differ diff --git a/misc/builddeps/dp.linux32/lib/libd0_blind_id.la b/misc/builddeps/dp.linux32/lib/libd0_blind_id.la new file mode 100755 index 00000000..87fbe708 --- /dev/null +++ b/misc/builddeps/dp.linux32/lib/libd0_blind_id.la @@ -0,0 +1,35 @@ +# libd0_blind_id.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-4+lenny1 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libd0_blind_id.a' + +# Libraries that this one depends upon. +dependency_libs=' /usr/lib/libgmp.la' + +# Version information for libd0_blind_id. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/home/xonotic/dp.linux32/lib' diff --git a/misc/builddeps/dp.linux32/lib/libd0_rijndael.a b/misc/builddeps/dp.linux32/lib/libd0_rijndael.a new file mode 100644 index 00000000..8116d530 Binary files /dev/null and b/misc/builddeps/dp.linux32/lib/libd0_rijndael.a differ diff --git a/misc/builddeps/dp.linux32/lib/libd0_rijndael.la b/misc/builddeps/dp.linux32/lib/libd0_rijndael.la new file mode 100755 index 00000000..f5e8684f --- /dev/null +++ b/misc/builddeps/dp.linux32/lib/libd0_rijndael.la @@ -0,0 +1,35 @@ +# libd0_rijndael.la - a libtool library file +# Generated by ltmain.sh - GNU libtool 1.5.26 Debian 1.5.26-4+lenny1 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libd0_rijndael.a' + +# Libraries that this one depends upon. +dependency_libs=' /usr/lib/libgmp.la' + +# Version information for libd0_rijndael. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/home/xonotic/dp.linux32/lib' diff --git a/misc/builddeps/dp.linux32/lib/pkgconfig/d0_blind_id.pc b/misc/builddeps/dp.linux32/lib/pkgconfig/d0_blind_id.pc new file mode 100644 index 00000000..dd823ca2 --- /dev/null +++ b/misc/builddeps/dp.linux32/lib/pkgconfig/d0_blind_id.pc @@ -0,0 +1,11 @@ +prefix=/home/xonotic/dp.linux32 +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Blind-ID +Description: Library for user identification using RSA blind signatures +Requires: +Version: 0.1 +Libs: -L${libdir} -ld0_blind_id +Cflags: -I${includedir}/d0_blind_id diff --git a/misc/builddeps/dp.linux32/lib/pkgconfig/d0_rijndael.pc b/misc/builddeps/dp.linux32/lib/pkgconfig/d0_rijndael.pc new file mode 100644 index 00000000..284fe32d --- /dev/null +++ b/misc/builddeps/dp.linux32/lib/pkgconfig/d0_rijndael.pc @@ -0,0 +1,11 @@ +prefix=/home/xonotic/dp.linux32 +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Rijndael +Description: Library for Rijndael encryption +Requires: +Version: 0.1 +Libs: -L${libdir} -ld0_rijndael +Cflags: -I${includedir}/d0_blind_id