Skip to content

Commit

Permalink
miscellaneous bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenulAbidin committed Apr 5, 2021
1 parent e89425f commit ac0937e
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define CONSTANTSH

// Release number
#define RELEASE "2.2"
#define RELEASE "2.3"

// Use symmetry
//#define USE_SYMMETRY
Expand Down
Binary file removed GPU/.GPUEngine.cu.swp
Binary file not shown.
Binary file removed GPU/.GPUEngine.h.swp
Binary file not shown.
Binary file removed GPU/.GPUMath.h.swp
Binary file not shown.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ $(OBJDIR)/%.o : %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<

bsgs: $(OBJET)
@echo Making Kangaroo...
$(CXX) $(OBJET) $(LFLAGS) -o kangaroo
@echo Making Kangaroo-256...
$(CXX) $(OBJET) $(LFLAGS) -o kangaroo-256

$(OBJET): | $(OBJDIR) $(OBJDIR)/SECPK1 $(OBJDIR)/GPU

Expand All @@ -116,6 +116,7 @@ clean:
@rm -f obj/*.o
@rm -f obj/GPU/*.o
@rm -f obj/SECPK1/*.o
@rm -f deviceQuery/*.o
@rm -f cuda_version.txt
@rm -f cuda_build_log.txt
@rm -f deviceQuery/cuda_build_log.txt

2 changes: 1 addition & 1 deletion Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ void Kangaroo::RunServer() {
}
SetDP(initDPSize);

if(sizeof(DP) != 40) {
if(sizeof(DP) != 72) {
::printf("Error: Invalid DP size struct\n");
exit(-1);
}
Expand Down
8 changes: 8 additions & 0 deletions SECPK1/Int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ void Int::Add(uint64_t a) {
unsigned char c = 0;
c = _addcarry_u64(c, bits64[0], a, bits64 + 0);
c = _addcarry_u64(c, bits64[1], 0, bits64 + 1);
if (!c)
return;
c = _addcarry_u64(c, bits64[2], 0, bits64 + 2);
c = _addcarry_u64(c, bits64[3], 0, bits64 + 3);
c = _addcarry_u64(c, bits64[4], 0, bits64 + 4);
Expand All @@ -136,6 +138,8 @@ void Int::AddOne() {

unsigned char c = 0;
c = _addcarry_u64(c, bits64[0],1, bits64 +0);
if (!c)
return;
c = _addcarry_u64(c, bits64[1],0, bits64 +1);
c = _addcarry_u64(c, bits64[2],0, bits64 +2);
c = _addcarry_u64(c, bits64[3],0, bits64 +3);
Expand Down Expand Up @@ -583,6 +587,8 @@ void Int::Sub(uint64_t a) {
unsigned char c = 0;
c = _subborrow_u64(c, bits64[0], a, bits64 + 0);
c = _subborrow_u64(c, bits64[1], 0, bits64 + 1);
if (!c)
return;
c = _subborrow_u64(c, bits64[2], 0, bits64 + 2);
c = _subborrow_u64(c, bits64[3], 0, bits64 + 3);
c = _subborrow_u64(c, bits64[4], 0, bits64 + 4);
Expand All @@ -599,6 +605,8 @@ void Int::SubOne() {

unsigned char c = 0;
c = _subborrow_u64(c, bits64[0], 1, bits64 + 0);
if (!c)
return;
c = _subborrow_u64(c, bits64[1], 0, bits64 + 1);
c = _subborrow_u64(c, bits64[2], 0, bits64 + 2);
c = _subborrow_u64(c, bits64[3], 0, bits64 + 3);
Expand Down
1 change: 1 addition & 0 deletions cuda_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
75
3 changes: 0 additions & 3 deletions deviceQuery/cuda_build_log.txt

This file was deleted.

14 changes: 11 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace std;

void printUsage() {

printf("Kangaroo [-v] [-t nbThread] [-d dpBit] [gpu] [-check]\n");
printf("Kangaroo-256 [-v] [-t nbThread] [-d dpBit] [gpu] [-check]\n");
printf(" [-gpuId gpuId1[,gpuId2,...]] [-g g1x,g1y[,g2x,g2y,...]]\n");
printf(" inFile\n");
printf(" -v: Print version\n");
Expand Down Expand Up @@ -167,9 +167,9 @@ static bool splitWorkFile = false;
int main(int argc, char* argv[]) {

#ifdef USE_SYMMETRY
printf("Kangaroo v" RELEASE " (with symmetry)\n");
printf("Kangaroo v" RELEASE " (with symmetry [256 range edition by NotATether])\n");
#else
printf("Kangaroo v" RELEASE "\n");
printf("Kangaroo v" RELEASE " [256 range edition by NotATether]\n");
#endif

// Global Init
Expand Down Expand Up @@ -272,10 +272,18 @@ int main(int argc, char* argv[]) {
Kangaroo::CreateEmptyPartWork(workFile);
exit(0);
} else if(strcmp(argv[a],"-s") == 0) {
if (serverIP != "") {
printf("-s and -c are incompatible\n");
exit(-1);
}
a++;
serverMode = true;
} else if(strcmp(argv[a],"-c") == 0) {
CHECKARG("-c",1);
if (serverMode) {
printf("-s and -c are incompatible\n");
exit(-1);
}
serverIP = string(argv[a]);
a++;
} else if(strcmp(argv[a],"-sp") == 0) {
Expand Down

0 comments on commit ac0937e

Please sign in to comment.