mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Update NSS to 3.32.1-RTM
This commit is contained in:
parent
f29876f120
commit
c91ef9012b
512 changed files with 83203 additions and 16839 deletions
|
|
@ -9,7 +9,6 @@
|
|||
#include "basicutil.h"
|
||||
#include "secder.h"
|
||||
#include "secitem.h"
|
||||
#include "secutil.h"
|
||||
#include "nspr.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -89,26 +88,19 @@ ectest_ecdh_kat(ECDH_KAT *kat)
|
|||
SECItem answer = { siBuffer, NULL, 0 };
|
||||
SECItem answer2 = { siBuffer, NULL, 0 };
|
||||
SECItem derived = { siBuffer, NULL, 0 };
|
||||
char genenc[3 + 2 * 2 * MAX_ECKEY_LEN];
|
||||
SECItem ecEncodedParams = { siBuffer, NULL, 0 };
|
||||
int i;
|
||||
|
||||
rv = init_params(&ecParams, curve, &arena, kat->fieldType);
|
||||
if (rv != SECSuccess) {
|
||||
return rv;
|
||||
arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
|
||||
if (!arena) {
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
SECU_HexString2SECItem(arena, &ecParams.fieldID.u.prime, ecCurve_map[curve]->irr);
|
||||
SECU_HexString2SECItem(arena, &ecParams.curve.a, ecCurve_map[curve]->curvea);
|
||||
SECU_HexString2SECItem(arena, &ecParams.curve.b, ecCurve_map[curve]->curveb);
|
||||
genenc[0] = '0';
|
||||
genenc[1] = '4';
|
||||
genenc[2] = '\0';
|
||||
PORT_Assert(PR_ARRAY_SIZE(genenc) >= PORT_Strlen(ecCurve_map[curve]->genx));
|
||||
PORT_Assert(PR_ARRAY_SIZE(genenc) >= PORT_Strlen(ecCurve_map[curve]->geny));
|
||||
strcat(genenc, ecCurve_map[curve]->genx);
|
||||
strcat(genenc, ecCurve_map[curve]->geny);
|
||||
SECU_HexString2SECItem(arena, &ecParams.base, genenc);
|
||||
SECU_HexString2SECItem(arena, &ecParams.order, ecCurve_map[curve]->order);
|
||||
rv = SECU_ecName2params(curve, &ecEncodedParams);
|
||||
if (rv != SECSuccess) {
|
||||
goto cleanup;
|
||||
}
|
||||
EC_FillParams(arena, &ecEncodedParams, &ecParams);
|
||||
|
||||
if (kat->our_pubhex) {
|
||||
SECU_HexString2SECItem(arena, &answer, kat->our_pubhex);
|
||||
|
|
@ -162,6 +154,7 @@ ectest_ecdh_kat(ECDH_KAT *kat)
|
|||
}
|
||||
|
||||
cleanup:
|
||||
SECITEM_FreeItem(&ecEncodedParams, PR_FALSE);
|
||||
PORT_FreeArena(arena, PR_FALSE);
|
||||
if (ecPriv) {
|
||||
PORT_FreeArena(ecPriv->ecParams.arena, PR_FALSE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue