Skip to content

Commit

Permalink
fixed wrong -std=cxx and wrong uint320_t initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed Jun 6, 2024
1 parent 1ea6cfb commit c381990
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ChaCha20-Poly1305.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ namespace poly1305 {

std::cout << std::dec << "n = " << std::hex << n << '\n';

constexpr epi::uint320_t mask_n("0x10000000000000000000000006b637566");
constexpr epi::uint320_t mask_n("0x100000000000000000000000000000000");
n |= mask_n;
// n.limbs[2] |= 0x01;

Expand Down
10 changes: 5 additions & 5 deletions staticlib
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HEADER_OUT:=build/include
LIB_OUT:=build/lib
LIB_OUTNAME:=libchacha20.a

CXXFLAGS:=-std=c++11 -Wall -Wextra
CXXFLAGS:=-std=c++20 -Wall -Wextra
USERFLAGS:=-D_MAKE_LIB -D_HIDE_WARNING
TEST_OPTIMIZATION:=-g -Og
HEADER_PATHS:=-I./$(HEADER_OUT)
Expand All @@ -31,7 +31,7 @@ ifeq ($(OS), Linux)
@mkdir $(LIB_OUT)
@echo "creating static lib"
@echo "compiling ChaCha20..."
@$(CXX) -c ChaCha20-Poly1305.cpp $(LIB_OPTIMIZATION) $(USERFLAGS)
@$(CXX) $(CXXFLAGS) -c ChaCha20-Poly1305.cpp $(LIB_OPTIMIZATION) $(USERFLAGS)
@echo "compiling $(LIB_OUTNAME)..."
@ar -r $(LIB_OUTNAME) ChaCha20-Poly1305.o
@echo "build done : output -> $(LIB_OUTNAME)"
Expand All @@ -45,7 +45,7 @@ else
@mkdir "$(LIB_OUT)"
@echo "creating static lib"
@echo "compiling ChaCha20..."
@$(CXX) -c ChaCha20-Poly1305.cpp $(LIB_OPTIMIZATION) $(USERFLAGS)
@$(CXX) $(CXXFLAGS) -c ChaCha20-Poly1305.cpp $(LIB_OPTIMIZATION) $(USERFLAGS)
@echo "compiling $(LIB_OUTNAME)..."
@ar -r $(LIB_OUTNAME) ChaCha20.o
@echo "build done : output -> $(LIB_OUTNAME)"
Expand All @@ -70,14 +70,14 @@ ifeq ($(OS), Linux)
@echo ""
@echo "running build test"
@cp static-build.cpp build
@$(CXX) build/static-build.cpp -o build/static-build.out -I./$(HEADER_OUT)/ -L./$(LIB_OUT) $(LIBS)
@$(CXX) $(CXXFLAGS) build/static-build.cpp -o build/static-build.out -I./$(HEADER_OUT)/ -L./$(LIB_OUT) $(LIBS)
@./build/static-build.out
else
@echo "==============================="
@echo ""
@echo "running build test"
@copy static-build.cpp build
@$(CXX) build/static-build.cpp -o build/static-build.exe -I./$(HEADER_OUT)/ -L./$(LIB_OUT) $(LIBS)
@$(CXX) $(CXXFLAGS) build/static-build.cpp -o build/static-build.exe -I./$(HEADER_OUT)/ -L./$(LIB_OUT) $(LIBS)
@build/static-build.exe
endif

Expand Down

0 comments on commit c381990

Please sign in to comment.