fix compatibility with no old names
parent
4e477cdc1b
commit
f20c2e4b2a
|
@ -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)
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
/* #define WOLFCRYPT_JNI_DEBUG_ON */
|
||||
#include <wolfcrypt_jni_debug.h>
|
||||
|
||||
#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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -33,6 +33,16 @@
|
|||
/* #define WOLFCRYPT_JNI_DEBUG_ON */
|
||||
#include <wolfcrypt_jni_debug.h>
|
||||
|
||||
#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)
|
||||
|
|
|
@ -33,6 +33,10 @@
|
|||
/* #define WOLFCRYPT_JNI_DEBUG_ON */
|
||||
#include <wolfcrypt_jni_debug.h>
|
||||
|
||||
#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)
|
||||
|
|
|
@ -33,6 +33,10 @@
|
|||
/* #define WOLFCRYPT_JNI_DEBUG_ON */
|
||||
#include <wolfcrypt_jni_debug.h>
|
||||
|
||||
#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)
|
||||
|
|
|
@ -34,6 +34,33 @@
|
|||
/* #define WOLFCRYPT_JNI_DEBUG_ON */
|
||||
#include <wolfcrypt_jni_debug.h>
|
||||
|
||||
#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)
|
||||
|
|
Loading…
Reference in New Issue