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 #include "sechash.h" | 4 #include "sechash.h" |
5 #include "secoidt.h" | 5 #include "secoidt.h" |
6 #include "secerr.h" | 6 #include "secerr.h" |
7 #include "blapi.h" | 7 #include "blapi.h" |
8 #include "pk11func.h" /* for the PK11_ calls below. */ | 8 #include "pk11func.h" /* for the PK11_ calls below. */ |
9 | 9 |
10 static void * | 10 static void * |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 HASH_ResultLenContext(HASHContext *context) | 272 HASH_ResultLenContext(HASHContext *context) |
273 { | 273 { |
274 return(context->hashobj->length); | 274 return(context->hashobj->length); |
275 } | 275 } |
276 | 276 |
277 | 277 |
278 | 278 |
279 SECStatus | 279 SECStatus |
280 HASH_HashBuf(HASH_HashType type, | 280 HASH_HashBuf(HASH_HashType type, |
281 unsigned char *dest, | 281 unsigned char *dest, |
282 » unsigned char *src, | 282 » const unsigned char *src, |
283 PRUint32 src_len) | 283 PRUint32 src_len) |
284 { | 284 { |
285 HASHContext *cx; | 285 HASHContext *cx; |
286 unsigned int part; | 286 unsigned int part; |
287 | 287 |
288 if ( ( type < HASH_AlgNULL ) || ( type >= HASH_AlgTOTAL ) ) { | 288 if ( ( type < HASH_AlgNULL ) || ( type >= HASH_AlgTOTAL ) ) { |
289 return(SECFailure); | 289 return(SECFailure); |
290 } | 290 } |
291 | 291 |
292 cx = HASH_Create(type); | 292 cx = HASH_Create(type); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 (* context->hashobj->end)(context->hash_context, result, result_len, | 400 (* context->hashobj->end)(context->hash_context, result, result_len, |
401 max_result_len); | 401 max_result_len); |
402 return; | 402 return; |
403 } | 403 } |
404 | 404 |
405 HASH_HashType | 405 HASH_HashType |
406 HASH_GetType(HASHContext *context) | 406 HASH_GetType(HASHContext *context) |
407 { | 407 { |
408 return(context->hashobj->type); | 408 return(context->hashobj->type); |
409 } | 409 } |
OLD | NEW |