Commit 4433591c authored by Michael Hamburg's avatar Michael Hamburg
Browse files

Forget yesterday's hack; just add an arch_config.h to each arch which says

how many bits it is.

Add for eBATS architecture renaming.
parent 47b06f3e
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/ 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:
Begin work on a "ref" implementation. Currently this is just the
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)
$(BATNAME): include/* src/* src/*/*
$(BATNAME): include/* src/* src/*/* test/
rm -fr $@
for arch in src/arch*; do \
(while read arch where; do \
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/SYSNAME/'`basename $(BATNAME)`_`basename $$arch`'/g' $@/`basename $$arch`/api.h; \
done \
) < test/
echo 'Mike Hamburg' > $@/designers
echo 'Ed448-Goldilocks sign and dh' > $@/description
Important work items for Ed448-Goldilocks:
* Better architecture detection / factoring of arch-related headers.
* 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
other implementors.
* Partial progress on Doxygenating the code.
......@@ -59,7 +70,7 @@ Important work items for Ed448-Goldilocks:
* Scalarmul with other cofactor modes.
* High-level API:
* SPAKE2 Elligator Edition? Maybe write a paper first.
* SHA512 Elligator Edition? Maybe write a paper first.
* Elligator.
* Need to write Elligator inverse. Might not be Elligator-2S.
#define WORD_BITS 32
#define WORD_BITS 32
#define WORD_BITS 64
......@@ -5,6 +5,8 @@
#ifndef __WORD_H__
#define __WORD_H__
#include "arch_config.h"
/* for posix_memalign */
#define _XOPEN_SOURCE 600
......@@ -26,18 +28,7 @@
#include <immintrin.h>
#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 uint64_t word_t;
typedef __uint128_t dword_t;
......@@ -67,7 +58,6 @@ typedef int64_t dsword_t;
#define GOLDI_BITS 32
#define WORD_BITS (sizeof(word_t) * 8)
#define DIV_CEIL(_x,_y) (((_x) + (_y) - 1)/(_y))
#define ROUND_UP(_x,_y) (DIV_CEIL((_x),(_y))*(_y))
neon arch_neon_experimental
arm32 arch_arm_32
64 arch_ref64
32 arch_32
amd64 arch_x86_64
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment