OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #include "plarena.h" | 5 #include "plarena.h" |
6 | 6 |
7 #include "seccomon.h" | 7 #include "seccomon.h" |
8 #include "secitem.h" | 8 #include "secitem.h" |
9 #include "secport.h" | 9 #include "secport.h" |
10 #include "hasht.h" | 10 #include "hasht.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 hashObject->update(hash, I.data, I.len); | 509 hashObject->update(hash, I.data, I.len); |
510 } | 510 } |
511 | 511 |
512 hashObject->end(hash, iterBuf, &hashLen, hashObject->length); | 512 hashObject->end(hash, iterBuf, &hashLen, hashObject->length); |
513 if(hashLen != hashObject->length) { | 513 if(hashLen != hashObject->length) { |
514 break; | 514 break; |
515 } | 515 } |
516 } | 516 } |
517 | 517 |
518 PORT_Memcpy(Ai, iterBuf, hashLength); | 518 PORT_Memcpy(Ai, iterBuf, hashLength); |
519 » for (Bidx = 0; Bidx < B.len; Bidx += hashLength) { | 519 » for (Bidx = 0; Bidx < (int)B.len; Bidx += hashLength) { |
520 PORT_Memcpy(B.data+Bidx,iterBuf,NSSPBE_MIN(B.len-Bidx,hashLength)); | 520 PORT_Memcpy(B.data+Bidx,iterBuf,NSSPBE_MIN(B.len-Bidx,hashLength)); |
521 } | 521 } |
522 | 522 |
523 k = I.len/B.len; | 523 k = I.len/B.len; |
524 for(j = 0; j < k; j++) { | 524 for(j = 0; j < k; j++) { |
525 unsigned int q, carryBit; | 525 unsigned int q, carryBit; |
526 unsigned char *Ij = I.data + j*B.len; | 526 unsigned char *Ij = I.data + j*B.len; |
527 | 527 |
528 /* (Ij = Ij+B+1) */ | 528 /* (Ij = Ij+B+1) */ |
529 for (Bidx = (B.len-1), q=1, carryBit=0; Bidx >= 0; Bidx--,q=0) { | 529 for (Bidx = (B.len-1), q=1, carryBit=0; Bidx >= 0; Bidx--,q=0) { |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 rv = SECOID_CopyAlgorithmID(NULL, ret_algid, algid); | 1369 rv = SECOID_CopyAlgorithmID(NULL, ret_algid, algid); |
1370 if (rv != SECSuccess) { | 1370 if (rv != SECSuccess) { |
1371 SECOID_DestroyAlgorithmID(ret_algid, PR_TRUE); | 1371 SECOID_DestroyAlgorithmID(ret_algid, PR_TRUE); |
1372 ret_algid = NULL; | 1372 ret_algid = NULL; |
1373 } | 1373 } |
1374 | 1374 |
1375 loser: | 1375 loser: |
1376 | 1376 |
1377 return ret_algid; | 1377 return ret_algid; |
1378 } | 1378 } |
OLD | NEW |