diff --git a/security/security_huks_basic/huks_cipher_callback_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksAESBasicCallbackJsunit.test.js b/security/security_huks_basic/huks_cipher_callback_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksAESBasicCallbackJsunit.test.js index c44b4173aa977b57b125498f8977678001b7d08f..e75b1a1f99c8dac7f573376e6fc17726424c415d 100644 --- a/security/security_huks_basic/huks_cipher_callback_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksAESBasicCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_cipher_callback_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksAESBasicCallbackJsunit.test.js @@ -96,7 +96,6 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) { let inDataArray = HuksOptions.inData; if (Array.from(inDataArray).length < dateSize) { await update(handle, HuksOptions); - // HuksOptions.inData = new Uint8Array(new Array()); await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt, 0); } else { let count = Math.floor(Array.from(inDataArray).length / dateSize); @@ -116,12 +115,7 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) { ) ); } - await publicFinishAbortFunc( - HuksOptions, - thirdInderfaceName, - isEncrypt, - remainder - ); + await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt); } } @@ -158,8 +152,7 @@ function updateCallback(handle, HuksOptions) { async function publicFinishAbortFunc( HuksOptions, thirdInderfaceName, - isEncrypt, - remainder + isEncrypt ) { if (thirdInderfaceName == 'finish') { await finish(HuksOptions, isEncrypt); diff --git a/security/security_huks_basic/huks_cipher_promise_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksCipherAESBasicPromiseJsunit.test.js b/security/security_huks_basic/huks_cipher_promise_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksCipherAESBasicPromiseJsunit.test.js index bbf5c1e3ecda89a8503942a7195c8438e97ae7a1..1a834473fc49f53e271e73b6970fb49e580c5903 100644 --- a/security/security_huks_basic/huks_cipher_promise_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksCipherAESBasicPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_cipher_promise_BasicTest/entry/src/main/js/test/Cipher/SecurityHuksCipherAESBasicPromiseJsunit.test.js @@ -92,12 +92,7 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) { } else { HuksOptions.inData = new Uint8Array(new Array()); } - await publicFinishAbortFunc( - HuksOptions, - thirdInderfaceName, - isEncrypt, - remainder - ); + await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt); } } @@ -124,8 +119,7 @@ async function update(handle, HuksOptions) { async function publicFinishAbortFunc( HuksOptions, thirdInderfaceName, - isEncrypt, - remainder + isEncrypt ) { if (thirdInderfaceName == 'finish') { await finish(HuksOptions, isEncrypt); diff --git a/security/security_huks_basic/huks_hmac_callback_BasicTest/BUILD.gn b/security/security_huks_basic/huks_hmac_callback_BasicTest/BUILD.gn index 27a317886e976732b199126fe7761c2c864dc510..856daedad37ceb490cde5adf046ca724c79a166a 100644 --- a/security/security_huks_basic/huks_hmac_callback_BasicTest/BUILD.gn +++ b/security/security_huks_basic/huks_hmac_callback_BasicTest/BUILD.gn @@ -1,30 +1,30 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("hukshmac_callback_basic_js_test") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":huks_js_assets", - ":huks_js_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsHuksHmacBasicCallbackJSApiTest" -} -ohos_js_assets("huks_js_assets") { - source_dir = "./entry/src/main/js/MainAbility" -} -ohos_resources("huks_js_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("hukshmac_callback_basic_js_test") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":huks_js_assets", + ":huks_js_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsHuksHmacBasicCallbackJSApiTest" +} +ohos_js_assets("huks_js_assets") { + source_dir = "./entry/src/main/js/MainAbility" +} +ohos_resources("huks_js_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/security/security_huks_basic/huks_hmac_promise_BasicTest/BUILD.gn b/security/security_huks_basic/huks_hmac_promise_BasicTest/BUILD.gn index 6b5f3b70c4f491dbaabc9ce165c42e6e927e1096..de6c66e0f2384bd6dbeaabd392c3bb33f3db2149 100644 --- a/security/security_huks_basic/huks_hmac_promise_BasicTest/BUILD.gn +++ b/security/security_huks_basic/huks_hmac_promise_BasicTest/BUILD.gn @@ -1,30 +1,30 @@ -# Copyright (C) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("hukshmac_promise_basic_js_test") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":huks_js_assets", - ":huks_js_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsHuksHmacBasicPromiseJSApiTest" -} -ohos_js_assets("huks_js_assets") { - source_dir = "./entry/src/main/js/MainAbility" -} -ohos_resources("huks_js_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} +# Copyright (C) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("hukshmac_promise_basic_js_test") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":huks_js_assets", + ":huks_js_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "ActsHuksHmacBasicPromiseJSApiTest" +} +ohos_js_assets("huks_js_assets") { + source_dir = "./entry/src/main/js/MainAbility" +} +ohos_resources("huks_js_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBCallbackJsunit.test.js index 035fc8051b3ae8d0c777dd4b9769392fefef50c4..dec2af574d863e4cf59a1b877c6d930c33b42fb6 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBCallbackJsunit.test.js @@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { NewSrcKeyAlies, HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBCallbackJsunit.test.js index 95895d8d4ed68464948eecc48d4ea8c8c91ce961..ae814fc709e2db2a5dfa786acbabdace050e3ce5 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBCallbackJsunit.test.js @@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { NewSrcKeyAlies, HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBCallbackJsunit.test.js index 7bff51dc60d5d457a6a5ead1e13f1755f7cf2f9c..79e956bcd4313671523aee66a56a09d59496c9ce 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBCallbackJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { it('testSignVerifyDSA001', 0, async function (done) { const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias001'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksTagDSACOMMONSIZE ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBCallbackJsunit.test.js index 490b801c3029771538b7acf019bb32098dc12735..d1c2003dd99320f880e1ceefe9f4d986c05c2915 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBCallbackJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { it('testSignVerifyDSA003', 0, async function (done) { const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias003'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksKeySIZE1024 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - false + false, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBCallbackJsunit.test.js index d8a9591ec62ee94ffc24f47716e330e6068fdd5d..a9339076018bc456a1dccd521ef6c05adeaef2a6 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBCallbackJsunit.test.js @@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBCallbackJsunit.test.js index cb986da792396057c9e1dd1eafa110340ae0e5a6..42cf30e6d1c911298400aa0c8a0860350a9a6ab4 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBCallbackJsunit.test.js @@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBCallbackJsunit.test.js index 45db6668f847c448e73bc7ed44f2c1601d7b2cd6..73aded4023d7e22327e998db466894a9114765ce 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBCallbackJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { it('testSignVerifyECC001', 0, async function (done) { const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias001'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksKeyECCSize224 ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBCallbackJsunit.test.js index 279d6b8bf83f8ea9aa17a3ec29a59482d158e0f0..1f2a03ee6c643aa02a2867d11e9299bc6fd396d8 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBCallbackJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { it('testSignVerifyECC003', 0, async function (done) { const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias003'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksKeyECCSize224 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicCallbackJsunit.test.js index 36f4de9239b3cfe7e498a277d1e0513b5b932221..9e48412ff4687b05705a4fd99ffd3661aa147772 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicCallbackJsunit.test.js @@ -21,6 +21,7 @@ let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { it('testSignVerifyED25519001', 0, async function (done) { const srcKeyAlies = 'testSignVerifyED25519Size256SIGNKeyAlias001'; @@ -33,12 +34,13 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { @@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksTagDigestSHA1 ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); @@ -76,7 +79,8 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); @@ -92,12 +96,13 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -106,14 +111,15 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksTagDigestSHA1 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData65Kb ); done(); }); @@ -134,7 +140,8 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBCallbackJsunit.test.js index 61fc28e2a1c4bca6230e4d05fa298a039fef087a..667a1901bf882259855ae7a089a45eb09016e0e1 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBCallbackJsunit.test.js @@ -40,7 +40,8 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBCallbackJsunit.test.js index f0945bfadef115c1b90a6257e15e8b4ea4e7cd86..c978731df7d4676d8e75140eedaf952d944f657f 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBCallbackJsunit.test.js @@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBCallbackJsunit.test.js index de55c6474b5e7c5d758104b062375f2dfdaeebfe..8380c0b581c4f0a664af193b5e6e57034952b593 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBCallbackJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { it('testSignVerifyRSA001', 0, async function (done) { const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias001'; @@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { properties: new Array( @@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSASize512 ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBCallbackJsunit.test.js b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBCallbackJsunit.test.js index dce3cdd51bbe70b19a0dc7adb75aa9d4d5a75a60..026203fab7f55ad24172245b324b3c58b8401a84 100644 --- a/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBCallbackJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_callback_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBCallbackJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { it('testSignVerifyRSA003', 0, async function (done) { const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias003'; @@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSASize512 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + false, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBPromiseJsunit.test.js index ee369309d6a24ac3b22ef0d9d4fecc415ee8efce..6c942e3f5ae35f4c6f99dca208793a2f0ad06a92 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort63KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { it('testSignVerifyDSA102', 0, async function (done) { const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias102'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, NewSrcKeyAlies, HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBPromiseJsunit.test.js index 3f76d1261e1e9714698f13b6138f84fd535dd9a5..c01a5e7f734d63b431453f49fd9782c2b11b206e 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicAbort65KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { it('testSignVerifyDSA104', 0, async function (done) { const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias104'; @@ -36,7 +37,8 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { NewSrcKeyAlies, HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBPromiseJsunit.test.js index 6eb95fec69445cf6822f814960d7bd556e5e4f0d..31628987a1e8e6686cf23f5fbc318b402bd582ec 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish63KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { it('testSignVerifyDSA101', 0, async function (done) { const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias101'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksTagDSACOMMONSIZE ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBPromiseJsunit.test.js index db70b9f297319d412c1b6646a3658225f1b52f88..cb19fdc526843a643b8a00e405f1a2c818a67cb7 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksDSABasicFinish65KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { it('testSignVerifyDSA103', 0, async function (done) { const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias103'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksKeySIZE1024 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, newSrcKeyAlies, HuksOptions, 'finish', - false + false, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBPromiseJsunit.test.js index 8ce919a55fbe1e01840a3fd5ea5c8991209ecd99..1900281c1c020d7941f7e1e679b08da3dd6059c9 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort63KBPromiseJsunit.test.js @@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBPromiseJsunit.test.js index e5665962919041737b3f5a6ccb75f8df60012ef7..d7000b4ed467afbe3725ff7e82de5391310177f9 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicAbort65KBPromiseJsunit.test.js @@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBPromiseJsunit.test.js index 54882eaf98c83a8778370164d26d4d82d869f813..aabb456231cd8230dcb03fc384b54ecf04872cf7 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish63KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { it('testSignVerifyECC101', 0, async function (done) { const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias101'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksKeyECCSize224 ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBPromiseJsunit.test.js index 5e579de4586ee974043b3d8633ab55d4df5ab696..c3a673af571e9af0801b1801f26b446d5c4d55d7 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksECCBasicFinish65KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { it('testSignVerifyECC103', 0, async function (done) { const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias103'; @@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksKeyECCSize224 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicPromiseJsunit.test.js index 3bba46b1d4d28497d20e92a6c721402c279be17d..f07216d6cc86ce4379e1284c6dfafdeb76ae572e 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksED25519BasicPromiseJsunit.test.js @@ -21,6 +21,7 @@ let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { it('testSignVerifyED25519101', 0, async function (done) { const srcKeyAlies = 'testSignVerifyED25519Size256SIGNKeyAlias101'; @@ -33,12 +34,13 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { @@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksTagDigestSHA1 ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); @@ -76,7 +79,8 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); @@ -92,12 +96,13 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { properties: new Array( @@ -106,14 +111,15 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksTagDigestSHA1 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData65Kb ); done(); }); @@ -134,7 +140,8 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBPromiseJsunit.test.js index 09aee608bae09698e077336b42640e3693e4077f..09dbca4f166863336db44fe04f780c782cc0962b 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort63KBPromiseJsunit.test.js @@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBPromiseJsunit.test.js index c0c5cab9ecba999ee920116c166aa1a72f0e4193..a500d3f51e49650a8f180f7f7c0c605878c547cf 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicAbort65KBPromiseJsunit.test.js @@ -38,7 +38,8 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { srcKeyAlies + 'New', HuksOptions, 'abort', - true + true, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBPromiseJsunit.test.js index f92b7bd072454a14ac8dc7db4298098543673f77..408f9b1ed3a71a2696d9af60c0a1fc07fe259bae 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish63KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData63 = Data.Data63b; let srcData63Kb = stringToUint8Array(srcData63); +let finishOutData; describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { it('testSignVerifyRSA101', 0, async function (done) { const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias101'; @@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ), inData: srcData63Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData63Kb ); HuksOptions = { properties: new Array( @@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSASize512 ), - inData: srcData63Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - false + false, + srcData63Kb ); done(); }); diff --git a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBPromiseJsunit.test.js b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBPromiseJsunit.test.js index 4d89223149507ca727352284e9b31fb92197f503..ead51dcaa0073c6d5cb652469449388e81adfe8d 100644 --- a/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBPromiseJsunit.test.js +++ b/security/security_huks_basic/huks_signverify_promise_BasicTest/entry/src/main/js/test/SignVerify/SecurityHuksRSABasicFinish65KBPromiseJsunit.test.js @@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; let srcData65 = Data.Data65b; let srcData65Kb = stringToUint8Array(srcData65); +let finishOutData; describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { it('testSignVerifyRSA103', 0, async function (done) { const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias103'; @@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ), inData: srcData65Kb, }; - await publicSignVerifyFunc( + finishOutData = await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + true, + srcData65Kb ); HuksOptions = { @@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSASize512 ), - inData: srcData65Kb, + inData: finishOutData, }; await publicSignVerifyFunc( srcKeyAlies, srcKeyAlies + 'New', HuksOptions, 'finish', - true + false, + srcData65Kb ); done(); }); diff --git a/security/security_huks_basic/utils/param/signverify/publicSignverifyCallback.js b/security/security_huks_basic/utils/param/signverify/publicSignverifyCallback.js index 1568eeca624259d6c8b8440b94a6a0c784fdb9d6..9ebc06986b4abf61e560bdf0c13748b23e9e0f25 100644 --- a/security/security_huks_basic/utils/param/signverify/publicSignverifyCallback.js +++ b/security/security_huks_basic/utils/param/signverify/publicSignverifyCallback.js @@ -49,7 +49,7 @@ function generateKey(srcKeyAlies, HuksOptions) { async function publicImportKey(keyAlias, HuksOptions) { let _InData = HuksOptions.inData; - HuksOptions.inData = finishOutData; + HuksOptions.inData = exportKey; await importKey(keyAlias, HuksOptions) .then((data) => { console.log(`test ImportKey data: ${JSON.stringify(data)}`); @@ -79,7 +79,7 @@ async function publicExportKey(keyAlias, HuksOptions) { await exportkey(keyAlias, HuksOptions) .then((data) => { console.log(`test exportKey data: ${JSON.stringify(data)}`); - finishOutData = data.outData; + exportKey = data.outData; }) .catch((err) => { console.log('test exportKey err information: ' + JSON.stringify(err)); @@ -127,13 +127,8 @@ function init(srcKeyAlies, HuksOptions) { }); } -async function publicUpdateFunc(HuksOptions, isBigData) { - let dateSize = 0; - if (isBigData) { - dateSize = 64 * 1024; - } else { - dateSize = 64; - } +async function publicUpdateFunc(HuksOptions) { + let dateSize = 64; let tempHuksOptionsInData = HuksOptions.inData; let inDataArray = HuksOptions.inData; if (uint8ArrayToString(inDataArray).length < dateSize) { @@ -194,7 +189,7 @@ async function publicFinishFunc(HuksOptions) { await finish(handle, HuksOptions) .then((data) => { console.log(`test finish data: ${JSON.stringify(data)}`); - exportKey = data.outData; + finishOutData = data.outData; expect(data.errorCode == 0).assertTrue(); }) .catch((err) => { @@ -272,66 +267,52 @@ async function publicSignVerifyFunc( HuksOptions, thirdInderfaceName, isSING, - isBigData + rawData ) { try { let keyAlias = srcKeyAlies; + let purposeSignVerigy = HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY; + let purposeSign = HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN; + let PurposeVerify = HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY; if (isSING) { - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY - ); + HuksOptions.properties.splice(1, 1, purposeSignVerigy); if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { HuksOptions.properties.splice(2, 0, HuksSignVerifyDSA.HuksKeySIZE1024); } await publicGenerateKeyFunc(keyAlias, HuksOptions); - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN - ); + HuksOptions.properties.splice(1, 1, purposeSign); if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { HuksOptions.properties.splice(2, 1); } } else { keyAlias = newSrcKeyAlies; + finishOutData = HuksOptions.inData; await publicImportKey(keyAlias, HuksOptions); } await publicInitFunc(keyAlias, HuksOptions); - await publicUpdateFunc(HuksOptions, isBigData); + HuksOptions.inData = rawData; + await publicUpdateFunc(HuksOptions); if (thirdInderfaceName == 'finish') { if (isSING) { - HuksOptions.outData = new Uint8Array(new Array(1024)); + HuksOptions.inData = new Uint8Array(new Array()); await publicFinishFunc(HuksOptions); - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY - ); + HuksOptions.properties.splice(1, 1, purposeSignVerigy); await publicExportKey(keyAlias, HuksOptions); } else { - HuksOptions.outData = exportKey; + HuksOptions.inData = finishOutData; await publicFinishFunc(HuksOptions); } } else { await publicAbortFucn(HuksOptions); } if (isSING && thirdInderfaceName == 'abort') { - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY - ); + HuksOptions.properties.splice(1, 1, purposeSignVerigy); await publicDeleteKeyFunc(srcKeyAlies, HuksOptions); } else if (!isSING) { - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY - ); + HuksOptions.properties.splice(1, 1, PurposeVerify); await publicDeleteKeyFunc(newSrcKeyAlies, HuksOptions); } + return finishOutData; } catch (e) { expect(null).assertFail(); } diff --git a/security/security_huks_basic/utils/param/signverify/publicSignverifyPromise.js b/security/security_huks_basic/utils/param/signverify/publicSignverifyPromise.js index 2f3f8ec5342dff43a50dd0d93a02235697b8120c..9e40804584a951503e39b43922066e2c222951ad 100644 --- a/security/security_huks_basic/utils/param/signverify/publicSignverifyPromise.js +++ b/security/security_huks_basic/utils/param/signverify/publicSignverifyPromise.js @@ -36,7 +36,7 @@ async function publicGenerateKeyFunc(keyAlias, HuksOptions) { async function publicImportKey(keyAlias, HuksOptions) { let _InData = HuksOptions.inData; - HuksOptions.inData = finishOutData; + HuksOptions.inData = exportKey; await huks .importKey(keyAlias, HuksOptions) .then((data) => { @@ -54,7 +54,7 @@ async function publicExportKey(keyAlias, HuksOptions) { .exportKey(keyAlias, HuksOptions) .then((data) => { console.log(`test exportKey data: ${JSON.stringify(data)}`); - finishOutData = data.outData; + exportKey = data.outData; }) .catch((err) => { console.log('test exportKey err information: ' + JSON.stringify(err)); @@ -76,13 +76,8 @@ async function publicInitFunc(keyAlias, HuksOptions) { }); } -async function publicUpdateFunc(HuksOptions, isBigData) { - let dateSize = 0; - if (isBigData) { - dateSize = 64 * 1024; - } else { - dateSize = 64; - } +async function publicUpdateFunc(HuksOptions) { + let dateSize = 64; let tempHuksOptionsInData = HuksOptions.inData; let inDataArray = HuksOptions.inData; if (uint8ArrayToString(inDataArray).length < dateSize) { @@ -132,7 +127,7 @@ async function publicFinishFunc(HuksOptions) { .finish(handle, HuksOptions) .then((data) => { console.log(`test finish data: ${JSON.stringify(data)}`); - exportKey = data.outData; + finishOutData = data.outData; expect(data.errorCode == 0).assertTrue(); }) .catch((err) => { @@ -173,66 +168,52 @@ async function publicSignVerifyFunc( HuksOptions, thirdInderfaceName, isSING, - isBigData + rawData ) { try { let keyAlias = srcKeyAlies; + let purposeSignVerigy = HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY; + let purposeSign = HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN; + let PurposeVerify = HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY; if (isSING) { - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY - ); + HuksOptions.properties.splice(1, 1, purposeSignVerigy); if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { HuksOptions.properties.splice(2, 0, HuksSignVerifyDSA.HuksKeySIZE1024); } await publicGenerateKeyFunc(keyAlias, HuksOptions); - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN - ); + HuksOptions.properties.splice(1, 1, purposeSign); if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { HuksOptions.properties.splice(2, 1); } } else { keyAlias = newSrcKeyAlies; + finishOutData = HuksOptions.inData; await publicImportKey(keyAlias, HuksOptions); } await publicInitFunc(keyAlias, HuksOptions); - await publicUpdateFunc(HuksOptions, isBigData); + HuksOptions.inData = rawData; + await publicUpdateFunc(HuksOptions); if (thirdInderfaceName == 'finish') { if (isSING) { - HuksOptions.outData = new Uint8Array(new Array(1024).fill('')); + HuksOptions.inData = new Uint8Array(new Array()); await publicFinishFunc(HuksOptions); - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY - ); + HuksOptions.properties.splice(1, 1, purposeSignVerigy); await publicExportKey(keyAlias, HuksOptions); } else { - HuksOptions.outData = exportKey; + HuksOptions.inData = finishOutData; await publicFinishFunc(HuksOptions); } } else { await publicAbortFucn(HuksOptions); } if (isSING && thirdInderfaceName == 'abort') { - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY - ); + HuksOptions.properties.splice(1, 1, purposeSignVerigy); await publicDeleteKeyFunc(srcKeyAlies, HuksOptions); } else if (!isSING) { - HuksOptions.properties.splice( - 1, - 1, - HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY - ); + HuksOptions.properties.splice(1, 1, PurposeVerify); await publicDeleteKeyFunc(newSrcKeyAlies, HuksOptions); } + return finishOutData; } catch (e) { expect(null).assertFail(); }