未验证 提交 c5dfb00a 编写于 作者: O openharmony_ci 提交者: Gitee

!3112 hukscode basic代码verify规格修改

Merge pull request !3112 from 胡吉翔/security_20220505_2
...@@ -96,7 +96,6 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) { ...@@ -96,7 +96,6 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) {
let inDataArray = HuksOptions.inData; let inDataArray = HuksOptions.inData;
if (Array.from(inDataArray).length < dateSize) { if (Array.from(inDataArray).length < dateSize) {
await update(handle, HuksOptions); await update(handle, HuksOptions);
// HuksOptions.inData = new Uint8Array(new Array());
await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt, 0); await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt, 0);
} else { } else {
let count = Math.floor(Array.from(inDataArray).length / dateSize); let count = Math.floor(Array.from(inDataArray).length / dateSize);
...@@ -116,12 +115,7 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) { ...@@ -116,12 +115,7 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) {
) )
); );
} }
await publicFinishAbortFunc( await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt);
HuksOptions,
thirdInderfaceName,
isEncrypt,
remainder
);
} }
} }
...@@ -158,8 +152,7 @@ function updateCallback(handle, HuksOptions) { ...@@ -158,8 +152,7 @@ function updateCallback(handle, HuksOptions) {
async function publicFinishAbortFunc( async function publicFinishAbortFunc(
HuksOptions, HuksOptions,
thirdInderfaceName, thirdInderfaceName,
isEncrypt, isEncrypt
remainder
) { ) {
if (thirdInderfaceName == 'finish') { if (thirdInderfaceName == 'finish') {
await finish(HuksOptions, isEncrypt); await finish(HuksOptions, isEncrypt);
......
...@@ -92,12 +92,7 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) { ...@@ -92,12 +92,7 @@ async function publicUpdateFunc(HuksOptions, thirdInderfaceName, isEncrypt) {
} else { } else {
HuksOptions.inData = new Uint8Array(new Array()); HuksOptions.inData = new Uint8Array(new Array());
} }
await publicFinishAbortFunc( await publicFinishAbortFunc(HuksOptions, thirdInderfaceName, isEncrypt);
HuksOptions,
thirdInderfaceName,
isEncrypt,
remainder
);
} }
} }
...@@ -124,8 +119,7 @@ async function update(handle, HuksOptions) { ...@@ -124,8 +119,7 @@ async function update(handle, HuksOptions) {
async function publicFinishAbortFunc( async function publicFinishAbortFunc(
HuksOptions, HuksOptions,
thirdInderfaceName, thirdInderfaceName,
isEncrypt, isEncrypt
remainder
) { ) {
if (thirdInderfaceName == 'finish') { if (thirdInderfaceName == 'finish') {
await finish(HuksOptions, isEncrypt); await finish(HuksOptions, isEncrypt);
......
...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
NewSrcKeyAlies, NewSrcKeyAlies,
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ...@@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
NewSrcKeyAlies, NewSrcKeyAlies,
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
it('testSignVerifyDSA001', 0, async function (done) { it('testSignVerifyDSA001', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias001'; const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias001';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksTagDSADigestSHA1,
HuksSignVerifyDSA.HuksTagDSACOMMONSIZE HuksSignVerifyDSA.HuksTagDSACOMMONSIZE
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
it('testSignVerifyDSA003', 0, async function (done) { it('testSignVerifyDSA003', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias003'; const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias003';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSACallbackJsunit', function () {
HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksTagDSADigestSHA1,
HuksSignVerifyDSA.HuksKeySIZE1024 HuksSignVerifyDSA.HuksKeySIZE1024
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
it('testSignVerifyECC001', 0, async function (done) { it('testSignVerifyECC001', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias001'; const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias001';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksTagECCDigestNONE,
HuksSignVerifyECC.HuksKeyECCSize224 HuksSignVerifyECC.HuksKeyECCSize224
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
it('testSignVerifyECC003', 0, async function (done) { it('testSignVerifyECC003', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias003'; const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias003';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCCallbackJsunit', function () {
HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksTagECCDigestNONE,
HuksSignVerifyECC.HuksKeyECCSize224 HuksSignVerifyECC.HuksKeyECCSize224
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -21,6 +21,7 @@ let srcData63 = Data.Data63b; ...@@ -21,6 +21,7 @@ let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
it('testSignVerifyED25519001', 0, async function (done) { it('testSignVerifyED25519001', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyED25519Size256SIGNKeyAlias001'; const srcKeyAlies = 'testSignVerifyED25519Size256SIGNKeyAlias001';
...@@ -33,12 +34,13 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ...@@ -33,12 +34,13 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
...@@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ...@@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksKeyED25519Size256,
HuksSignVerifyED25519.HuksTagDigestSHA1 HuksSignVerifyED25519.HuksTagDigestSHA1
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
...@@ -76,7 +79,8 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ...@@ -76,7 +79,8 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
...@@ -92,12 +96,13 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ...@@ -92,12 +96,13 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -106,14 +111,15 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ...@@ -106,14 +111,15 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksKeyED25519Size256,
HuksSignVerifyED25519.HuksTagDigestSHA1 HuksSignVerifyED25519.HuksTagDigestSHA1
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData65Kb
); );
done(); done();
}); });
...@@ -134,7 +140,8 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () { ...@@ -134,7 +140,8 @@ describe('SecurityHuksSignVerifyED25519CallbackJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -40,7 +40,8 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ...@@ -40,7 +40,8 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ...@@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
it('testSignVerifyRSA001', 0, async function (done) { it('testSignVerifyRSA001', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias001'; const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias001';
...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ...@@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15,
HuksSignVerifyRSA.HuksKeyRSASize512 HuksSignVerifyRSA.HuksKeyRSASize512
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
it('testSignVerifyRSA003', 0, async function (done) { it('testSignVerifyRSA003', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias003'; const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias003';
...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () { ...@@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSACallbackJsunit', function () {
HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15,
HuksSignVerifyRSA.HuksKeyRSASize512 HuksSignVerifyRSA.HuksKeyRSASize512
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true false,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
it('testSignVerifyDSA102', 0, async function (done) { it('testSignVerifyDSA102', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias102'; const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias102';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
NewSrcKeyAlies, NewSrcKeyAlies,
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
it('testSignVerifyDSA104', 0, async function (done) { it('testSignVerifyDSA104', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias104'; const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias104';
...@@ -36,7 +37,8 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ...@@ -36,7 +37,8 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
NewSrcKeyAlies, NewSrcKeyAlies,
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
it('testSignVerifyDSA101', 0, async function (done) { it('testSignVerifyDSA101', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias101'; const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias101';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksTagDSADigestSHA1,
HuksSignVerifyDSA.HuksTagDSACOMMONSIZE HuksSignVerifyDSA.HuksTagDSACOMMONSIZE
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
it('testSignVerifyDSA103', 0, async function (done) { it('testSignVerifyDSA103', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias103'; const srcKeyAlies = 'testSignVerifyDSASIGNSHA1KeyAlias103';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyDSAPromiseJsunit', function () {
HuksSignVerifyDSA.HuksTagDSADigestSHA1, HuksSignVerifyDSA.HuksTagDSADigestSHA1,
HuksSignVerifyDSA.HuksKeySIZE1024 HuksSignVerifyDSA.HuksKeySIZE1024
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
newSrcKeyAlies, newSrcKeyAlies,
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ...@@ -36,7 +36,8 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
it('testSignVerifyECC101', 0, async function (done) { it('testSignVerifyECC101', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias101'; const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias101';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksTagECCDigestNONE,
HuksSignVerifyECC.HuksKeyECCSize224 HuksSignVerifyECC.HuksKeyECCSize224
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
it('testSignVerifyECC103', 0, async function (done) { it('testSignVerifyECC103', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias103'; const srcKeyAlies = 'testSignVerifyECCSize224SIGNNONEKeyAlias103';
...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ...@@ -31,12 +32,13 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () { ...@@ -45,14 +47,15 @@ describe('SecurityHuksSignVerifyECCPromiseJsunit', function () {
HuksSignVerifyECC.HuksTagECCDigestNONE, HuksSignVerifyECC.HuksTagECCDigestNONE,
HuksSignVerifyECC.HuksKeyECCSize224 HuksSignVerifyECC.HuksKeyECCSize224
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -21,6 +21,7 @@ let srcData63 = Data.Data63b; ...@@ -21,6 +21,7 @@ let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
it('testSignVerifyED25519101', 0, async function (done) { it('testSignVerifyED25519101', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyED25519Size256SIGNKeyAlias101'; const srcKeyAlies = 'testSignVerifyED25519Size256SIGNKeyAlias101';
...@@ -33,12 +34,13 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ...@@ -33,12 +34,13 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
...@@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ...@@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksKeyED25519Size256,
HuksSignVerifyED25519.HuksTagDigestSHA1 HuksSignVerifyED25519.HuksTagDigestSHA1
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
...@@ -76,7 +79,8 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ...@@ -76,7 +79,8 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
...@@ -92,12 +96,13 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ...@@ -92,12 +96,13 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -106,14 +111,15 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ...@@ -106,14 +111,15 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
HuksSignVerifyED25519.HuksKeyED25519Size256, HuksSignVerifyED25519.HuksKeyED25519Size256,
HuksSignVerifyED25519.HuksTagDigestSHA1 HuksSignVerifyED25519.HuksTagDigestSHA1
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData65Kb
); );
done(); done();
}); });
...@@ -134,7 +140,8 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () { ...@@ -134,7 +140,8 @@ describe('SecurityHuksSignVerifyED25519PromiseJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ...@@ -37,7 +37,8 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -38,7 +38,8 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ...@@ -38,7 +38,8 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'abort', 'abort',
true true,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData63 = Data.Data63b; let srcData63 = Data.Data63b;
let srcData63Kb = stringToUint8Array(srcData63); let srcData63Kb = stringToUint8Array(srcData63);
let finishOutData;
describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
it('testSignVerifyRSA101', 0, async function (done) { it('testSignVerifyRSA101', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias101'; const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias101';
...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
), ),
inData: srcData63Kb, inData: srcData63Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData63Kb
); );
HuksOptions = { HuksOptions = {
properties: new Array( properties: new Array(
...@@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ...@@ -47,14 +49,15 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15,
HuksSignVerifyRSA.HuksKeyRSASize512 HuksSignVerifyRSA.HuksKeyRSASize512
), ),
inData: srcData63Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
false false,
srcData63Kb
); );
done(); done();
}); });
......
...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc' ...@@ -19,6 +19,7 @@ import { stringToUint8Array } from '../../../../../../../utils/param/publicFunc'
import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js'; import { publicSignVerifyFunc } from '../../../../../../../utils/param/signverify/publicSignverifyPromise.js';
let srcData65 = Data.Data65b; let srcData65 = Data.Data65b;
let srcData65Kb = stringToUint8Array(srcData65); let srcData65Kb = stringToUint8Array(srcData65);
let finishOutData;
describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
it('testSignVerifyRSA103', 0, async function (done) { it('testSignVerifyRSA103', 0, async function (done) {
const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias103'; const srcKeyAlies = 'testSignVerifyRSASize512SIGNPKCS1MD5KeyAlias103';
...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ...@@ -32,12 +33,13 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
), ),
inData: srcData65Kb, inData: srcData65Kb,
}; };
await publicSignVerifyFunc( finishOutData = await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true true,
srcData65Kb
); );
HuksOptions = { HuksOptions = {
...@@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () { ...@@ -48,14 +50,15 @@ describe('SecurityHuksSignVerifyRSAPromiseJsunit', function () {
HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15, HuksSignVerifyRSA.HuksKeyRSAPADDINGPKCS1V15,
HuksSignVerifyRSA.HuksKeyRSASize512 HuksSignVerifyRSA.HuksKeyRSASize512
), ),
inData: srcData65Kb, inData: finishOutData,
}; };
await publicSignVerifyFunc( await publicSignVerifyFunc(
srcKeyAlies, srcKeyAlies,
srcKeyAlies + 'New', srcKeyAlies + 'New',
HuksOptions, HuksOptions,
'finish', 'finish',
true false,
srcData65Kb
); );
done(); done();
}); });
......
...@@ -49,7 +49,7 @@ function generateKey(srcKeyAlies, HuksOptions) { ...@@ -49,7 +49,7 @@ function generateKey(srcKeyAlies, HuksOptions) {
async function publicImportKey(keyAlias, HuksOptions) { async function publicImportKey(keyAlias, HuksOptions) {
let _InData = HuksOptions.inData; let _InData = HuksOptions.inData;
HuksOptions.inData = finishOutData; HuksOptions.inData = exportKey;
await importKey(keyAlias, HuksOptions) await importKey(keyAlias, HuksOptions)
.then((data) => { .then((data) => {
console.log(`test ImportKey data: ${JSON.stringify(data)}`); console.log(`test ImportKey data: ${JSON.stringify(data)}`);
...@@ -79,7 +79,7 @@ async function publicExportKey(keyAlias, HuksOptions) { ...@@ -79,7 +79,7 @@ async function publicExportKey(keyAlias, HuksOptions) {
await exportkey(keyAlias, HuksOptions) await exportkey(keyAlias, HuksOptions)
.then((data) => { .then((data) => {
console.log(`test exportKey data: ${JSON.stringify(data)}`); console.log(`test exportKey data: ${JSON.stringify(data)}`);
finishOutData = data.outData; exportKey = data.outData;
}) })
.catch((err) => { .catch((err) => {
console.log('test exportKey err information: ' + JSON.stringify(err)); console.log('test exportKey err information: ' + JSON.stringify(err));
...@@ -127,13 +127,8 @@ function init(srcKeyAlies, HuksOptions) { ...@@ -127,13 +127,8 @@ function init(srcKeyAlies, HuksOptions) {
}); });
} }
async function publicUpdateFunc(HuksOptions, isBigData) { async function publicUpdateFunc(HuksOptions) {
let dateSize = 0; let dateSize = 64;
if (isBigData) {
dateSize = 64 * 1024;
} else {
dateSize = 64;
}
let tempHuksOptionsInData = HuksOptions.inData; let tempHuksOptionsInData = HuksOptions.inData;
let inDataArray = HuksOptions.inData; let inDataArray = HuksOptions.inData;
if (uint8ArrayToString(inDataArray).length < dateSize) { if (uint8ArrayToString(inDataArray).length < dateSize) {
...@@ -194,7 +189,7 @@ async function publicFinishFunc(HuksOptions) { ...@@ -194,7 +189,7 @@ async function publicFinishFunc(HuksOptions) {
await finish(handle, HuksOptions) await finish(handle, HuksOptions)
.then((data) => { .then((data) => {
console.log(`test finish data: ${JSON.stringify(data)}`); console.log(`test finish data: ${JSON.stringify(data)}`);
exportKey = data.outData; finishOutData = data.outData;
expect(data.errorCode == 0).assertTrue(); expect(data.errorCode == 0).assertTrue();
}) })
.catch((err) => { .catch((err) => {
...@@ -272,66 +267,52 @@ async function publicSignVerifyFunc( ...@@ -272,66 +267,52 @@ async function publicSignVerifyFunc(
HuksOptions, HuksOptions,
thirdInderfaceName, thirdInderfaceName,
isSING, isSING,
isBigData rawData
) { ) {
try { try {
let keyAlias = srcKeyAlies; let keyAlias = srcKeyAlies;
let purposeSignVerigy = HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY;
let purposeSign = HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN;
let PurposeVerify = HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY;
if (isSING) { if (isSING) {
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSignVerigy);
1,
1,
HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY
);
if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) {
HuksOptions.properties.splice(2, 0, HuksSignVerifyDSA.HuksKeySIZE1024); HuksOptions.properties.splice(2, 0, HuksSignVerifyDSA.HuksKeySIZE1024);
} }
await publicGenerateKeyFunc(keyAlias, HuksOptions); await publicGenerateKeyFunc(keyAlias, HuksOptions);
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSign);
1,
1,
HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN
);
if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) {
HuksOptions.properties.splice(2, 1); HuksOptions.properties.splice(2, 1);
} }
} else { } else {
keyAlias = newSrcKeyAlies; keyAlias = newSrcKeyAlies;
finishOutData = HuksOptions.inData;
await publicImportKey(keyAlias, HuksOptions); await publicImportKey(keyAlias, HuksOptions);
} }
await publicInitFunc(keyAlias, HuksOptions); await publicInitFunc(keyAlias, HuksOptions);
await publicUpdateFunc(HuksOptions, isBigData); HuksOptions.inData = rawData;
await publicUpdateFunc(HuksOptions);
if (thirdInderfaceName == 'finish') { if (thirdInderfaceName == 'finish') {
if (isSING) { if (isSING) {
HuksOptions.outData = new Uint8Array(new Array(1024)); HuksOptions.inData = new Uint8Array(new Array());
await publicFinishFunc(HuksOptions); await publicFinishFunc(HuksOptions);
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSignVerigy);
1,
1,
HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY
);
await publicExportKey(keyAlias, HuksOptions); await publicExportKey(keyAlias, HuksOptions);
} else { } else {
HuksOptions.outData = exportKey; HuksOptions.inData = finishOutData;
await publicFinishFunc(HuksOptions); await publicFinishFunc(HuksOptions);
} }
} else { } else {
await publicAbortFucn(HuksOptions); await publicAbortFucn(HuksOptions);
} }
if (isSING && thirdInderfaceName == 'abort') { if (isSING && thirdInderfaceName == 'abort') {
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSignVerigy);
1,
1,
HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY
);
await publicDeleteKeyFunc(srcKeyAlies, HuksOptions); await publicDeleteKeyFunc(srcKeyAlies, HuksOptions);
} else if (!isSING) { } else if (!isSING) {
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, PurposeVerify);
1,
1,
HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY
);
await publicDeleteKeyFunc(newSrcKeyAlies, HuksOptions); await publicDeleteKeyFunc(newSrcKeyAlies, HuksOptions);
} }
return finishOutData;
} catch (e) { } catch (e) {
expect(null).assertFail(); expect(null).assertFail();
} }
......
...@@ -36,7 +36,7 @@ async function publicGenerateKeyFunc(keyAlias, HuksOptions) { ...@@ -36,7 +36,7 @@ async function publicGenerateKeyFunc(keyAlias, HuksOptions) {
async function publicImportKey(keyAlias, HuksOptions) { async function publicImportKey(keyAlias, HuksOptions) {
let _InData = HuksOptions.inData; let _InData = HuksOptions.inData;
HuksOptions.inData = finishOutData; HuksOptions.inData = exportKey;
await huks await huks
.importKey(keyAlias, HuksOptions) .importKey(keyAlias, HuksOptions)
.then((data) => { .then((data) => {
...@@ -54,7 +54,7 @@ async function publicExportKey(keyAlias, HuksOptions) { ...@@ -54,7 +54,7 @@ async function publicExportKey(keyAlias, HuksOptions) {
.exportKey(keyAlias, HuksOptions) .exportKey(keyAlias, HuksOptions)
.then((data) => { .then((data) => {
console.log(`test exportKey data: ${JSON.stringify(data)}`); console.log(`test exportKey data: ${JSON.stringify(data)}`);
finishOutData = data.outData; exportKey = data.outData;
}) })
.catch((err) => { .catch((err) => {
console.log('test exportKey err information: ' + JSON.stringify(err)); console.log('test exportKey err information: ' + JSON.stringify(err));
...@@ -76,13 +76,8 @@ async function publicInitFunc(keyAlias, HuksOptions) { ...@@ -76,13 +76,8 @@ async function publicInitFunc(keyAlias, HuksOptions) {
}); });
} }
async function publicUpdateFunc(HuksOptions, isBigData) { async function publicUpdateFunc(HuksOptions) {
let dateSize = 0; let dateSize = 64;
if (isBigData) {
dateSize = 64 * 1024;
} else {
dateSize = 64;
}
let tempHuksOptionsInData = HuksOptions.inData; let tempHuksOptionsInData = HuksOptions.inData;
let inDataArray = HuksOptions.inData; let inDataArray = HuksOptions.inData;
if (uint8ArrayToString(inDataArray).length < dateSize) { if (uint8ArrayToString(inDataArray).length < dateSize) {
...@@ -132,7 +127,7 @@ async function publicFinishFunc(HuksOptions) { ...@@ -132,7 +127,7 @@ async function publicFinishFunc(HuksOptions) {
.finish(handle, HuksOptions) .finish(handle, HuksOptions)
.then((data) => { .then((data) => {
console.log(`test finish data: ${JSON.stringify(data)}`); console.log(`test finish data: ${JSON.stringify(data)}`);
exportKey = data.outData; finishOutData = data.outData;
expect(data.errorCode == 0).assertTrue(); expect(data.errorCode == 0).assertTrue();
}) })
.catch((err) => { .catch((err) => {
...@@ -173,66 +168,52 @@ async function publicSignVerifyFunc( ...@@ -173,66 +168,52 @@ async function publicSignVerifyFunc(
HuksOptions, HuksOptions,
thirdInderfaceName, thirdInderfaceName,
isSING, isSING,
isBigData rawData
) { ) {
try { try {
let keyAlias = srcKeyAlies; let keyAlias = srcKeyAlies;
let purposeSignVerigy = HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY;
let purposeSign = HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN;
let PurposeVerify = HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY;
if (isSING) { if (isSING) {
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSignVerigy);
1,
1,
HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY
);
if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) {
HuksOptions.properties.splice(2, 0, HuksSignVerifyDSA.HuksKeySIZE1024); HuksOptions.properties.splice(2, 0, HuksSignVerifyDSA.HuksKeySIZE1024);
} }
await publicGenerateKeyFunc(keyAlias, HuksOptions); await publicGenerateKeyFunc(keyAlias, HuksOptions);
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSign);
1,
1,
HuksSignVerifyDSA.HuksKeyDSAPurposeSIGN
);
if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) { if (HuksOptions.properties[0].value == HksKeyAlg.HKS_ALG_DSA) {
HuksOptions.properties.splice(2, 1); HuksOptions.properties.splice(2, 1);
} }
} else { } else {
keyAlias = newSrcKeyAlies; keyAlias = newSrcKeyAlies;
finishOutData = HuksOptions.inData;
await publicImportKey(keyAlias, HuksOptions); await publicImportKey(keyAlias, HuksOptions);
} }
await publicInitFunc(keyAlias, HuksOptions); await publicInitFunc(keyAlias, HuksOptions);
await publicUpdateFunc(HuksOptions, isBigData); HuksOptions.inData = rawData;
await publicUpdateFunc(HuksOptions);
if (thirdInderfaceName == 'finish') { if (thirdInderfaceName == 'finish') {
if (isSING) { if (isSING) {
HuksOptions.outData = new Uint8Array(new Array(1024).fill('')); HuksOptions.inData = new Uint8Array(new Array());
await publicFinishFunc(HuksOptions); await publicFinishFunc(HuksOptions);
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSignVerigy);
1,
1,
HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY
);
await publicExportKey(keyAlias, HuksOptions); await publicExportKey(keyAlias, HuksOptions);
} else { } else {
HuksOptions.outData = exportKey; HuksOptions.inData = finishOutData;
await publicFinishFunc(HuksOptions); await publicFinishFunc(HuksOptions);
} }
} else { } else {
await publicAbortFucn(HuksOptions); await publicAbortFucn(HuksOptions);
} }
if (isSING && thirdInderfaceName == 'abort') { if (isSING && thirdInderfaceName == 'abort') {
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, purposeSignVerigy);
1,
1,
HuksSignVerifyDSA.HuksKeyRSAPurposeSINGVERIFY
);
await publicDeleteKeyFunc(srcKeyAlies, HuksOptions); await publicDeleteKeyFunc(srcKeyAlies, HuksOptions);
} else if (!isSING) { } else if (!isSING) {
HuksOptions.properties.splice( HuksOptions.properties.splice(1, 1, PurposeVerify);
1,
1,
HuksSignVerifyDSA.HuksKeyDSAPurposeVERIFY
);
await publicDeleteKeyFunc(newSrcKeyAlies, HuksOptions); await publicDeleteKeyFunc(newSrcKeyAlies, HuksOptions);
} }
return finishOutData;
} catch (e) { } catch (e) {
expect(null).assertFail(); expect(null).assertFail();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册