| 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 /* $Id: blapi.h,v 1.49 2012/10/11 00:10:26 rrelyea%redhat.com Exp $ */ | 7 /* $Id: blapi.h,v 1.50 2013/02/05 18:10:42 wtc%google.com Exp $ */ |
| 8 | 8 |
| 9 #ifndef _BLAPI_H_ | 9 #ifndef _BLAPI_H_ |
| 10 #define _BLAPI_H_ | 10 #define _BLAPI_H_ |
| 11 | 11 |
| 12 #include "blapit.h" | 12 #include "blapit.h" |
| 13 #include "hasht.h" | 13 #include "hasht.h" |
| 14 #include "alghmac.h" | 14 #include "alghmac.h" |
| 15 | 15 |
| 16 SEC_BEGIN_PROTOS | 16 SEC_BEGIN_PROTOS |
| 17 | 17 |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 ** "cx" the context | 868 ** "cx" the context |
| 869 ** "digest" where the 16 bytes of digest data are stored | 869 ** "digest" where the 16 bytes of digest data are stored |
| 870 ** "digestLen" where the digest length (16) is stored | 870 ** "digestLen" where the digest length (16) is stored |
| 871 ** "maxDigestLen" the maximum amount of data that can ever be | 871 ** "maxDigestLen" the maximum amount of data that can ever be |
| 872 ** stored in "digest" | 872 ** stored in "digest" |
| 873 */ | 873 */ |
| 874 extern void MD5_End(MD5Context *cx, unsigned char *digest, | 874 extern void MD5_End(MD5Context *cx, unsigned char *digest, |
| 875 unsigned int *digestLen, unsigned int maxDigestLen); | 875 unsigned int *digestLen, unsigned int maxDigestLen); |
| 876 | 876 |
| 877 /* | 877 /* |
| 878 ** Export the raw state of the MD5 hash without appending the standard padding |
| 879 ** and length bytes. Produce the digested results in "digest" |
| 880 ** "cx" the context |
| 881 ** "digest" where the 16 bytes of digest data are stored |
| 882 ** "digestLen" where the digest length (16) is stored (optional) |
| 883 ** "maxDigestLen" the maximum amount of data that can ever be |
| 884 ** stored in "digest" |
| 885 */ |
| 886 extern void MD5_EndRaw(MD5Context *cx, unsigned char *digest, |
| 887 unsigned int *digestLen, unsigned int maxDigestLen); |
| 888 |
| 889 /* |
| 878 * Return the the size of a buffer needed to flatten the MD5 Context into | 890 * Return the the size of a buffer needed to flatten the MD5 Context into |
| 879 * "cx" the context | 891 * "cx" the context |
| 880 * returns size; | 892 * returns size; |
| 881 */ | 893 */ |
| 882 extern unsigned int MD5_FlattenSize(MD5Context *cx); | 894 extern unsigned int MD5_FlattenSize(MD5Context *cx); |
| 883 | 895 |
| 884 /* | 896 /* |
| 885 * Flatten the MD5 Context into a buffer: | 897 * Flatten the MD5 Context into a buffer: |
| 886 * "cx" the context | 898 * "cx" the context |
| 887 * "space" the buffer to flatten to | 899 * "space" the buffer to flatten to |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 ** "cx" the context | 1036 ** "cx" the context |
| 1025 ** "digest" where the 16 bytes of digest data are stored | 1037 ** "digest" where the 16 bytes of digest data are stored |
| 1026 ** "digestLen" where the digest length (20) is stored | 1038 ** "digestLen" where the digest length (20) is stored |
| 1027 ** "maxDigestLen" the maximum amount of data that can ever be | 1039 ** "maxDigestLen" the maximum amount of data that can ever be |
| 1028 ** stored in "digest" | 1040 ** stored in "digest" |
| 1029 */ | 1041 */ |
| 1030 extern void SHA1_End(SHA1Context *cx, unsigned char *digest, | 1042 extern void SHA1_End(SHA1Context *cx, unsigned char *digest, |
| 1031 unsigned int *digestLen, unsigned int maxDigestLen); | 1043 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1032 | 1044 |
| 1033 /* | 1045 /* |
| 1046 ** Export the current state of the SHA-1 hash without appending the standard |
| 1047 ** padding and length. Produce the digested results in "digest" |
| 1048 ** "cx" the context |
| 1049 ** "digest" where the 16 bytes of digest data are stored |
| 1050 ** "digestLen" where the digest length (20) is stored (optional) |
| 1051 ** "maxDigestLen" the maximum amount of data that can ever be |
| 1052 ** stored in "digest" |
| 1053 */ |
| 1054 extern void SHA1_EndRaw(SHA1Context *cx, unsigned char *digest, |
| 1055 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1056 |
| 1057 /* |
| 1034 ** trace the intermediate state info of the SHA1 hash. | 1058 ** trace the intermediate state info of the SHA1 hash. |
| 1035 */ | 1059 */ |
| 1036 extern void SHA1_TraceState(SHA1Context *cx); | 1060 extern void SHA1_TraceState(SHA1Context *cx); |
| 1037 | 1061 |
| 1038 /* | 1062 /* |
| 1039 * Return the the size of a buffer needed to flatten the SHA-1 Context into | 1063 * Return the the size of a buffer needed to flatten the SHA-1 Context into |
| 1040 * "cx" the context | 1064 * "cx" the context |
| 1041 * returns size; | 1065 * returns size; |
| 1042 */ | 1066 */ |
| 1043 extern unsigned int SHA1_FlattenSize(SHA1Context *cx); | 1067 extern unsigned int SHA1_FlattenSize(SHA1Context *cx); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1061 | 1085 |
| 1062 /******************************************/ | 1086 /******************************************/ |
| 1063 | 1087 |
| 1064 extern SHA224Context *SHA224_NewContext(void); | 1088 extern SHA224Context *SHA224_NewContext(void); |
| 1065 extern void SHA224_DestroyContext(SHA224Context *cx, PRBool freeit); | 1089 extern void SHA224_DestroyContext(SHA224Context *cx, PRBool freeit); |
| 1066 extern void SHA224_Begin(SHA224Context *cx); | 1090 extern void SHA224_Begin(SHA224Context *cx); |
| 1067 extern void SHA224_Update(SHA224Context *cx, const unsigned char *input, | 1091 extern void SHA224_Update(SHA224Context *cx, const unsigned char *input, |
| 1068 unsigned int inputLen); | 1092 unsigned int inputLen); |
| 1069 extern void SHA224_End(SHA224Context *cx, unsigned char *digest, | 1093 extern void SHA224_End(SHA224Context *cx, unsigned char *digest, |
| 1070 unsigned int *digestLen, unsigned int maxDigestLen); | 1094 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1095 extern void SHA224_EndRaw(SHA224Context *cx, unsigned char *digest, |
| 1096 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1071 extern SECStatus SHA224_HashBuf(unsigned char *dest, const unsigned char *src, | 1097 extern SECStatus SHA224_HashBuf(unsigned char *dest, const unsigned char *src, |
| 1072 uint32 src_length); | 1098 uint32 src_length); |
| 1073 extern SECStatus SHA224_Hash(unsigned char *dest, const char *src); | 1099 extern SECStatus SHA224_Hash(unsigned char *dest, const char *src); |
| 1074 extern void SHA224_TraceState(SHA224Context *cx); | 1100 extern void SHA224_TraceState(SHA224Context *cx); |
| 1075 extern unsigned int SHA224_FlattenSize(SHA224Context *cx); | 1101 extern unsigned int SHA224_FlattenSize(SHA224Context *cx); |
| 1076 extern SECStatus SHA224_Flatten(SHA224Context *cx,unsigned char *space); | 1102 extern SECStatus SHA224_Flatten(SHA224Context *cx,unsigned char *space); |
| 1077 extern SHA224Context * SHA224_Resurrect(unsigned char *space, void *arg); | 1103 extern SHA224Context * SHA224_Resurrect(unsigned char *space, void *arg); |
| 1078 extern void SHA224_Clone(SHA224Context *dest, SHA224Context *src); | 1104 extern void SHA224_Clone(SHA224Context *dest, SHA224Context *src); |
| 1079 | 1105 |
| 1080 /******************************************/ | 1106 /******************************************/ |
| 1081 | 1107 |
| 1082 extern SHA256Context *SHA256_NewContext(void); | 1108 extern SHA256Context *SHA256_NewContext(void); |
| 1083 extern void SHA256_DestroyContext(SHA256Context *cx, PRBool freeit); | 1109 extern void SHA256_DestroyContext(SHA256Context *cx, PRBool freeit); |
| 1084 extern void SHA256_Begin(SHA256Context *cx); | 1110 extern void SHA256_Begin(SHA256Context *cx); |
| 1085 extern void SHA256_Update(SHA256Context *cx, const unsigned char *input, | 1111 extern void SHA256_Update(SHA256Context *cx, const unsigned char *input, |
| 1086 unsigned int inputLen); | 1112 unsigned int inputLen); |
| 1087 extern void SHA256_End(SHA256Context *cx, unsigned char *digest, | 1113 extern void SHA256_End(SHA256Context *cx, unsigned char *digest, |
| 1088 unsigned int *digestLen, unsigned int maxDigestLen); | 1114 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1115 extern void SHA256_EndRaw(SHA256Context *cx, unsigned char *digest, |
| 1116 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1089 extern SECStatus SHA256_HashBuf(unsigned char *dest, const unsigned char *src, | 1117 extern SECStatus SHA256_HashBuf(unsigned char *dest, const unsigned char *src, |
| 1090 uint32 src_length); | 1118 uint32 src_length); |
| 1091 extern SECStatus SHA256_Hash(unsigned char *dest, const char *src); | 1119 extern SECStatus SHA256_Hash(unsigned char *dest, const char *src); |
| 1092 extern void SHA256_TraceState(SHA256Context *cx); | 1120 extern void SHA256_TraceState(SHA256Context *cx); |
| 1093 extern unsigned int SHA256_FlattenSize(SHA256Context *cx); | 1121 extern unsigned int SHA256_FlattenSize(SHA256Context *cx); |
| 1094 extern SECStatus SHA256_Flatten(SHA256Context *cx,unsigned char *space); | 1122 extern SECStatus SHA256_Flatten(SHA256Context *cx,unsigned char *space); |
| 1095 extern SHA256Context * SHA256_Resurrect(unsigned char *space, void *arg); | 1123 extern SHA256Context * SHA256_Resurrect(unsigned char *space, void *arg); |
| 1096 extern void SHA256_Clone(SHA256Context *dest, SHA256Context *src); | 1124 extern void SHA256_Clone(SHA256Context *dest, SHA256Context *src); |
| 1097 | 1125 |
| 1098 /******************************************/ | 1126 /******************************************/ |
| 1099 | 1127 |
| 1100 extern SHA512Context *SHA512_NewContext(void); | 1128 extern SHA512Context *SHA512_NewContext(void); |
| 1101 extern void SHA512_DestroyContext(SHA512Context *cx, PRBool freeit); | 1129 extern void SHA512_DestroyContext(SHA512Context *cx, PRBool freeit); |
| 1102 extern void SHA512_Begin(SHA512Context *cx); | 1130 extern void SHA512_Begin(SHA512Context *cx); |
| 1103 extern void SHA512_Update(SHA512Context *cx, const unsigned char *input, | 1131 extern void SHA512_Update(SHA512Context *cx, const unsigned char *input, |
| 1104 unsigned int inputLen); | 1132 unsigned int inputLen); |
| 1133 extern void SHA512_EndRaw(SHA512Context *cx, unsigned char *digest, |
| 1134 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1105 extern void SHA512_End(SHA512Context *cx, unsigned char *digest, | 1135 extern void SHA512_End(SHA512Context *cx, unsigned char *digest, |
| 1106 unsigned int *digestLen, unsigned int maxDigestLen); | 1136 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1107 extern SECStatus SHA512_HashBuf(unsigned char *dest, const unsigned char *src, | 1137 extern SECStatus SHA512_HashBuf(unsigned char *dest, const unsigned char *src, |
| 1108 uint32 src_length); | 1138 uint32 src_length); |
| 1109 extern SECStatus SHA512_Hash(unsigned char *dest, const char *src); | 1139 extern SECStatus SHA512_Hash(unsigned char *dest, const char *src); |
| 1110 extern void SHA512_TraceState(SHA512Context *cx); | 1140 extern void SHA512_TraceState(SHA512Context *cx); |
| 1111 extern unsigned int SHA512_FlattenSize(SHA512Context *cx); | 1141 extern unsigned int SHA512_FlattenSize(SHA512Context *cx); |
| 1112 extern SECStatus SHA512_Flatten(SHA512Context *cx,unsigned char *space); | 1142 extern SECStatus SHA512_Flatten(SHA512Context *cx,unsigned char *space); |
| 1113 extern SHA512Context * SHA512_Resurrect(unsigned char *space, void *arg); | 1143 extern SHA512Context * SHA512_Resurrect(unsigned char *space, void *arg); |
| 1114 extern void SHA512_Clone(SHA512Context *dest, SHA512Context *src); | 1144 extern void SHA512_Clone(SHA512Context *dest, SHA512Context *src); |
| 1115 | 1145 |
| 1116 /******************************************/ | 1146 /******************************************/ |
| 1117 | 1147 |
| 1118 extern SHA384Context *SHA384_NewContext(void); | 1148 extern SHA384Context *SHA384_NewContext(void); |
| 1119 extern void SHA384_DestroyContext(SHA384Context *cx, PRBool freeit); | 1149 extern void SHA384_DestroyContext(SHA384Context *cx, PRBool freeit); |
| 1120 extern void SHA384_Begin(SHA384Context *cx); | 1150 extern void SHA384_Begin(SHA384Context *cx); |
| 1121 extern void SHA384_Update(SHA384Context *cx, const unsigned char *input, | 1151 extern void SHA384_Update(SHA384Context *cx, const unsigned char *input, |
| 1122 unsigned int inputLen); | 1152 unsigned int inputLen); |
| 1123 extern void SHA384_End(SHA384Context *cx, unsigned char *digest, | 1153 extern void SHA384_End(SHA384Context *cx, unsigned char *digest, |
| 1124 unsigned int *digestLen, unsigned int maxDigestLen); | 1154 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1155 extern void SHA384_EndRaw(SHA384Context *cx, unsigned char *digest, |
| 1156 unsigned int *digestLen, unsigned int maxDigestLen); |
| 1125 extern SECStatus SHA384_HashBuf(unsigned char *dest, const unsigned char *src, | 1157 extern SECStatus SHA384_HashBuf(unsigned char *dest, const unsigned char *src, |
| 1126 uint32 src_length); | 1158 uint32 src_length); |
| 1127 extern SECStatus SHA384_Hash(unsigned char *dest, const char *src); | 1159 extern SECStatus SHA384_Hash(unsigned char *dest, const char *src); |
| 1128 extern void SHA384_TraceState(SHA384Context *cx); | 1160 extern void SHA384_TraceState(SHA384Context *cx); |
| 1129 extern unsigned int SHA384_FlattenSize(SHA384Context *cx); | 1161 extern unsigned int SHA384_FlattenSize(SHA384Context *cx); |
| 1130 extern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space); | 1162 extern SECStatus SHA384_Flatten(SHA384Context *cx,unsigned char *space); |
| 1131 extern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg); | 1163 extern SHA384Context * SHA384_Resurrect(unsigned char *space, void *arg); |
| 1132 extern void SHA384_Clone(SHA384Context *dest, SHA384Context *src); | 1164 extern void SHA384_Clone(SHA384Context *dest, SHA384Context *src); |
| 1133 | 1165 |
| 1134 /**************************************** | 1166 /**************************************** |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 PRBool BLAPI_VerifySelf(const char *name); | 1369 PRBool BLAPI_VerifySelf(const char *name); |
| 1338 | 1370 |
| 1339 /*********************************************************************/ | 1371 /*********************************************************************/ |
| 1340 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); | 1372 extern const SECHashObject * HASH_GetRawHashObject(HASH_HashType hashType); |
| 1341 | 1373 |
| 1342 extern void BL_SetForkState(PRBool forked); | 1374 extern void BL_SetForkState(PRBool forked); |
| 1343 | 1375 |
| 1344 SEC_END_PROTOS | 1376 SEC_END_PROTOS |
| 1345 | 1377 |
| 1346 #endif /* _BLAPI_H_ */ | 1378 #endif /* _BLAPI_H_ */ |
| OLD | NEW |