Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt Project file. #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
*.lo
*.o
.DS_Store
.deps/
.libs/
build-*/
po/*.gmo
po/messages.mo
/aclocal.m4
Expand Down
28 changes: 25 additions & 3 deletions SMP/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@
/* Defined for SPARC platforms */
/* #undef HAVE_CPU_ARCH_SPARC */

#if (defined(__i386__) || defined(__x86_64__))
/* Defined for the x86 platforms */
#define HAVE_CPU_ARCH_X86 1
#endif

/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
don't. */
Expand All @@ -117,9 +119,11 @@
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */

#if defined(WIN32)
/* defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2)
with special properties like no file modes */
#define HAVE_DOSISH_SYSTEM 1
#endif

/* defined if we must run on a stupid file system */
#define HAVE_DRIVE_LETTERS 1
Expand Down Expand Up @@ -231,17 +235,21 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

#if !defined(WIN32) && !defined(ANDROID)
/* Define to 1 if you have the `stpcpy' function. */
/* #undef HAVE_STPCPY */
#define HAVE_STPCPY 1
#endif

/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1

/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1

#if defined(WIN32)
/* Define to 1 if you have the `stricmp' function. */
#define HAVE_STRICMP 1
#endif

/* Define to 1 if you have the <strings.h> header file. */
/* #undef HAVE_STRINGS_H */
Expand Down Expand Up @@ -312,8 +320,10 @@
/* Define to 1 if you have the `wait4' function. */
/* #undef HAVE_WAIT4 */

#if !defined(WIN32)
/* Define to 1 if you have the `waitpid' function. */
/* #undef HAVE_WAITPID */
#define HAVE_WAITPID 1
#endif

/* Define to 1 if you have the <winsock2.h> header file. */
#define HAVE_WINSOCK2_H 1
Expand Down Expand Up @@ -444,14 +454,22 @@
/* Defined if the EGD based RNG should be used. */
/* #undef USE_RNDEGD */

#if defined(__linux__)
/* Defined if the /dev/random RNG should be used. */
/* #undef USE_RNDLINUX */
#define USE_RNDLINUX 1

#define NAME_OF_DEV_RANDOM "/dev/random"
#define NAME_OF_DEV_URANDOM "/dev/urandom"

#endif

/* Defined if the default Unix RNG should be used. */
/* #undef USE_RNDUNIX */

#if defined(WIN32)
/* Defined if the Windows specific RNG should be used. */
#define USE_RNDW32 1
#endif

/* Defined if the WindowsCE specific RNG should be used. */
/* #undef USE_RNDW32CE */
Expand Down Expand Up @@ -507,5 +525,9 @@
properly prefixed. */
#define CAMELLIA_EXT_SYM_PREFIX _gcry_

#ifdef _MSC_VER
#include "compat.h"
#endif

#endif /*_GCRYPT_CONFIG_H_INCLUDED*/

228 changes: 228 additions & 0 deletions SMP/gcrypt.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
TEMPLATE = lib
TARGET = gcrypt
CONFIG += warn_off

message("App Binary architecture: $$QT_ARCH")

DESTDIR = $$PWD/../../bin

LIBGPG_ERROR_DIR = $$PWD/../../bin

LIBS += -L$$LIBGPG_ERROR_DIR -lgpg-error

INCLUDEPATH += . ../src ./mpi ../mpi ./cipher $$LIBGPG_ERROR_DIR
DEFINES += HAVE_CONFIG_H

win32 {
LIBS += -lUser32 -lAdvapi32
DEFINES += __builtin_bswap32=_byteswap_ulong __builtin_bswap64=_byteswap_uint64 asm=__asm__ __i386__
DEF_FILE = ../src/libgcrypt.def
CONFIG += shared dll
} else {
CONFIG += staticlib
}

HEADERS = \
../cipher/bithelp.h \
../cipher/bufhelp.h \
../cipher/camellia.h \
../cipher/cipher-internal.h \
../cipher/cipher-selftest.h \
../cipher/ecc-common.h \
../cipher/gost.h \
../cipher/hash-common.h \
../cipher/kdf-internal.h \
../cipher/keccak_permute_32.h \
../cipher/keccak_permute_64.h \
../cipher/mac-internal.h \
../cipher/poly1305-internal.h \
../cipher/pubkey-internal.h \
../cipher/rijndael-internal.h \
../cipher/rijndael-tables.h \
../cipher/sha1.h \
../compat/libcompat.h \
../mpi/ec-internal.h \
../mpi/generic/mpi-asm-defs.h \
../mpi/longlong.h \
../mpi/mpi-inline.h \
../mpi/mpi-internal.h \
../random/rand-internal.h \
../random/random.h \
../src/cipher-proto.h \
../src/cipher.h \
../src/context.h \
../src/ec-context.h \
../src/g10lib.h \
../src/gcrypt-int.h \
../src/hmac256.h \
../src/hwf-common.h \
../src/mpi.h \
../src/secmem.h \
../src/stdmem.h \
../src/types.h \
../src/visibility.h \
./config.h \
./gcrypt.h \
./mpi/asm-syntax.h \
./mpi/mod-source-info.h \
./mpi/mpi-asm-defs.h \
./mpi/sysdep.h \
./version.h \
./compat.h

