Merge pull request #7017 from SparkiDev/asn_tmpl_ecc_raw_to_sig_fix

ASN template: StoreECC_DSA_Sig_Bin
This commit is contained in:
JacobBarthelmeh
2023-12-01 16:11:15 -07:00
committed by GitHub
2 changed files with 70 additions and 0 deletions

View File

@@ -32062,6 +32062,14 @@ int StoreECC_DSA_Sig_Bin(byte* out, word32* outLen, const byte* r, word32 rLen,
/* Clear dynamic data and set buffers for r and s */
XMEMSET(dataASN, 0, sizeof(dataASN));
while ((rLen > 1) && (r[0] == 0)) {
rLen--;
r++;
}
while ((sLen > 1) && (s[0] == 0)) {
sLen--;
s++;
}
SetASN_Buffer(&dataASN[DSASIGASN_IDX_R], r, rLen);
SetASN_Buffer(&dataASN[DSASIGASN_IDX_S], s, sLen);