forked from I2P_Developers/i2p.i2p
remove nativeDoubleValue(), update jbigi README
This commit is contained in:
@@ -9,9 +9,19 @@ TODO: Document generated folder structure
|
||||
TODO: Instructions for adding the libraries to a jar
|
||||
|
||||
Linux-specific information:
|
||||
===========================
|
||||
Some linux distributions comes bundled with GMP.
|
||||
There is currently no out-of-the-box support for this in the current build-scripts.
|
||||
Try 'locate lib/libgmp.so' to see.
|
||||
If so, install the the libgmp3-dev debian package to get the libgmp headers.
|
||||
Then export I2P=/path/to/your/i2p/install.
|
||||
Then do 'build.sh dynamic'. This will do a quick build using your installed libgmp library
|
||||
and then test it and the jbigi in your I2P installation to see which is faster.
|
||||
|
||||
If the new jbigi is slower, then run 'build.sh' (without the 'dynamic'), which will download
|
||||
the 4.3.1 libgmp library, build, and test that.
|
||||
|
||||
|
||||
Windows-specific information:
|
||||
=============================
|
||||
The best way of building the jbigi dll's is to install Mingw {URL} and msys {URL}.
|
||||
The combination of these two should be able to run the included build-scripts without modifications.
|
||||
|
@@ -57,33 +57,6 @@ JNIEXPORT jbyteArray JNICALL Java_net_i2p_util_NativeBigInteger_nativeModPow
|
||||
return jresult;
|
||||
}
|
||||
|
||||
/******** nativeDoubleValue() */
|
||||
/*
|
||||
* Class: net_i2p_util_NativeBigInteger
|
||||
* Method: nativeDoubleValue
|
||||
* Signature: ([B)D
|
||||
*
|
||||
* From the Javadoc:
|
||||
*
|
||||
* Converts a BigInteger byte-array to a 'double'
|
||||
* @param ba Big endian twos complement representation of the BigInteger to convert to a double
|
||||
* @return The plain double-value represented by 'ba'
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_net_i2p_util_NativeBigInteger_nativeDoubleValue
|
||||
(JNIEnv * env, jclass cls, jbyteArray jba){
|
||||
/* 1) Convert the bytearray BigInteger value into the format libgmp understands
|
||||
* 2) Call libgmp's mpz_get_d.
|
||||
* 3) Convert libgmp's result into a big endian twos complement number.
|
||||
*/
|
||||
mpz_t mval;
|
||||
jdouble retval;
|
||||
convert_j2mp(env, jba, &mval);
|
||||
|
||||
retval = mpz_get_d(mval);
|
||||
mpz_clear(mval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/******************************
|
||||
*****Conversion methods*******
|
||||
******************************/
|
||||
|
Reference in New Issue
Block a user