diff --git a/Makefile b/Makefile index 9e61368..bceebaf 100644 --- a/Makefile +++ b/Makefile @@ -218,7 +218,7 @@ $(EXPORTED_SHE_JS): ./include/mcl/she.h EXPORTED_SHE=$(shell cat $(SHE_TXT)) docs/demo/mclshe.js: src/fp.cpp src/she_c256.cpp $(SHE_TXT) $(EXPORTED_SHE_JS) - emcc -o $@ src/fp.cpp src/she_c256.cpp -I./include -I./src -I../cybozulib/include -s WASM=1 -s "MODULARIZE=1" -s "EXPORTED_FUNCTIONS=[$(EXPORTED_SHE)]" -O3 -DNDEBUG -DMCLBN_FP_UNIT_SIZE=4 -DMCL_MAX_BIT_SIZE=256 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 + emcc -o $@ src/fp.cpp src/she_c256.cpp -I./include -I./src -I../cybozulib/include -s WASM=1 -s "MODULARIZE=1" -s "EXPORTED_FUNCTIONS=[$(EXPORTED_SHE)]" -O3 -DNDEBUG -DMCLBN_FP_UNIT_SIZE=4 -DMCL_MAX_BIT_SIZE=256 -s DISABLE_EXCEPTION_CATCHING=0 -s NO_EXIT_RUNTIME=1 -DMCLSHE_WIN_SIZE=8 demo: $(MAKE) docs/demo/mclshe.js diff --git a/include/mcl/she.hpp b/include/mcl/she.hpp index 4069fef..946611f 100644 --- a/include/mcl/she.hpp +++ b/include/mcl/she.hpp @@ -57,7 +57,10 @@ static thread_local std::random_device g_rg; #else static cybozu::RandomGenerator g_rg; #endif -const size_t winSize = 10; +#ifndef MCLSHE_WIN_SIZE + #define MCLSHE_WIN_SIZE 10 +#endif +const size_t winSize = MCLSHE_WIN_SIZE; struct KeyCount { uint32_t key;