SOURCES = \
../cipher/arcfour.c \
../cipher/blowfish.c \
../cipher/camellia-glue.c \
../cipher/camellia.c \
../cipher/cast5.c \
../cipher/chacha20.c \
../cipher/cipher-aeswrap.c \
../cipher/cipher-cbc.c \
../cipher/cipher-ccm.c \
../cipher/cipher-cfb.c \
../cipher/cipher-cmac.c \
../cipher/cipher-ctr.c \
../cipher/cipher-gcm-intel-pclmul.c \
../cipher/cipher-gcm.c \
../cipher/cipher-ocb.c \
../cipher/cipher-ofb.c \
../cipher/cipher-poly1305.c \
../cipher/cipher-selftest.c \
../cipher/cipher.c \
../cipher/crc-intel-pclmul.c \
../cipher/crc.c \
../cipher/des.c \
../cipher/dsa-common.c \
../cipher/dsa.c \
../cipher/ecc-curves.c \
../cipher/ecc-ecdsa.c \
../cipher/ecc-eddsa.c \
../cipher/ecc-gost.c \
../cipher/ecc-misc.c \
../cipher/ecc.c \
../cipher/elgamal.c \
../cipher/gost28147.c \
../cipher/gostr3411-94.c \
../cipher/hash-common.c \
../cipher/hmac-tests.c \
../cipher/idea.c \
../cipher/kdf.c \
../cipher/keccak.c \
../cipher/mac-cmac.c \
../cipher/mac-gmac.c \
../cipher/mac-hmac.c \
../cipher/mac-poly1305.c \
../cipher/mac.c \
../cipher/md.c \
../cipher/md4.c \
../cipher/md5.c \
../cipher/poly1305.c \
../cipher/primegen.c \
../cipher/pubkey-util.c \
../cipher/pubkey.c \
../cipher/rfc2268.c \
../cipher/rijndael-aesni.c \
../cipher/rijndael-padlock.c \
../cipher/rijndael.c \
../cipher/rmd160.c \
../cipher/rsa-common.c \
../cipher/rsa.c \
../cipher/salsa20.c \
../cipher/scrypt.c \
../cipher/seed.c \
../cipher/serpent.c \
../cipher/sha1.c \
../cipher/sha256.c \
../cipher/sha512.c \
../cipher/stribog.c \
../cipher/tiger.c \
../cipher/twofish.c \
../cipher/whirlpool.c \
../compat/compat.c \
../mpi/ec-ed25519.c \
../mpi/ec.c \
../mpi/generic/mpih-add1.c \
../mpi/generic/mpih-lshift.c \
../mpi/generic/mpih-mul1.c \
../mpi/generic/mpih-mul2.c \
../mpi/generic/mpih-mul3.c \
../mpi/generic/mpih-rshift.c \
../mpi/generic/mpih-sub1.c \
../mpi/mpi-add.c \
../mpi/mpi-bit.c \
../mpi/mpi-cmp.c \
../mpi/mpi-div.c \
../mpi/mpi-gcd.c \
../mpi/mpi-inline.c \
../mpi/mpi-inv.c \
../mpi/mpi-mod.c \
../mpi/mpi-mpow.c \
../mpi/mpi-mul.c \
../mpi/mpi-pow.c \
../mpi/mpi-scan.c \
../mpi/mpicoder.c \
../mpi/mpih-div.c \
../mpi/mpih-mul.c \
../mpi/mpiutil.c \
../random/random-csprng.c \
../random/random-drbg.c \
../random/random-system.c \
../random/random.c \
../random/rndhw.c \
../src/context.c \
../src/fips.c \
../src/global.c \
../src/hmac256.c \
../src/hwfeatures.c \
../src/misc.c \
../src/missing-string.c \
../src/secmem.c \
../src/sexp.c \
../src/stdmem.c \
../src/visibility.c

win32 {
HEADERS += \

SOURCES += \
../cipher/rijndael-ssse3-amd64.c \
../random/rndw32.c
}

linux {
SOURCES += \
../random/rndlinux.c
}

unix {
SOURCES += \
../random/rndunix.c \
../random/random-fips.c
}

equals(QT_ARCH, "i386") | equals(QT_ARCH, "x86_64") {
SOURCES += ../src/hwf-x86.c
}

#
# Copies the given files to the destination directory
# http://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output
#
defineTest(copyToDestdir) {
files = $$1

for(FILE, files) {
DDIR = $$DESTDIR

# Replace slashes in paths with backslashes for Windows
win32:FILE ~= s,/,\\,g
win32:DDIR ~= s,/,\\,g

QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
}

export(QMAKE_POST_LINK)
}

copyToDestdir($$PWD/gcrypt.h)
6 changes: 5 additions & 1 deletion random/random-csprng.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static void read_random_source (enum random_origins origin,
static void
initialize_basics(void)
{
static int initialized;
static int initialized = 0;

if (!initialized)
{
Expand All @@ -264,6 +264,10 @@ initialize_basics(void)
gcry_assert (GCRY_WEAK_RANDOM == 0
&& GCRY_STRONG_RANDOM == 1
&& GCRY_VERY_STRONG_RANDOM == 2);

int err = gpgrt_lock_init(&pool_lock);
if (err)
log_fatal ("failed to initialize the pool lock: %s\n", gpg_strerror (err));
}
}

Expand Down
4 changes: 3 additions & 1 deletion random/rndunix.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@
#include <sys/select.h>
#endif /* _AIX */
#ifndef __QNX__
#include <sys/shm.h>
#include <signal.h>
#if !defined(ANDROID)
#include <sys/shm.h>
#include <sys/signal.h>
#endif
#endif /* __QNX__ */
#include <sys/stat.h>
#include <sys/types.h> /* Verschiedene komische Typen */
Expand Down