AES加密速度

the rate of AES encryption

run cts -m CtsSecurityTestCases -t android.security.cts.EncryptionTest#testEncryption

在测试CTS   CtsSecurityTestCases 项的时候,会检查手机data区是否加密,加密速度

应该有两种

ConsoleReporter: [0123456789ABCDEF] Starting armeabi-v7a CtsSecurityTestCases with 1 test //测试32位的库

ConsoleReporter: [0123456789ABCDEF] Starting arm64-v8a CtsSecurityTestCases with 1 test  //测试64位的库


EncryptionTest::aesIsFast: 100 iterations in 93 ms (1075.3 MiB/s) (threshold 2000 ms)  //32位测试结果

EncryptionTest::aesIsFast: 100 iterations in 92 ms (1087.0 MiB/s) (threshold 2000 ms) //64位测试结果


注意:如果手机默认加密了,在测试这样CTS的时候是不会打印上面的加密速度的。

CTS源码,cts/tests/tests/security/src/android/security/cts/EncryptionTest.java

public void testEncryption() throws Exception {
        if (!isRequired() || deviceIsEncrypted()) {//如果请求过或者 设备已经加密了,直接返回,不会调用aesIsFast
            return;
        }

        // Required if performance is sufficient
        assertFalse("Device encryption is required", aesIsFast());
    }

如果想测试加密过的手机,可以修改这部分源码,编译后,替换CTS测试中响应的apk,可以打印出来,但是CTS会测试失败

[arm64-v8a CtsSecurityTestCases 0123456789ABCDEF] android.security.cts.EncryptionTest#testEncryption fail: junit.framework.AssertionFailedError: Device encryption is required

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值