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 #ifdef FREEBL_NO_DEPEND | 5 #ifdef FREEBL_NO_DEPEND |
6 #include "stubs.h" | 6 #include "stubs.h" |
7 #endif | 7 #endif |
8 | 8 |
9 #include <memory.h> | 9 #include <memory.h> |
10 #include "blapi.h" | 10 #include "blapi.h" |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 void | 398 void |
399 SHA1_DestroyContext(SHA1Context *cx, PRBool freeit) | 399 SHA1_DestroyContext(SHA1Context *cx, PRBool freeit) |
400 { | 400 { |
401 memset(cx, 0, sizeof *cx); | 401 memset(cx, 0, sizeof *cx); |
402 if (freeit) { | 402 if (freeit) { |
403 PORT_Free(cx); | 403 PORT_Free(cx); |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 SECStatus | 407 SECStatus |
408 SHA1_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length) | 408 SHA1_HashBuf(unsigned char *dest, const unsigned char *src, PRUint32 src_length) |
409 { | 409 { |
410 SHA1Context ctx; | 410 SHA1Context ctx; |
411 unsigned int outLen; | 411 unsigned int outLen; |
412 | 412 |
413 SHA1_Begin(&ctx); | 413 SHA1_Begin(&ctx); |
414 SHA1_Update(&ctx, src, src_length); | 414 SHA1_Update(&ctx, src, src_length); |
415 SHA1_End(&ctx, dest, &outLen, SHA1_LENGTH); | 415 SHA1_End(&ctx, dest, &outLen, SHA1_LENGTH); |
416 memset(&ctx, 0, sizeof ctx); | 416 memset(&ctx, 0, sizeof ctx); |
417 return SECSuccess; | 417 return SECSuccess; |
418 } | 418 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 void SHA1_Clone(SHA1Context *dest, SHA1Context *src) | 454 void SHA1_Clone(SHA1Context *dest, SHA1Context *src) |
455 { | 455 { |
456 memcpy(dest, src, sizeof *dest); | 456 memcpy(dest, src, sizeof *dest); |
457 } | 457 } |
458 | 458 |
459 void | 459 void |
460 SHA1_TraceState(SHA1Context *ctx) | 460 SHA1_TraceState(SHA1Context *ctx) |
461 { | 461 { |
462 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); | 462 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); |
463 } | 463 } |
OLD | NEW |