forked from teserakt-io/libe4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework make system. Now builds public key version of code as well as
the private key version.
- Loading branch information
Showing
17 changed files
with
380 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
Portable header to provide the 32 and 64 bits type. | ||
Not a compatible replacement for <stdint.h>, do not blindly use it as such. | ||
*/ | ||
|
||
#if ((defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || \ | ||
(defined(__WATCOMC__) && (defined(_STDINT_H_INCLUDED) || __WATCOMC__ >= 1250)) || \ | ||
(defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_) || \ | ||
defined(__UINT_FAST64_TYPE__)))) && \ | ||
!defined(FIXEDINT_H_INCLUDED) | ||
#include <stdint.h> | ||
#define FIXEDINT_H_INCLUDED | ||
|
||
#if defined(__WATCOMC__) && __WATCOMC__ >= 1250 && !defined(UINT64_C) | ||
#include <limits.h> | ||
#define UINT64_C(x) (x + (UINT64_MAX - UINT64_MAX)) | ||
#endif | ||
#endif | ||
|
||
|
||
#ifndef FIXEDINT_H_INCLUDED | ||
#define FIXEDINT_H_INCLUDED | ||
|
||
#include <limits.h> | ||
|
||
/* (u)int32_t */ | ||
#ifndef uint32_t | ||
#if (ULONG_MAX == 0xffffffffUL) | ||
typedef unsigned long uint32_t; | ||
#elif (UINT_MAX == 0xffffffffUL) | ||
typedef unsigned int uint32_t; | ||
#elif (USHRT_MAX == 0xffffffffUL) | ||
typedef unsigned short uint32_t; | ||
#endif | ||
#endif | ||
|
||
|
||
#ifndef int32_t | ||
#if (LONG_MAX == 0x7fffffffL) | ||
typedef signed long int32_t; | ||
#elif (INT_MAX == 0x7fffffffL) | ||
typedef signed int int32_t; | ||
#elif (SHRT_MAX == 0x7fffffffL) | ||
typedef signed short int32_t; | ||
#endif | ||
#endif | ||
|
||
|
||
/* (u)int64_t */ | ||
#if (defined(__STDC__) && defined(__STDC_VERSION__) && __STDC__ && __STDC_VERSION__ >= 199901L) | ||
typedef long long int64_t; | ||
typedef unsigned long long uint64_t; | ||
|
||
#define UINT64_C(v) v##ULL | ||
#define INT64_C(v) v##LL | ||
#elif defined(__GNUC__) | ||
__extension__ typedef long long int64_t; | ||
__extension__ typedef unsigned long long uint64_t; | ||
|
||
#define UINT64_C(v) v##ULL | ||
#define INT64_C(v) v##LL | ||
#elif defined(__MWERKS__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || \ | ||
defined(__APPLE_CC__) || defined(_LONG_LONG) || defined(_CRAYC) | ||
typedef long long int64_t; | ||
typedef unsigned long long uint64_t; | ||
|
||
#define UINT64_C(v) v##ULL | ||
#define INT64_C(v) v##LL | ||
#elif (defined(__WATCOMC__) && defined(__WATCOM_INT64__)) || \ | ||
(defined(_MSC_VER) && _INTEGRAL_MAX_BITS >= 64) || \ | ||
(defined(__BORLANDC__) && __BORLANDC__ > 0x460) || defined(__alpha) || defined(__DECC) | ||
typedef __int64 int64_t; | ||
typedef unsigned __int64 uint64_t; | ||
|
||
#define UINT64_C(v) v##UI64 | ||
#define INT64_C(v) v##I64 | ||
#endif | ||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
CC ?= clang | ||
AR ?= ar | ||
LD ?= clang | ||
ARFLAGS = rcs | ||
CFLAGS = -Wall -Werror -g -DE4_STORE_FILE -std=c89 $(E4_CFLAGS) | ||
LDFLAGS = -L. $(E4_CFLAGS) | ||
INCLUDES = -Iinclude/ | ||
|
||
# BUILD environment | ||
GITCOMMIT=$(shell git rev-list -1 HEAD) | ||
NOW=$(shell date "+%Y%m%d%H%M") | ||
|
||
# OBJ paths match their src folder equivalents | ||
INCDIR = include | ||
OBJDIR = tmp/symkey | ||
SRCDIR = src | ||
DOCDIR = doc | ||
LIBDIR = build/symkey/lib | ||
OUTINCDIR = build/symkey/include | ||
LIBNAME = libe4 | ||
LIB = $(LIBDIR)/$(LIBNAME).a | ||
DISTDIR = dist/symkey/ | ||
TESTDIR = build/symkey/test | ||
|
||
O = o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
OBJS = $(OBJDIR)/e4pkcclient.$O \ | ||
$(OBJDIR)/e4util.$O \ | ||
$(OBJDIR)/crypto/aes_siv.$O \ | ||
$(OBJDIR)/crypto/aes256enc_ref.$O \ | ||
$(OBJDIR)/crypto/sha3.$O \ | ||
$(OBJDIR)/crypto/keccakf1600.$O \ | ||
$(OBJDIR)/crypto/test_aes_siv.$O \ | ||
$(OBJDIR)/crypto/test_sha3.$O \ | ||
$(OBJDIR)/strlcpy.$O \ | ||
$(OBJDIR)/crypto/curve25519/curve25519-donna.$O \ | ||
$(OBJDIR)/crypto/ed25519/add_scalar.$O \ | ||
$(OBJDIR)/crypto/ed25519/ed25519_test.$O \ | ||
$(OBJDIR)/crypto/ed25519/fe.$O \ | ||
$(OBJDIR)/crypto/ed25519/ge.$O \ | ||
$(OBJDIR)/crypto/ed25519/key_exchange.$O \ | ||
$(OBJDIR)/crypto/ed25519/keypair.$O \ | ||
$(OBJDIR)/crypto/ed25519/sc.$O \ | ||
$(OBJDIR)/crypto/ed25519/seed.$O \ | ||
$(OBJDIR)/crypto/ed25519/sign.$O \ | ||
$(OBJDIR)/crypto/ed25519/verify.$O \ | ||
$(OBJDIR)/crypto/sha512.$O | ||
|
||
|
||
|
||
|
||
TESTS = \ | ||
$(TESTDIR)/util \ | ||
$(TESTDIR)/crypto \ | ||
$(TESTDIR)/e4file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
PUBKEY_TESTS = \ | ||
$(TESTDIR)/util \ | ||
$(TESTDIR)/crypto \ | ||
$(TESTDIR)/e4file | ||
|
||
TESTS += $(PUBKEY_TESTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
E4_CFLAGS = -fsanitize=address,memory,undefined -fno-omit-frame-pointer | ||
E4_LDFLAGS = -fsanitize=address,memory,undefined -fno-omit-frame-pointer | ||
|
||
CONF = symkey | ||
include mk/symkey/conf.mk | ||
include mk/symkey/objects.mk | ||
include mk/symkey/tests.mk | ||
include mk/rules.mk | ||
|
||
include mk/pubkey/conf.mk | ||
include mk/pubkey/objects.mk | ||
include mk/pubkey/tests.mk | ||
include mk/rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
|
||
CC ?= clang | ||
CC ?= clang | ||
AR ?= ar | ||
ARFLAGS = rcs | ||
CFLAGS = -Wall -Werror -g -DE4_STORE_FILE -std=c89 | ||
LDFLAGS = -L. | ||
CFLAGS = -Wall -Werror -g -DE4_STORE_FILE -std=c89 $(E4_CFLAGS) | ||
LDFLAGS = -L. $(E4_CFLAGS) | ||
INCLUDES = -Iinclude/ | ||
|
||
# BUILD environment | ||
GITCOMMIT=$(shell git rev-list -1 HEAD) | ||
NOW=$(shell date "+%Y%m%d%H%M") | ||
|
||
# OBJ paths match their src folder equivalents | ||
INCDIR = include | ||
OBJDIR = tmp/default | ||
INCDIR = include | ||
OBJDIR = tmp/symkey | ||
SRCDIR = src | ||
DOCDIR = doc | ||
LIBDIR = build/lib | ||
OUTINCDIR = build/include | ||
LIBDIR = build/symkey/lib | ||
OUTINCDIR = build/symkey/include | ||
LIBNAME = libe4 | ||
LIB = $(LIBDIR)/$(LIBNAME).a | ||
DISTDIR = dist | ||
DISTDIR = dist/symkey/ | ||
TESTDIR = build/symkey/test | ||
|
||
O = o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
OBJS = $(OBJDIR)/e4c_store_file.$O \ | ||
$(OBJDIR)/e4util.$O \ | ||
$(OBJDIR)/crypto/aes_siv.$O \ | ||
$(OBJDIR)/crypto/aes256enc_ref.$O \ | ||
$(OBJDIR)/crypto/sha3.$O \ | ||
$(OBJDIR)/crypto/keccakf1600.$O \ | ||
$(OBJDIR)/crypto/test_aes_siv.$O \ | ||
$(OBJDIR)/crypto/test_sha3.$O \ | ||
$(OBJDIR)/strlcpy.$O | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
SYMKEY_TESTS = \ | ||
$(TESTDIR)/util \ | ||
$(TESTDIR)/crypto \ | ||
$(TESTDIR)/symkey/symkey_file | ||
|
||
TESTS += $(SYMKEY_TESTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
|
||
|
||
CONF ?= default | ||
include mk/conf_$(CONF).mk | ||
include mk/objects.mk | ||
CONF ?= symkey | ||
include mk/$(CONF)/conf.mk | ||
include mk/$(CONF)/objects.mk | ||
include mk/$(CONF)/tests.mk | ||
include mk/rules.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef FE_H | ||
#define FE_H | ||
|
||
#include "fixedint.h" | ||
#include "e4/crypto/fixedint.h" | ||
|
||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.