diff --git a/Android.mk b/Android.mk index 5f01b16..dfc98dc 100644 --- a/Android.mk +++ b/Android.mk @@ -100,7 +100,7 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) # -ftree-vectorizer-verbose=2: verbose output during compile # Note: not all V7a targets support NEON! # LOCAL_ARM_NEON := true -LOCAL_CFLAGS += -DTFM_ARM -mimplicit-it=thumb +LOCAL_CFLAGS += -DTFM_ARM endif include $(BUILD_STATIC_LIBRARY) diff --git a/Android_jni/README b/Android_jni/README index 6ba47f8..0aa3670 100644 --- a/Android_jni/README +++ b/Android_jni/README @@ -15,6 +15,10 @@ when compiled for armeabi: For now, the armeabi target will use the unoptimized C code. TFM_ARM is conditionally defined for the armeabi-v7a target. +Don't forget to change FP_MAX_SIZE in src/headers/tfm.h to suit your needs, e.g. + + #define FP_MAX_SIZE (16384+(8*DIGIT_BIT)) + Build instructions: (1) Clone this git repository to your project's JNI directory, naming the directory "tfm". diff --git a/src/mont/fp_montgomery_reduce.c b/src/mont/fp_montgomery_reduce.c index 71d9499..77a679d 100644 --- a/src/mont/fp_montgomery_reduce.c +++ b/src/mont/fp_montgomery_reduce.c @@ -296,6 +296,9 @@ asm( \ asm( \ " LDR r0,%1 \n\t" \ " ADDS r0,r0,%0 \n\t" \ +#if defined(__thumb2__) + " ITE CS \n\t" \ +#endif " MOVCS %0,#1 \n\t" \ " MOVCC %0,#0 \n\t" \ " UMLAL r0,%0,%3,%4 \n\t" \ @@ -307,6 +310,9 @@ asm( \ " LDR r0,%1 \n\t" \ " ADDS r0,r0,%0 \n\t" \ " STR r0,%1 \n\t" \ +#if defined(__thumb2__) + " ITE CS \n\t" \ +#endif " MOVCS %0,#1 \n\t" \ " MOVCC %0,#0 \n\t" \ :"=r"(cy),"=g"(_c[0]):"0"(cy),"1"(_c[0]):"r0","%cc");