OLD | NEW |
1 /* | 1 /* |
2 * crypto.h - public data structures and prototypes for the crypto library | 2 * crypto.h - public data structures and prototypes for the crypto library |
3 * | 3 * |
4 * This Source Code Form is subject to the terms of the Mozilla Public | 4 * This Source Code Form is subject to the terms of the Mozilla Public |
5 * License, v. 2.0. If a copy of the MPL was not distributed with this | 5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
7 | 7 |
8 #ifndef _BLAPI_H_ | 8 #ifndef _BLAPI_H_ |
9 #define _BLAPI_H_ | 9 #define _BLAPI_H_ |
10 | 10 |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 | 826 |
827 /* | 827 /* |
828 ** Hash a null terminated string "src" into "dest" using MD5 | 828 ** Hash a null terminated string "src" into "dest" using MD5 |
829 */ | 829 */ |
830 extern SECStatus MD5_Hash(unsigned char *dest, const char *src); | 830 extern SECStatus MD5_Hash(unsigned char *dest, const char *src); |
831 | 831 |
832 /* | 832 /* |
833 ** Hash a non-null terminated string "src" into "dest" using MD5 | 833 ** Hash a non-null terminated string "src" into "dest" using MD5 |
834 */ | 834 */ |
835 extern SECStatus MD5_HashBuf(unsigned char *dest, const unsigned char *src, | 835 extern SECStatus MD5_HashBuf(unsigned char *dest, const unsigned char *src, |
836 » » » uint32 src_length); | 836 » » » PRUint32 src_length); |
837 | 837 |
838 /* | 838 /* |
839 ** Create a new MD5 context | 839 ** Create a new MD5 context |
840 */ | 840 */ |
841 extern MD5Context *MD5_NewContext(void); | 841 extern MD5Context *MD5_NewContext(void); |
842 | 842 |
843 | 843 |
844 /* | 844 /* |
845 ** Destroy an MD5 secure hash context. | 845 ** Destroy an MD5 secure hash context. |
846 ** "cx" the context | 846 ** "cx" the context |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 | 994 |
995 /* | 995 /* |
996 ** Hash a null terminated string "src" into "dest" using SHA-1 | 996 ** Hash a null terminated string "src" into "dest" using SHA-1 |
997 */ | 997 */ |
998 extern SECStatus SHA1_Hash(unsigned char *dest, const char *src); | 998 extern SECStatus SHA1_Hash(unsigned char *dest, const char *src); |
999 | 999 |
1000 /* | 1000 /* |
1001 ** Hash a non-null terminated string "src" into "dest" using SHA-1 | 1001 ** Hash a non-null terminated string "src" into "dest" using SHA-1 |
1002 */ | 1002 */ |
1003 extern SECStatus SHA1_HashBuf(unsigned char *dest, const unsigned char *src, | 1003 extern SECStatus SHA1_HashBuf(unsigned char *dest, const unsigned char *src, |
1004 » » » uint32 src_length); | 1004 » » » PRUint32 src_length); |
1005 | 1005 |
1006 /* | 1006 /* |
1007 ** Create a new SHA-1 context | 1007 ** Create a new SHA-1 context |
1008 */ | 1008 */ |
1009 extern SHA1Context *SHA1_NewContext(void); | 1009 extern SHA1Context *SHA1_NewContext(void); |
1010 | 1010 |
1011 | 1011 |
1012 /* | 1012 /* |
1013 ** Destroy a SHA-1 secure hash context. | 1013 ** Destroy a SHA-1 secure hash context. |
1014 ** "cx" the context | 1014 ** "cx" the context |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 ** padding and length bytes. Produce the digested results in "digest" | 1096 ** padding and length bytes. Produce the digested results in "digest" |
1097 ** "cx" the context | 1097 ** "cx" the context |
1098 ** "digest" where the 28 bytes of digest data are stored | 1098 ** "digest" where the 28 bytes of digest data are stored |
1099 ** "digestLen" where the digest length (28) is stored (optional) | 1099 ** "digestLen" where the digest length (28) is stored (optional) |
1100 ** "maxDigestLen" the maximum amount of data that can ever be | 1100 ** "maxDigestLen" the maximum amount of data that can ever be |
1101 ** stored in "digest" | 1101 ** stored in "digest" |
1102 */ | 1102 */ |
1103 extern void SHA224_EndRaw(SHA224Context *cx, unsigned char *digest, | 1103 extern void SHA224_EndRaw(SHA224Context *cx, unsigned char *digest, |
1104 unsigned int *digestLen, unsigned int maxDigestLen); | 1104 unsigned int *digestLen, unsigned int maxDigestLen); |
1105 extern SECStatus SHA224_HashBuf(unsigned char *dest, const unsigned char *src, | 1105 extern SECStatus SHA224_HashBuf(unsigned char *dest, const unsigned char *src, |
1106 » » » uint32 src_length); | 1106 » » » » PRUint32 src_length); |
1107 extern SECStatus SHA224_Hash(unsigned char *dest, const char *src); | 1107 extern SECStatus SHA224_Hash(unsigned char *dest, const char *src); |
1108 extern void SHA224_TraceState(SHA224Context *cx); | 1108 extern void SHA224_TraceState(SHA224Context *cx); |
1109 extern unsigned int SHA224_FlattenSize(SHA224Context *cx); | 1109 extern unsigned int SHA224_FlattenSize(SHA224Context *cx); |
1110 extern SECStatus SHA224_Flatten(SHA224Context *cx,unsigned char *space); | 1110 extern SECStatus SHA224_Flatten(SHA224Context *cx,unsigned char *space); |
1111 extern SHA224Context * SHA224_Resurrect(unsigned char *space, void *arg); | 1111 extern SHA224Context * SHA224_Resurrect(unsigned char *space, void *arg); |
1112 extern void SHA224_Clone(SHA224Context *dest, SHA224Context *src); | 1112 extern void SHA224_Clone(SHA224Context *dest, SHA224Context *src); |
1113 | 1113 |
1114 /******************************************/ | 1114 /******************************************/ |
1115 | 1115 |
1116 extern SHA256Context *SHA256_NewContext(void); | 1116 extern SHA256Context *SHA256_NewContext(void); |
1117 extern void SHA256_DestroyContext(SHA256Context *cx, PRBool freeit); | 1117 extern void SHA256_DestroyContext(SHA256Context *cx, PRBool freeit); |
1118 extern void SHA256_Begin(SHA256Context *cx); | 1118 extern void SHA256_Begin(SHA256Context *cx); |
1119 extern void SHA256_Update(SHA256Context *cx, const unsigned char *input, | 1119 extern void SHA256_Update(SHA256Context *cx, const unsigned char *input, |
1120 unsigned int inputLen); | 1120 unsigned int inputLen); |
1121 extern void SHA256_End(SHA256Context *cx, unsigned char *digest, | 1121 extern void SHA256_End(SHA256Context *cx, unsigned char *digest, |
1122 unsigned int *digestLen, unsigned int maxDigestLen); | 1122 unsigned int *digestLen, unsigned int maxDigestLen); |
1123 /* | 1123 /* |
1124 ** Export the current state of the SHA-256 hash without appending the standard | 1124 ** Export the current state of the SHA-256 hash without appending the standard |
1125 ** padding and length bytes. Produce the digested results in "digest" | 1125 ** padding and length bytes. Produce the digested results in "digest" |
1126 ** "cx" the context | 1126 ** "cx" the context |
1127 ** "digest" where the 32 bytes of digest data are stored | 1127 ** "digest" where the 32 bytes of digest data are stored |
1128 ** "digestLen" where the digest length (32) is stored (optional) | 1128 ** "digestLen" where the digest length (32) is stored (optional) |
1129 ** "maxDigestLen" the maximum amount of data that can ever be | 1129 ** "maxDigestLen" the maximum amount of data that can ever be |
1130 ** stored in "digest" | 1130 ** stored in "digest" |
1131 */ | 1131 */ |
1132 extern void SHA256_EndRaw(SHA256Context *cx, unsigned char *digest, | 1132 extern void SHA256_EndRaw(SHA256Context *cx, unsigned char *digest, |
1133 unsigned int *digestLen, unsigned int maxDigestLen); | 1133 unsigned int *digestLen, unsigned int maxDigestLen); |
1134 extern SECStatus SHA256_HashBuf(unsigned char *dest, const unsigned char *src, | 1134 extern SECStatus SHA256_HashBuf(unsigned char *dest, const unsigned char *src, |
1135 » » » uint32 src_length); | 1135 » » » » PRUint32 src_length); |
1136 extern SECStatus SHA256_Hash(unsigned char *dest, const char *src); | 1136 extern SECStatus SHA256_Hash(unsigned char *dest, const char *src); |
1137 extern void SHA256_TraceState(SHA256Context *cx); | 1137 extern void SHA256_TraceState(SHA256Context *cx); |
1138 extern unsigned int SHA256_FlattenSize(SHA256Context *cx); | 1138 extern unsigned int SHA256_FlattenSize(SHA256Context *cx); |
1139 extern SECStatus SHA256_Flatten(SHA256Context *cx,unsigned char *space); | 1139 extern SECStatus SHA256_Flatten(SHA256Context *cx,unsigned char *space); |
1140 extern SHA256Context * SHA256_Resurrect(unsigned char *space, void *arg); | 1140 extern SHA256Context * SHA256_Resurrect(unsigned char *space, void *arg); |
1141 extern void SHA256_Clone(SHA256Context *dest, SHA256Context *src); | 1141 extern void SHA256_Clone(SHA256Context *dest, SHA256Context *src); |
1142 | 1142 |
1143 /******************************************/ | 1143 /******************************************/ |
1144 | 1144 |
1145 extern SHA512Context *SHA512_NewContext(void); | 1145 extern SHA512Context *SHA512_NewContext(void); |
1146 extern void SHA512_DestroyContext(SHA512Context *cx, PRBool freeit); | 1146 extern void SHA512_DestroyContext(SHA512Context *cx, PRBool freeit); |
1147 extern void SHA512_Begin(SHA512Context *cx); | 1147 extern void SHA512_Begin(SHA512Context *cx); |
1148 extern void SHA512_Update(SHA512Context *cx, const unsigned char *input, | 1148 extern void SHA512_Update(SHA512Context *cx, const unsigned char *input, |
1149 unsigned int inputLen); | 1149 unsigned int inputLen); |
1150 /* | 1150 /* |
1151 ** Export the current state of the SHA-512 hash without appending the standard | 1151 ** Export the current state of the SHA-512 hash without appending the standard |
1152 ** padding and length bytes. Produce the digested results in "digest" | 1152 ** padding and length bytes. Produce the digested results in "digest" |
1153 ** "cx" the context | 1153 ** "cx" the context |
1154 ** "digest" where the 64 bytes of digest data are stored | 1154 ** "digest" where the 64 bytes of digest data are stored |
1155 ** "digestLen" where the digest length (64) is stored (optional) | 1155 ** "digestLen" where the digest length (64) is stored (optional) |
1156 ** "maxDigestLen" the maximum amount of data that can ever be | 1156 ** "maxDigestLen" the maximum amount of data that can ever be |
1157 ** stored in "digest" | 1157 ** stored in "digest" |
1158 */ | 1158 */ |
1159 extern void SHA512_EndRaw(SHA512Context *cx, unsigned char *digest, | 1159 extern void SHA512_EndRaw(SHA512Context *cx, unsigned char *digest, |
1160 unsigned int *digestLen, unsigned int maxDigestLen); | 1160 unsigned int *digestLen, unsigned int maxDigestLen); |
1161 extern void SHA512_End(SHA512Context *cx, unsigned char *digest, | 1161 extern void SHA512_End(SHA512Context *cx, unsigned char *digest, |
1162 unsigned int *digestLen, unsigned int maxDigestLen); | 1162 unsigned int *digestLen, unsigned int maxDigestLen); |
1163 extern SECStatus SHA512_HashBuf(unsigned char *dest, const unsigned char *src, | 1163 extern SECStatus SHA512_HashBuf(unsigned char *dest, const unsigned char *src, |
1164 » » » uint32 src_length); | 1164 » » » » PRUint32 src_length); |
1165 extern SECStatus SHA512_Hash(unsigned char *dest, const char *src); | 1165 extern SECStatus SHA512_Hash(unsigned char *dest, const char *src); |
1166 extern void SHA512_TraceState(SHA512Context *cx); | 1166 extern void SHA512_TraceState(SHA512Context *cx); |
1167 extern unsigned int SHA512_FlattenSize(SHA512Context *cx); | 1167 extern unsigned int SHA512_FlattenSize(SHA512Context *cx); |
1168 extern SECStatus SHA512_Flatten(SHA512Context *cx,unsigned char *space); | 1168 extern SECStatus SHA512_Flatten(SHA512Context *cx,unsigned char *space); |
1169 extern SHA512Context * SHA512_Resurrect(unsigned char *space, void *arg); | 1169 extern SHA512Context * SHA512_Resurrect(unsigned char *space, void *arg); |
1170 extern void SHA512_Clone(SHA512Context *dest, SHA512Context *src); | 1170 extern void SHA512_Clone(SHA512Context *dest, SHA512Context *src); |
1171 | 1171 |
1172 /******************************************/ | 1172 /******************************************/ |
1173 | 1173 |
1174 extern SHA384Context *SHA384_NewContext(void); | 1174 extern SHA384Context *SHA384_NewContext(void); |
1175 extern void SHA384_DestroyContext(SHA384Context *cx, PRBool freeit); | 1175 extern void SHA384_DestroyContext(SHA384Context *cx, PRBool freeit); |
1176 extern void SHA384_Begin(SHA384Context *cx); | 1176 extern void SHA384_Begin(SHA384Context *cx); |
1177 extern void SHA384_Update(SHA384Context *cx, const unsigned char *input, | 1177 extern void SHA384_Update(SHA384Context *cx, const unsigned char *input, |
1178 unsigned int inputLen); | 1178 unsigned int inputLen); |
1179 extern void SHA384_End(SHA384Context *cx, unsigned char *digest, | 1179 extern void SHA384_End(SHA384Context *cx, unsigned char *digest, |
1180 unsigned int *digestLen, unsigned int maxDigestLen); | 1180 unsigned int *digestLen, unsigned int maxDigestLen); |
1181 /* | 1181 /* |
1182 ** Export the current state of the SHA-384 hash without appending the standard | 1182 ** Export the current state of the SHA-384 hash without appending the standard |
1183 ** padding and length bytes. Produce the digested results in "digest" | 1183 ** padding and length bytes. Produce the digested results in "digest" |
1184 ** "cx" the context | 1184 ** "cx" the context |
1185 ** "digest" where the 48 bytes of digest data are stored | 1185 ** "digest" where the 48 bytes of digest data are stored |
1186 ** "digestLen" where the digest length (48) is stored (optional) | 1186 ** "digestLen" where the digest length (48) is stored (optional) |
1187 ** "maxDigestLen" the maximum amount of data that can ever be | 1187 ** "maxDigestLen" the maximum amount of data that can ever be |
1188 ** stored in "digest" | 1188 ** stored in "digest" |
1189 */ | 1189 */ |
1190 extern void SHA384_EndRaw(SHA384Context *cx, unsigned char *digest, | 1190 extern void SHA384_EndRaw(SHA384Context *cx, unsigned char *digest, |
1191 unsigned int *digestLen, unsigned int maxDigestLen); | 1191 unsigned int *digestLen, unsigned int maxDigestLen); |
1192 extern SECStatus SHA384_HashBuf(unsigned char *dest, const unsigned char *src, | 1192 extern SECStatus SHA384_HashBuf(unsigned char *dest, const unsigned char *src, |
1193 » » » uint32 src_length); | 1193 » » » » PRUint32 src_length); |
1194 extern SECStatus SHA384_Hash(unsigned char *dest, const char *src); | 1194 extern SECStatus SHA384_Hash(unsigned char *dest, const char *src); |
1195 extern void SHA384_TraceState(SHA384Context *cx); | 1195 extern void SHA384_TraceState(SHA384Context *cx); |
1196 extern unsigned int SHA384_FlattenSize(SHA384Context *cx); | 1196 extern unsigned int SHA384_FlattenSize(SHA384Context *cx); |
1197 extern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space); | 1197 extern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space); |
1198 extern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg); | 1198 extern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg); |
1199 extern void SHA384_Clone(SHA384Context *dest, SHA384Context *src); | 1199 extern void SHA384_Clone(SHA384Context *dest, SHA384Context *src); |
1200 | 1200 |
1201 /**************************************** | 1201 /**************************************** |
1202 * implement TLS 1.0 Pseudo Random Function (PRF) and TLS P_hash function | 1202 * implement TLS 1.0 Pseudo Random Function (PRF) and TLS P_hash function |
1203 */ | 1203 */ |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 PRBool BLAPI_VerifySelf(const char *name); | 1404 PRBool BLAPI_VerifySelf(const char *name); |
1405 | 1405 |
1406 /*********************************************************************/ | 1406 /*********************************************************************/ |
1407 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); | 1407 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); |
1408 | 1408 |
1409 extern void BL_SetForkState(PRBool forked); | 1409 extern void BL_SetForkState(PRBool forked); |
1410 | 1410 |
1411 SEC_END_PROTOS | 1411 SEC_END_PROTOS |
1412 | 1412 |
1413 #endif /* _BLAPI_H_ */ | 1413 #endif /* _BLAPI_H_ */ |
OLD | NEW |