Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mavericks #55

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LIBS=-lpcre -lcrypto -lm -lpthread
CFLAGS=-ggdb -O3 -Wall
CFLAGS=-ggdb -O3 -Wall -isystem/opt/local/include -D WHITH_PKCS5_PBKDF2_HMAC=1 -D MAVERICKS=1
OBJS=vanitygen.o oclvanitygen.o oclvanityminer.o oclengine.o keyconv.o pattern.o util.o
PROGS=vanitygen keyconv oclvanitygen oclvanityminer

Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ vg_decode_privkey(const char *b58encoded, EC_KEY *pkey, int *addrtype)
return 1;
}

#if OPENSSL_VERSION_NUMBER < 0x10000000L
#if WHITH_PKCS5_PBKDF2_HMAC || (OPENSSL_VERSION_NUMBER < 0x10000000L)
/* The generic PBKDF2 function first appeared in OpenSSL 1.0 */
/* ====================================================================
* Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
Expand Down
25 changes: 25 additions & 0 deletions vanitygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <openssl/bn.h>
#include <openssl/rand.h>

#if MAVERICKS
#include <sys/sysctl.h>
#endif

#include "pattern.h"
#include "util.h"

Expand Down Expand Up @@ -241,6 +245,26 @@ vg_thread_loop(void *arg)


#if !defined(_WIN32)
#if MAVERICKS
int
count_processors(void)
{
int nCpu = 0;
size_t len = sizeof (nCpu);
const int retstat = sysctlbyname ("hw.logicalcpu", &nCpu, &len, NULL, 0);
if ( retstat < 0 ) {
perror("sysctl hw.logicalcpu failed: wrong retstat");
exit( EXIT_FAILURE );
}
if (len != sizeof (nCpu)){
perror("sysctl hw.logicalcpu failed: wrong len");
exit( EXIT_FAILURE );
}
fprintf(stderr, "hw.logicalcpu: %d;\n", nCpu);

return nCpu;
}
#else
int
count_processors(void)
{
Expand All @@ -260,6 +284,7 @@ count_processors(void)
return count;
}
#endif
#endif

int
start_threads(vg_context_t *vcp, int nthreads)
Expand Down