Skip to content

Commit

Permalink
Linux fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pons committed Apr 21, 2020
1 parent 91e9c18 commit e88b939
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion HashTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class HashTable {
HashTable();
bool Add(Int *x,KANGAROO *k);
ENTRY *CreateEntry(int256_t *i,KANGAROO *k);
int HashTable::compare(int256_t *i1,int256_t *i2);
int compare(int256_t *i1,int256_t *i2);
uint64_t GetNbItem();
void Reset();
double GetSizeMB();
Expand Down
7 changes: 7 additions & 0 deletions Kangaroo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ void Kangaroo::Run(int nbThread) {
JoinThreads(thHandles,nbCPUThread);
FreeHandles(thHandles,nbCPUThread);

// Free
for(i = 0; i < nbCPUThread; i++) {
for(int j = 0; j<CPU_GRP_SIZE; j++)
free(params[i].herd[j]);
}
hashTable.Reset();

}

double t1 = Timer::get_tick();
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
SRC = SECPK1/IntGroup.cpp main.cpp SECPK1/Random.cpp \
Timer.cpp SECPK1/Int.cpp SECPK1/IntMod.cpp \
SECPK1/Point.cpp SECPK1/SECP256K1.cpp \
BSGS.cpp HashTable.cpp Thread.cpp
Kangaroo.cpp HashTable.cpp Thread.cpp

OBJDIR = obj

OBJET = $(addprefix $(OBJDIR)/, \
SECPK1/IntGroup.o main.o SECPK1/Random.o \
Timer.o SECPK1/Int.o SECPK1/IntMod.o \
SECPK1/Point.o SECPK1/SECP256K1.o \
BSGS.o HashTable.o Thread.o)
Kangaroo.o HashTable.o Thread.o)

CXX = g++

Expand All @@ -33,8 +33,8 @@ $(OBJDIR)/%.o : %.cpp
all: bsgs

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

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

Expand Down
22 changes: 3 additions & 19 deletions in.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
40000000
49dccfd96dc5df56487436f5a1b18c4f5d34f65ddb48cb5e0000000000000000
49dccfd96dc5df56487436f5a1b18c4f5d34f65ddb48cb5effffffffffffffff
0459A3BFDAD718C9D3FAC7C187F1139F0815AC5D923910D516E186AFDA28B221DC994327554CED887AAE5D211A2407CDD025CFC3779ECB9C9D7F2F1A1DDF3E9FF8
04A50FBBB20757CC0E9C41C49DD9DF261646EE7936272F3F68C740C9DA50D42BCD3E48440249D6BC78BC928AA52B1921E9690EBA823CBC7F3AF54B3707E6A73F34
0404A49211C0FE07C9F7C94695996F8826E09545375A3CF9677F2D780A3EB70DE3BD05357CAF8340CB041B1D46C5BB6B88CD9859A083B0804EF63D498B29D31DD1
040B39E3F26AF294502A5BE708BB87AEDD9F895868011E60C1D2ABFCA202CD7A4D1D18283AF49556CF33E1EA71A16B2D0E31EE7179D88BE7F6AA0A7C5498E5D97F
04837A31977A73A630C436E680915934A58B8C76EB9B57A42C3C717689BE8C0493E46726DE04352832790FD1C99D9DDC2EE8A96E50CAD4DCC3AF1BFB82D51F2494
040ECDB6359D41D2FD37628C718DDA9BE30E65801A88A00C3C5BDF36E7EE6ADBBAD71A2A535FCB54D56913E7F37D8103BA33ED6441D019D0922AC363FCC792C29A
0422DD52FCFA3A4384F0AFF199D019E481D335923D8C00BADAD42FFFC80AF8FCF038F139D652842243FC841E7C5B3E477D901F88C5AB0B88EE13D80080E413F2ED
04DB4F1B249406B8BD662F78CBA46F5E90E20FE27FC69D0FBAA2F06E6E50E536695DF83B68FD0F396BB9BFCF6D4FE312F32A43CF3FA1FE0F81DF70C877593B64E0
043BD0330D7381917F8860F1949ACBCCFDC7863422EEE2B6DB7EDD551850196687528B6D2BC0AA7A5855D168B26C6BAF9DDCD04B585D42C7B9913F60421716D37A
04332A02CA42C481EAADB7ADB97DF89033B23EA291FDA809BEA3CE5C3B73B20C49C410D1AD42A9247EB8FF217935C9E28411A08B325FBF28CC2AF8182CE2B5CE38
04513981849DE1A1327DEF34B51F5011C5070603CA22E6D868263CB7C908525F0C19EBA6BD2A8DCF651E4342512EDEACB6EA22DA323A194E25C6A1614ABD259BC0
04D4E6FA664BD75A508C0FF0ED6F2C52DA2ADD7C3F954D9C346D24318DBD2ECFC6805511F46262E10A25F252FD525AF1CBCC46016B6CD0A7705037364309198DA1
0456B468963752924DBF56112633DC57F07C512E3671A16CD7375C58469164599D1E04011D3E9004466C814B144A9BCB7E47D5BACA1B90DA0C4752603781BF5873
04D5BE7C653773CEE06A238020E953CFCD0F22BE2D045C6E5B4388A3F11B4586CBB4B177DFFD111F6A15A453009B568E95798B0227B60D8BEAC98AF671F31B0E2B
04B1985389D8AB680DEDD67BBA7CA781D1A9E6E5974AAD2E70518125BAD5783EB5355F46E927A030DB14CF8D3940C1BED7FB80624B32B349AB5A05226AF15A2228
0455B95BEF84A6045A505D015EF15E136E0A31CC2AA00FA4BCA62E5DF215EE981B3B4D6BCE33718DC6CF59F28B550648D7E8B2796AC36F25FF0C01F8BC42A16FD9
0
FFFFFFFFFFFFFF
02E9F43F810784FF1E91D8BC7C4FF06BFEE935DA71D7350734C3472FE305FEF82A

0 comments on commit e88b939

Please sign in to comment.