As best I can tell the 1gh patch simply uses OpenSSL for the stratum sha256 calculation. Here is the patch for Cudaminer although 1gh is still funky, they hardly ever accept shares even though you're cranking away forever. Also keep in mind this make break it for other stratum (ie. maybe it's 1gh that is broken, not cpu-miner).
diff --git a/configure.ac b/configure.ac
index 2f09e02..d091e1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,9 @@ AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS="-lpthread",
AC_CHECK_LIB([pthreadGC], [pthread_create], PTHREAD_LIBS="-lpthreadGC"
))))
+AC_CHECK_LIB([ssl],[SSL_library_init], [], [AC_MSG_ERROR([OpenSSL library required])])
+AC_CHECK_LIB([crypto],[EVP_DigestFinal_ex], [], [AC_MSG_ERROR([OpenSSL library required])])
+
AM_CONDITIONAL([WANT_JANSSON], [test x$request_jansson = xtrue])
AM_CONDITIONAL([HAVE_WINDOWS], [test x$have_win32 = xtrue])
AM_CONDITIONAL([ARCH_x86], [test x$have_x86 = xtrue])
diff --git a/cpu-miner.c b/cpu-miner.c
index 92be8de..d4ce1af 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -35,6 +35,7 @@
#endif
#include
#include
+#include
#include "compat.h"
#include "miner.h"
#include "salsa_kernel.h"
@@ -719,7 +720,7 @@ static void stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
memcpy(work->xnonce2, sctx->job.xnonce2, sctx->xnonce2_size);
/* Generate merkle root */
- sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size);
+ SHA256((unsigned char*)sctx->job.coinbase, sctx->job.coinbase_size, (unsigned char*)merkle_root);
for (i = 0; i < sctx->job.merkle_count; i++) {
memcpy(merkle_root + 32, sctx->job.merkle[i], 32);
sha256d(merkle_root, merkle_root, 64);