how many bits it is. Add batarch.map for eBATS architecture renaming.master
@@ -1,3 +1,20 @@ | |||||
September 29, 2014: | |||||
Yesterday I put in some more architecture detection, but it should | |||||
really be based on the arch directory, because what's in there really | |||||
is a terrible hack. | |||||
I've tweaked the eBAT construction code to rename the architectures | |||||
using test/batarch.map. Maybe I should also rename them internally, | |||||
but not yet. | |||||
I added some new TODO.txt items. Some folks have been asking for a | |||||
more factored library, instead of this combined arithmetic, curve code, | |||||
encodings and protocol all-in-one jumble. Likewise the hash and RNG | |||||
should be flexible. | |||||
I've also been meaning to put more work in on SPAKE2EE, which would | |||||
also mean finalizing the Elligator code. | |||||
September 18, 2014: | September 18, 2014: | ||||
Begin work on a "ref" implementation. Currently this is just the | Begin work on a "ref" implementation. Currently this is just the | ||||
arch_ref64 architecture. The ref implementation always weak_reduces | arch_ref64 architecture. The ref implementation always weak_reduces | ||||
@@ -122,14 +122,15 @@ doc: Doxyfile doc/timestamp src/*.c src/include/*.h src/$(ARCH)/*.c src/$(ARCH)/ | |||||
bat: $(BATNAME) | bat: $(BATNAME) | ||||
$(BATNAME): include/* src/* src/*/* | |||||
$(BATNAME): include/* src/* src/*/* test/batarch.map | |||||
rm -fr $@ | rm -fr $@ | ||||
for arch in src/arch*; do \ | |||||
(while read arch where; do \ | |||||
mkdir -p $@/`basename $$arch`; \ | mkdir -p $@/`basename $$arch`; \ | ||||
cp include/* src/*.c src/include/* $$arch/* $@/`basename $$arch`; \ | |||||
cp include/*.h src/*.c src/include/*.h src/$$where/*.c src/$$where/*.h $@/`basename $$arch`; \ | |||||
perl -p -i -e 's/.*endif.*GOLDILOCKS_CONFIG_H/#define SUPERCOP_WONT_LET_ME_OPEN_FILES 1\n\n$$&/' $@/`basename $$arch`/config.h; \ | perl -p -i -e 's/.*endif.*GOLDILOCKS_CONFIG_H/#define SUPERCOP_WONT_LET_ME_OPEN_FILES 1\n\n$$&/' $@/`basename $$arch`/config.h; \ | ||||
perl -p -i -e 's/SYSNAME/'`basename $(BATNAME)`_`basename $$arch`'/g' $@/`basename $$arch`/api.h; \ | perl -p -i -e 's/SYSNAME/'`basename $(BATNAME)`_`basename $$arch`'/g' $@/`basename $$arch`/api.h; \ | ||||
done | |||||
done \ | |||||
) < test/batarch.map | |||||
echo 'Mike Hamburg' > $@/designers | echo 'Mike Hamburg' > $@/designers | ||||
echo 'Ed448-Goldilocks sign and dh' > $@/description | echo 'Ed448-Goldilocks sign and dh' > $@/description | ||||
@@ -1,5 +1,16 @@ | |||||
Important work items for Ed448-Goldilocks: | Important work items for Ed448-Goldilocks: | ||||
* Better architecture detection / factoring of arch-related headers. | |||||
[PROGRESS] | |||||
* Better factoring of high-level vs low-level library. | |||||
* Factor out hash, crandom from core library? | |||||
* Signed 32-bit NEON implementation to avoid bias/reduce after subtract | |||||
* Documentation: write high-level API docs, and internal docs to help | * Documentation: write high-level API docs, and internal docs to help | ||||
other implementors. | other implementors. | ||||
* Partial progress on Doxygenating the code. | * Partial progress on Doxygenating the code. | ||||
@@ -59,7 +70,7 @@ Important work items for Ed448-Goldilocks: | |||||
* Scalarmul with other cofactor modes. | * Scalarmul with other cofactor modes. | ||||
* High-level API: | * High-level API: | ||||
* SPAKE2 Elligator Edition? Maybe write a paper first. | |||||
* SHA512 Elligator Edition? Maybe write a paper first. | |||||
* Elligator. | * Elligator. | ||||
* Need to write Elligator inverse. Might not be Elligator-2S. | * Need to write Elligator inverse. Might not be Elligator-2S. | ||||
@@ -0,0 +1 @@ | |||||
#define WORD_BITS 32 |
@@ -0,0 +1 @@ | |||||
#define WORD_BITS 32 |
@@ -0,0 +1 @@ | |||||
#define WORD_BITS 32 |
@@ -0,0 +1 @@ | |||||
#define WORD_BITS 32 |
@@ -0,0 +1 @@ | |||||
#define WORD_BITS 64 |
@@ -0,0 +1 @@ | |||||
#define WORD_BITS 64 |
@@ -5,6 +5,8 @@ | |||||
#ifndef __WORD_H__ | #ifndef __WORD_H__ | ||||
#define __WORD_H__ | #define __WORD_H__ | ||||
#include "arch_config.h" | |||||
/* for posix_memalign */ | /* for posix_memalign */ | ||||
#define _XOPEN_SOURCE 600 | #define _XOPEN_SOURCE 600 | ||||
@@ -26,18 +28,7 @@ | |||||
#include <immintrin.h> | #include <immintrin.h> | ||||
#endif | #endif | ||||
#if ((__SIZEOF_INT128__ == 16 \ | |||||
|| 10*__clang_major__ + __clang_minor__ <= 32) \ | |||||
&& __SIZEOF_SIZE_T__ == 8 \ | |||||
&& (__SIZEOF_LONG__==8 || __POINTER_WIDTH__==64) \ | |||||
&& !defined(GOLDI_FORCE_32_BIT)) | |||||
/* It's a 64-bit machine if: | |||||
* __uint128_t exists | |||||
* size_t is 64 bits | |||||
* Either longs are 64-bits (doesn't happen on Windows) | |||||
* or pointers are 64-bits (doesn't happen on 32/64 arches) | |||||
* FUTURE: validate this hack on more architectures. | |||||
*/ | |||||
#if (WORD_BITS == 64) | |||||
typedef uint32_t hword_t; | typedef uint32_t hword_t; | ||||
typedef uint64_t word_t; | typedef uint64_t word_t; | ||||
typedef __uint128_t dword_t; | typedef __uint128_t dword_t; | ||||
@@ -67,7 +58,6 @@ typedef int64_t dsword_t; | |||||
#define GOLDI_BITS 32 | #define GOLDI_BITS 32 | ||||
#endif | #endif | ||||
#define WORD_BITS (sizeof(word_t) * 8) | |||||
#define DIV_CEIL(_x,_y) (((_x) + (_y) - 1)/(_y)) | #define DIV_CEIL(_x,_y) (((_x) + (_y) - 1)/(_y)) | ||||
#define ROUND_UP(_x,_y) (DIV_CEIL((_x),(_y))*(_y)) | #define ROUND_UP(_x,_y) (DIV_CEIL((_x),(_y))*(_y)) | ||||
#define WORDS_FOR_BITS(_x) (DIV_CEIL((_x),WORD_BITS)) | #define WORDS_FOR_BITS(_x) (DIV_CEIL((_x),WORD_BITS)) | ||||
@@ -0,0 +1,5 @@ | |||||
neon arch_neon_experimental | |||||
arm32 arch_arm_32 | |||||
64 arch_ref64 | |||||
32 arch_32 | |||||
amd64 arch_x86_64 |