| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 Index: mozilla/security/nss/lib/freebl/pqg.c | 
|  | 2 =================================================================== | 
|  | 3 RCS file: /cvsroot/mozilla/security/nss/lib/freebl/pqg.c,v | 
|  | 4 retrieving revision 1.22 | 
|  | 5 retrieving revision 1.23 | 
|  | 6 diff -p -u -r1.22 -r1.23 | 
|  | 7 --- mozilla/security/nss/lib/freebl/pqg.c       22 Sep 2012 15:18:19 -0000      
     1.22 | 
|  | 8 +++ mozilla/security/nss/lib/freebl/pqg.c       25 Sep 2012 23:38:38 -0000      
     1.23 | 
|  | 9 @@ -21,7 +21,6 @@ | 
|  | 10  #include "mpprime.h" | 
|  | 11  #include "mplogic.h" | 
|  | 12  #include "secmpi.h" | 
|  | 13 -#include "sechash.h" | 
|  | 14 | 
|  | 15  #define MAX_ITERATIONS 1000  /* Maximum number of iterations of primegen */ | 
|  | 16 | 
|  | 17 @@ -152,6 +151,38 @@ getNextHash(HASH_HashType hashtype) | 
|  | 18      return hashtype; | 
|  | 19  } | 
|  | 20 | 
|  | 21 +static unsigned int | 
|  | 22 +HASH_ResultLen(HASH_HashType type) | 
|  | 23 +{ | 
|  | 24 +    const SECHashObject *hash_obj = HASH_GetRawHashObject(type); | 
|  | 25 +    if (hash_obj == NULL) { | 
|  | 26 +       return 0; | 
|  | 27 +    } | 
|  | 28 +    return hash_obj->length; | 
|  | 29 +} | 
|  | 30 + | 
|  | 31 +static SECStatus | 
|  | 32 +HASH_HashBuf(HASH_HashType type, unsigned char *dest, | 
|  | 33 +            const unsigned char *src, PRUint32 src_len) | 
|  | 34 +{ | 
|  | 35 +    const SECHashObject *hash_obj = HASH_GetRawHashObject(type); | 
|  | 36 +    void *hashcx = NULL; | 
|  | 37 +    unsigned int dummy; | 
|  | 38 + | 
|  | 39 +    if (hash_obj == NULL) { | 
|  | 40 +       return SECFailure; | 
|  | 41 +    } | 
|  | 42 + | 
|  | 43 +    hashcx = hash_obj->create(); | 
|  | 44 +    if (hashcx == NULL) { | 
|  | 45 +       return SECFailure; | 
|  | 46 +    } | 
|  | 47 +    hash_obj->begin(hashcx); | 
|  | 48 +    hash_obj->update(hashcx,src,src_len); | 
|  | 49 +    hash_obj->end(hashcx,dest, &dummy, hash_obj->length); | 
|  | 50 +    hash_obj->destroy(hashcx, PR_TRUE); | 
|  | 51 +    return SECSuccess; | 
|  | 52 +} | 
|  | 53 | 
|  | 54  unsigned int | 
|  | 55  PQG_GetLength(const SECItem *obj) | 
|  | 56 Index: mozilla/security/nss/lib/freebl/rawhash.c | 
|  | 57 =================================================================== | 
|  | 58 RCS file: /cvsroot/mozilla/security/nss/lib/freebl/rawhash.c,v | 
|  | 59 retrieving revision 1.10 | 
|  | 60 retrieving revision 1.11 | 
|  | 61 diff -p -u -r1.10 -r1.11 | 
|  | 62 --- mozilla/security/nss/lib/freebl/rawhash.c   26 Jun 2012 22:27:29 -0000      
     1.10 | 
|  | 63 +++ mozilla/security/nss/lib/freebl/rawhash.c   25 Sep 2012 23:38:38 -0000      
     1.11 | 
|  | 64 @@ -145,36 +145,3 @@ HASH_GetRawHashObject(HASH_HashType hash | 
|  | 65      } | 
|  | 66      return &SECRawHashObjects[hashType]; | 
|  | 67  } | 
|  | 68 - | 
|  | 69 -unsigned int | 
|  | 70 -HASH_ResultLen(HASH_HashType type) | 
|  | 71 -{ | 
|  | 72 -    const SECHashObject *hash_obj = HASH_GetRawHashObject(type); | 
|  | 73 -    if (hash_obj == NULL) { | 
|  | 74 -       return 0; | 
|  | 75 -    } | 
|  | 76 -    return hash_obj->length; | 
|  | 77 -} | 
|  | 78 - | 
|  | 79 -SECStatus | 
|  | 80 -HASH_HashBuf(HASH_HashType type, unsigned char *dest, | 
|  | 81 -            const unsigned char *src, PRUint32 src_len) | 
|  | 82 -{ | 
|  | 83 -    const SECHashObject *hash_obj = HASH_GetRawHashObject(type); | 
|  | 84 -    void *hashcx = NULL; | 
|  | 85 -    unsigned int dummy; | 
|  | 86 - | 
|  | 87 -    if (hash_obj == NULL) { | 
|  | 88 -       return SECFailure; | 
|  | 89 -    } | 
|  | 90 - | 
|  | 91 -    hashcx = hash_obj->create(); | 
|  | 92 -    if (hashcx == NULL) { | 
|  | 93 -       return SECFailure; | 
|  | 94 -    } | 
|  | 95 -    hash_obj->begin(hashcx); | 
|  | 96 -    hash_obj->update(hashcx,src,src_len); | 
|  | 97 -    hash_obj->end(hashcx,dest, &dummy, hash_obj->length); | 
|  | 98 -    hash_obj->destroy(hashcx, PR_TRUE); | 
|  | 99 -    return SECSuccess; | 
|  | 100 -} | 
| OLD | NEW | 
|---|