diff --git a/jni/jni_curve25519.c b/jni/jni_curve25519.c index c6d944a..b32afc1 100644 --- a/jni/jni_curve25519.c +++ b/jni/jni_curve25519.c @@ -34,6 +34,10 @@ #define MAX_CURVE25519_PRIVATE_DER_SZ 128 +#if !defined(WC_NO_RNG) && defined(NO_OLD_RNGNAME) + #define RNG WC_RNG +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Curve25519_mallocNativeStruct( JNIEnv* env, jobject this) diff --git a/jni/jni_dh.c b/jni/jni_dh.c index c2dd346..c6549ad 100644 --- a/jni/jni_dh.c +++ b/jni/jni_dh.c @@ -31,6 +31,10 @@ /* #define WOLFCRYPT_JNI_DEBUG_ON */ #include +#if !defined(WC_NO_RNG) && defined(NO_OLD_RNGNAME) + #define RNG WC_RNG +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Dh_mallocNativeStruct( JNIEnv* env, jobject this) { diff --git a/jni/jni_ecc.c b/jni/jni_ecc.c index 2bb7b9d..35f0e27 100644 --- a/jni/jni_ecc.c +++ b/jni/jni_ecc.c @@ -34,6 +34,10 @@ #define MAX_ECC_PRIVATE_DER_SZ 128 +#if !defined(WC_NO_RNG) && defined(NO_OLD_RNGNAME) + #define RNG WC_RNG +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Ecc_mallocNativeStruct( JNIEnv* env, jobject this) diff --git a/jni/jni_ed25519.c b/jni/jni_ed25519.c index 071cd44..fb39dfd 100644 --- a/jni/jni_ed25519.c +++ b/jni/jni_ed25519.c @@ -34,6 +34,10 @@ #define MAX_ED25519_PRIVATE_DER_SZ 128 +#if !defined(WC_NO_RNG) && defined(NO_OLD_RNGNAME) + #define RNG WC_RNG +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Ed25519_mallocNativeStruct( JNIEnv* env, jobject this) diff --git a/jni/jni_hmac.c b/jni/jni_hmac.c index cfa4c46..b098db5 100644 --- a/jni/jni_hmac.c +++ b/jni/jni_hmac.c @@ -35,6 +35,25 @@ #define MAX_DIGEST_SIZE WC_MAX_DIGEST_SIZE #endif +#ifdef NO_OLD_WC_NAMES + #ifndef NO_MD5 + #define MD5_DIGEST_SIZE WC_MD5_DIGEST_SIZE + #endif + #ifndef NO_SHA + #define SHA_DIGEST_SIZE WC_SHA_DIGEST_SIZE + #endif + #ifndef NO_SHA256 + #define SHA256_DIGEST_SIZE WC_SHA256_DIGEST_SIZE + #endif + #ifdef WOLFSSL_SHA384 + #define SHA384_DIGEST_SIZE WC_SHA384_DIGEST_SIZE + #endif + #ifdef WOLFSSL_SHA512 + #define SHA512_DIGEST_SIZE WC_SHA512_DIGEST_SIZE + #endif + #define MAX_DIGEST_SIZE WC_MAX_DIGEST_SIZE +#endif + /* copy from cyassl/hmac.c */ static WC_INLINE int GetHashSizeByType(int type) { diff --git a/jni/jni_md5.c b/jni/jni_md5.c index 8d579b0..38a20c2 100644 --- a/jni/jni_md5.c +++ b/jni/jni_md5.c @@ -33,6 +33,16 @@ /* #define WOLFCRYPT_JNI_DEBUG_ON */ #include +#ifndef NO_OLD_MD5_NAME + #define MD5 WC_MD5 +#endif + +#ifdef NO_OLD_WC_NAMES + #define Md5 wc_Md5 + #define MD5_BLOCK_SIZE WC_MD5_BLOCK_SIZE + #define MD5_DIGEST_SIZE WC_MD5_DIGEST_SIZE +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Md5_mallocNativeStruct( JNIEnv* env, jobject this) diff --git a/jni/jni_rng.c b/jni/jni_rng.c index ef95877..591843f 100644 --- a/jni/jni_rng.c +++ b/jni/jni_rng.c @@ -33,6 +33,10 @@ /* #define WOLFCRYPT_JNI_DEBUG_ON */ #include +#if !defined(WC_NO_RNG) && defined(NO_OLD_RNGNAME) + #define RNG WC_RNG +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Rng_mallocNativeStruct( JNIEnv* env, jobject this) diff --git a/jni/jni_rsa.c b/jni/jni_rsa.c index 7510710..f85899d 100644 --- a/jni/jni_rsa.c +++ b/jni/jni_rsa.c @@ -33,6 +33,10 @@ /* #define WOLFCRYPT_JNI_DEBUG_ON */ #include +#if !defined(WC_NO_RNG) && defined(NO_OLD_RNGNAME) + #define RNG WC_RNG +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Rsa_mallocNativeStruct( JNIEnv* env, jobject this) diff --git a/jni/jni_sha.c b/jni/jni_sha.c index fa1f066..3e05e20 100644 --- a/jni/jni_sha.c +++ b/jni/jni_sha.c @@ -34,6 +34,33 @@ /* #define WOLFCRYPT_JNI_DEBUG_ON */ #include +#ifdef NO_OLD_WC_NAMES + #ifndef NO_SHA + #define Sha wc_Sha + #define SHA_BLOCK_SIZE WC_SHA_BLOCK_SIZE + #define SHA_DIGEST_SIZE WC_SHA_DIGEST_SIZE + #define SHA_PAD_SIZE WC_SHA_PAD_SIZE + #endif + #ifndef NO_SHA256 + #define Sha256 wc_Sha256 + #define SHA256_BLOCK_SIZE WC_SHA256_BLOCK_SIZE + #define SHA256_DIGEST_SIZE WC_SHA256_DIGEST_SIZE + #define SHA256_PAD_SIZE WC_SHA256_PAD_SIZE + #endif + #ifdef WOLFSSL_SHA384 + #define Sha384 wc_Sha384 + #define SHA384_BLOCK_SIZE WC_SHA384_BLOCK_SIZE + #define SHA384_DIGEST_SIZE WC_SHA384_DIGEST_SIZE + #define SHA384_PAD_SIZE WC_SHA384_PAD_SIZE + #endif + #ifdef WOLFSSL_SHA512 + #define Sha512 wc_Sha512 + #define SHA512_BLOCK_SIZE WC_SHA512_BLOCK_SIZE + #define SHA512_DIGEST_SIZE WC_SHA512_DIGEST_SIZE + #define SHA512_PAD_SIZE WC_SHA512_PAD_SIZE + #endif +#endif + JNIEXPORT jlong JNICALL Java_com_wolfssl_wolfcrypt_Sha_mallocNativeStruct( JNIEnv* env, jobject this)