提交 77aab6fd 编写于 作者: W w00835064

黄区TA实现不同,对某些用例设置只在蓝区执

Change-Id: I0a20dd6b9d93c313850ea4b239443a2b535871d1
Signed-off-by: Nw00835064 <wangxiyang4@huawei.com>
上级 6044d2ac
......@@ -37,7 +37,6 @@ ohos_moduletest_suite("ActsHuksNAPITest") {
part_name = "huks"
sources = [
"src/huks_agree_dh_test.cpp",
"src/huks_agree_ecdh_test.cpp",
"src/huks_agree_ecdh_test_common.cpp",
"src/huks_agree_x25519_test.cpp",
......@@ -71,6 +70,7 @@ ohos_moduletest_suite("ActsHuksNAPITest") {
"src/huks_attest_test.cpp",
"src/huks_attest_test_common.cpp",
"src/huks_signverify_dsa_test.cpp",
"src/huks_agree_dh_test.cpp",
]
}
......
......@@ -13,44 +13,52 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksDHBasicAbort63KBCallbackJsunit() {
describe('SecurityHuksDHBasicAbort63KBCallbackJsunit', function () {
it('testAgreeDH002', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksDHBasicAbort63KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH002', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,53 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions65kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
export default function SecurityHuksDHBasicAbort65KBCallbackJsunit() {
describe('SecurityHuksDHBasicAbort65KBCallbackJsunit', function () {
it('testAgreeDH004', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksDHBasicAbort65KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH004', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,52 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksDHBasicFinish63KBCallbackJsunit() {
describe('SecurityHuksDHBasicFinish63KBCallbackJsunit', function () {
it('testAgreeDH001', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
done();
describe('SecurityHuksDHBasicFinish63KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH001', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
};
done();
});
});
});
}
......@@ -13,44 +13,52 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions65kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
export default function SecurityHuksDHBasicFinish65KBCallbackJsunit() {
describe('SecurityHuksDHBasicFinish65KBCallbackJsunit', function () {
it('testAgreeDH003', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'finish');
done();
describe('SecurityHuksDHBasicFinish65KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH003', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'finish');
};
done();
});
});
});
}
......@@ -13,14 +13,15 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it, beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
......@@ -28,29 +29,35 @@ let HuksOptions63kb = {
};
export default function SecurityHuksAgreeDHBasicAbort63KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicAbort63KBPromiseJsunit', function () {
it('testAgreeDH102', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksAgreeDHBasicAbort63KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH102', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,50 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it, beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions65kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
export default function SecurityHuksAgreeDHBasicAbort65KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicAbort65KBPromiseJsunit', function () {
it('testAgreeDH104', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksAgreeDHBasicAbort65KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH104', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,50 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it, beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksAgreeDHBasicFinish63KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicFinish63KBPromiseJsunit', function () {
it('testAgreeDH101', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
done();
describe('SecurityHuksAgreeDHBasicFinish63KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH101', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
};
done();
});
});
});
}
......@@ -13,44 +13,51 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it, beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions65kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
export default function SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit', function () {
it('testAgreeDH103', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'finish');
done();
describe('SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testAgreeDH103', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'finish');
};
done();
});
});
});
}
......@@ -13,44 +13,52 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it ,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksDHBasicAbort63KBCallbackJsunit() {
describe('SecurityHuksDHBasicAbort63KBCallbackJsunit', function () {
it('testReformedAgreeDH002', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksDHBasicAbort63KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH002', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,52 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions65kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
export default function SecurityHuksDHBasicAbort65KBCallbackJsunit() {
describe('SecurityHuksDHBasicAbort65KBCallbackJsunit', function () {
it('testReformedAgreeDH004', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksDHBasicAbort65KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH004', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,52 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreeCallback';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksDHBasicFinish63KBCallbackJsunit() {
describe('SecurityHuksDHBasicFinish63KBCallbackJsunit', function () {
it('testReformedAgreeDH001', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
done();
describe('SecurityHuksDHBasicFinish63KBCallbackJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH001', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_001';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
};
done();
});
});
});
}
......@@ -23,6 +23,7 @@ let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions2048 = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
......@@ -69,7 +70,9 @@ export default function SecurityHuksDHBasicFinish65KBCallbackJsunit() {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_001';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_001';
let huksOptionsFinish = makehuksOptionsFinish(srcKeyAliesFirst);
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
};
done();
});
......
......@@ -13,44 +13,53 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksAgreeDHBasicAbort63KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicAbort63KBPromiseJsunit', function () {
it('testReformedAgreeDH102', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksAgreeDHBasicAbort63KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH102', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,50 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it, beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions65kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
export default function SecurityHuksAgreeDHBasicAbort65KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicAbort65KBPromiseJsunit', function () {
it('testReformedAgreeDH104', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
done();
describe('SecurityHuksAgreeDHBasicAbort65KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH104', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Abort65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData65Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions65kb, huksOptionsFinish, 'abort');
};
done();
});
});
});
}
......@@ -13,44 +13,50 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData63 = Data.Date63KB;
let srcData63Kb = stringToUint8Array(srcData63);
let useSoftware = true;
let HuksOptions63kb = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData63Kb,
};
export default function SecurityHuksAgreeDHBasicFinish63KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicFinish63KBPromiseJsunit', function () {
it('testReformedAgreeDH101', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
done();
describe('SecurityHuksAgreeDHBasicFinish63KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH101', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish63KBAgreeKeyAlias_02_101';
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
HuksAgreeDH.HuksKeyISKEYALIAS,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeySIZE256,
HuksAgreeDH.HuksKeyPurposeENCRYPTDECRYPT,
HuksAgreeDH.HuksKeyDIGESTNONE,
{
tag: HksTag.HKS_TAG_KEY_ALIAS,
value: stringToUint8Array(srcKeyAliesFirst),
},
HuksAgreeDH.HuksKeyPADDINGNONE,
HuksAgreeDH.HuksKeyBLOCKMODEECB
),
inData: srcData63Kb,
};
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions63kb, huksOptionsFinish, 'finish');
};
done();
});
});
});
}
......@@ -13,21 +13,22 @@
* limitations under the License.
*/
import { describe, it } from '@ohos/hypium';
import { describe, it,beforeAll } from '@ohos/hypium';
import * as Data from '../../../../../../utils/data.json';
import { stringToUint8Array } from '../../../../../../utils/param/publicFunc';
import { stringToUint8Array, checkSoftware } from '../../../../../../utils/param/publicFunc';
import { HuksAgreeDH } from '../../../../../../utils/param/agree/publicAgreeParam';
import { publicAgreeFunc } from '../../../../../../utils/param/agree/publicAgreePromise';
import { HksTag } from '../../../../../../utils/param/publicParam';
let srcData65 = Data.Date65KB;
let srcData65Kb = stringToUint8Array(srcData65);
let useSoftware = true;
let HuksOptions2048 = {
properties: new Array(HuksAgreeDH.HuksKeyAlgDH, HuksAgreeDH.HuksKeyPurposeDH, HuksAgreeDH.HuksKeyDHSize2048),
inData: srcData65Kb,
};
function makehuksOptionsFinish(srcKeyAliesFirst){
function makehuksOptionsFinish(srcKeyAliesFirst) {
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeySTORAGE,
......@@ -48,10 +49,10 @@ function makehuksOptionsFinish(srcKeyAliesFirst){
return huksOptionsFinish;
}
function makehuksOptionsDerive(srcKeyAliesFirst){
function makehuksOptionsDerive(srcKeyAliesFirst) {
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeyALGORITHMAES,
HuksAgreeDH.HuksKeyPurposeDERIVE,
HuksAgreeDH.HuksKeyDIGESTSHA256,
HuksAgreeDH.HuksKeySIZE256,
......@@ -69,7 +70,7 @@ function makehuksOptionsDerive(srcKeyAliesFirst){
return huksOptionsFinish;
}
function makehuksOptionsHmac(srcKeyAliesFirst){
function makehuksOptionsHmac(srcKeyAliesFirst) {
let huksOptionsFinish = {
properties: new Array(
HuksAgreeDH.HuksKeyALGORITHMHMAC,
......@@ -92,11 +93,17 @@ function makehuksOptionsHmac(srcKeyAliesFirst){
export default function SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit() {
describe('SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit', function () {
beforeAll(async function (done) {
useSoftware = await checkSoftware();
done();
})
it('testReformedAgreeDH103', 0, async function (done) {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_101';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_101';
let huksOptionsFinish = makehuksOptionsFinish(srcKeyAliesFirst);
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
};
done();
});
......@@ -104,7 +111,9 @@ export default function SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit() {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_108';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_108';
let huksOptionsFinish = makehuksOptionsDerive(srcKeyAliesFirst);
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
};
done();
});
......@@ -112,7 +121,9 @@ export default function SecurityHuksAgreeDHBasicFinish65KBPromiseJsunit() {
const srcKeyAliesFirst = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_01_130';
const srcKeyAliesSecond = 'testAgreeDHSize2048Finish65KBAgreeKeyAlias_02_130';
let huksOptionsFinish = makehuksOptionsHmac(srcKeyAliesFirst);
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
if (useSoftware) {
await publicAgreeFunc(srcKeyAliesFirst, srcKeyAliesSecond, HuksOptions2048, huksOptionsFinish, 'finish');
};
done();
});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册