[Dev] Java NeoScrypt Implementation
-
This seems like a good idea, as it could also be implemented into the browser (think of bitcoinplus.com), and if its performance can get anywhere close to minerd it could be an easier option for those who only cpu mine, or have a redundant pc or 2 they wanted to use
also the java applet can be updated on the file server (i believe it works like this) and clients simply restart/refresh to pull the latest version from it, hence updates/performance fixes would be easier,
as for a java based Feathercoin wallet, im not so sure, because of the vulnerabilities ive heard about it (unless they are just myths - let me know then i can stop being concerned about that), but as for a miner, great, makes it more portable, and hey if it can run on android, i’d even mine with my old galaxy mini! probably hits about 5s per hash its that slow but every little helps xD
-
Kris, you need to create simple test functions like those in NEOSCRYPT_TEST and compare your results with the reference. It saves a good deal of time, really.
-
Yes that’s the type of thing I was looking for.
I want to write jUnits to make sure the code works as expected and to make sure if anyone makes any changes in the future they can tell if they have broken anything.
I cant find NEOSCRYPT_TEST in github could you point me in the right direction please.?
As for java vulnerabilities are potentially real but really only effect people who are not keeping there version of java up to date. This is much the same with any software as when vulnerabilities are found they are usually quickly fixed but you must update/upgrade to make sure you have the most stable secure version.
-
I’ve added more tests already, but they are not there yet.
-
ok ive been doing some work on getting java to call c and i have made some progress at last.
i now have my java code calling a c function with this signature
in Java
neoscrypt(int input, int output, long profile);
in my new C method
neoscrypt(jint input, jint input, jlong profile)
I have had to use int and long respectively as java does not have unsigned char or unsigned int so i have just bumped up to the next size up so it can hold the value needed in c.
ok now I have included ghostlanders neoscrypt.h in my own c class (Neoscrypt.c which was a bad name i know lol) and have implemented this method. (its a little non standard as its using JNI so java can call it.)
#include "Neoscrypt.h"#include "neoscrypt.h" JNIEXPORT void JNICALL Java_Neoscrypt_printText(JNIEnv *env, jobject obj) { puts ("Hello World !!!!");} JNIEXPORT void JNICALL Java_Neoscrypt_neoscrypt(JNIEnv *env, jobject obj, jint input, jint output, jlong profile) { puts("Called Neoscrypt function ....."); const unsigned char *inputChar; unsigned char *outputChar; unsigned int profileInt; inputChar = (unsigned char *)input; outputChar = (unsigned char *)output; profileInt = (unsigned int)profile; puts(".......Neoscrypt function finshed"); neoscrypt(inputChar,outputChar,profileInt); return; }
essentially im stuck as I dont know any C and I need to figure out how to get the value out of the jint and into an unsigned char * so it can be passed to the real method below.
I have a hello world c function that is being called from java so Im making progress but im instantly out of my depth with c.
any help would be great.
-
ok ignore that last post.
I now have a working (I think) JNI java wrapper for neoscrypt.
its only a standalone one for now but thats a step in the right direction.
its hosted here if anyone is interested
-
Epic!
-
+1
+1 -
ok ignore that last post.
I now have a working (I think) JNI java wrapper for neoscrypt.
its only a standalone one for now but thats a step in the right direction.
its hosted here if anyone is interested
Great work :)
I’ll give it a try as soon as possible
-
Does this mean that we can hash on our mobile devices? Or it can do other things?
-
Well technically yes we could write a miner android app. But the implementation was really for validating blocks in a wallet rather than mining. :)
-
There is a java wrapper around the neoscrypt c-code available on github now.
Due to the nature of the native library neoscrypt.so it is working for arm devices only, but it should be no big problem to compile the neoscrypt C-code on other hardware.
The java neoscrypt repository is located at: https://github.com/wellenreiter01/neoscryptj