Android bdk-build error:libxxx.so/.a use VFP register arguments, output does not解决办法

修改Application.mk文件如下:

APP_STL := gnustl_static
APP_OPTIM :=release
APP_CFLAGS := -O3
APP_CPPFLAGS := -frtti -fexceptions -mfloat-abi=hard -O3
APP_PLATFORM  := android-9
APP_ABI := armeabi-v7a-hard

修改Android,mk文件中LOCAL_LDLIBS与LOCAL_CFLAGS两项如下:

LOCAL_LDLIBS +=  -O3 -mfpu=vfpv3-d16 -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -march=armv7-a -static -mcpu=cortex-a9
LOCAL_CFLAGS +=  -O3 -mfpu=vfpv3-d16 -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfloat-abi=hard -march=armv7-a -static -mcpu=cortex-a9

(-mcpu为指定ARMcpu型号,依据具体ARM处理器而定)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
As an AI language model, I don't have access to examples of keys or sensitive information. However, I can provide you with the general steps for generating an IPEK using BouncyCastle: 1. Generate a random 16-byte key, called the "Key Encryption Key" (KEK). 2. Using the KEK and the BDK (Base Derivation Key), generate a 16-byte key called the "Initial PIN Encryption Key" (IPEK). 3. XOR the IPEK with the first 8 bytes of the KSN (Key Serial Number) to generate the "PIN Encryption Key" (PEK). 4. XOR the IPEK with the second 8 bytes of the KSN to generate the "Data Encryption Key" (DEK). Here's the Java code using BouncyCastle: ``` import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.modes.CBCBlockCipher; import org.bouncycastle.crypto.params.KeyParameter; import org.bouncycastle.crypto.params.ParametersWithIV; import org.bouncycastle.util.encoders.Hex; public class IpekGenerator { private static final byte[] BDK = Hex.decode("0123456789ABCDEFFEDCBA9876543210"); private static final byte[] KSN = Hex.decode("FFFF9876543210E00001"); public static void main(String[] args) { // Generate KEK byte[] kek = new byte[16]; new SecureRandom().nextBytes(kek); // Generate IPEK byte[] ipek = generateIpek(BDK, kek); System.out.println("IPEK: " + Hex.toHexString(ipek)); // Generate PEK and DEK byte[] pek = generatePek(ipek, KSN); byte[] dek = generateDek(ipek, KSN); System.out.println("PEK: " + Hex.toHexString(pek)); System.out.println("DEK: " + Hex.toHexString(dek)); } private static byte[] generateIpek(byte[] bdk, byte[] kek) { byte[] data = new byte[16]; System.arraycopy(kek, 0, data, 0, 8); System.arraycopy(bdk, 0, data, 8, 8); CBCBlockCipher cipher = new CBCBlockCipher(new AESEngine()); ParametersWithIV params = new ParametersWithIV(new KeyParameter(bdk), new byte[16]); cipher.init(true, params); byte[] ipek = new byte[16]; cipher.processBlock(data, 0, ipek, 0); return ipek; } private static byte[] generatePek(byte[] ipek, byte[] ksn) { byte[] pek = new byte[8]; for (int i = 0; i < 8; i++) { pek[i] = (byte) (ipek[i] ^ ksn[i]); } return pek; } private static byte[] generateDek(byte[] ipek, byte[] ksn) { byte[] dek = new byte[8]; for (int i = 0; i < 8; i++) { dek[i] = (byte) (ipek[i + 8] ^ ksn[i]); } return dek; } } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值