Comment: | Added option to enable and disable PKCS#7 padding |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | crypto |
Files: | files | file ages | folders |
SHA3-256: |
32f48d257bb000abfef2820087c5db9d |
User & Date: | bohagan on 2024-03-30 19:52:16 |
Other Links: | branch diff | manifest | tags |
2024-03-30
| ||
22:37 | Added Triple DES test vectors check-in: ac8a00b954 user: bohagan tags: crypto | |
19:52 | Added option to enable and disable PKCS#7 padding check-in: 32f48d257b user: bohagan tags: crypto | |
2024-03-29
| ||
22:59 | Added AES symmetrical block cipher test vectors check-in: 564db0e896 user: bohagan tags: crypto | |
Modified doc/cryptography.html from [30d9aec646] to [a35fd472f9].
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - - - + + + - + + + + + + + + + | key. Default is 2048. Some <a href="#KDF"><b>KDF</b></a> implementations require an iteration count.</dd> </dl> <dl> <dt><a name="-iv"><strong>-iv</strong> <em>string</em></a></dt> <dd>Initialization vector (IV) to use. Required for some ciphers and GMAC. |
︙ | |||
605 606 607 608 609 610 611 | 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | - - - - - - - - - + + + + + + + + + + + + + + + + | <br> <h3><a name="GLOSSARY">GLOSSARY</a></h3> <p>The following is a list of the terminology used in this package along with brief definitions. For more details, please consult with the OpenSSL documentation.</p> <table> |
︙ |
Modified generic/tlsEncrypt.c from [b7199aabc5] to [8d58b29b53].
︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - + | * * Side effects: * No result or error message * *------------------------------------------------------------------- */ int EncryptInitialize(Tcl_Interp *interp, int type, EVP_CIPHER_CTX **ctx, |
︙ | |||
176 177 178 179 180 181 182 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - + - + - + + + + + + + + + + + + + + + + + + | /* Create context */ if((*ctx = EVP_CIPHER_CTX_new()) == NULL) { Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL); return TCL_ERROR; } |
︙ | |||
736 737 738 739 740 741 742 | 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 | - + | * * Side effects: * Adds transform to channel and sets result to channel id or error message. * *---------------------------------------------------------------------- */ static int EncryptChannelHandler(Tcl_Interp *interp, int type, const char *channel, |
︙ | |||
770 771 772 773 774 775 776 | 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | - + | Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL); return TCL_ERROR; } statePtr->self = chan; statePtr->mode = mode; /* Initialize function */ |
︙ | |||
959 960 961 962 963 964 965 | 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 | - - + + - + | * TCL_OK or TCL_ERROR * * Side effects: * Creates command or error message * *------------------------------------------------------------------- */ |
︙ | |||
1004 1005 1006 1007 1008 1009 1010 | 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 | - + | * * Side effects: * Sets result or error message * *------------------------------------------------------------------- */ int EncryptDataHandler(Tcl_Interp *interp, int type, Tcl_Obj *dataObj, Tcl_Obj *cipherObj, |
︙ | |||
1030 1031 1032 1033 1034 1035 1036 | 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 | - + | out_buf = Tcl_SetByteArrayLength(resultObj, data_len+EVP_MAX_BLOCK_LENGTH); if (resultObj == NULL || out_buf == NULL) { Tcl_AppendResult(interp, "Memory allocation error", (char *) NULL); return TCL_ERROR; } /* Perform operation */ |
︙ | |||
1074 1075 1076 1077 1078 1079 1080 | 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | - + - + | * Side effects: * Encrypts or decrypts inFile data to outFile and sets result to * size of outFile, or an error message. * *------------------------------------------------------------------- */ int EncryptFileHandler(Tcl_Interp *interp, int type, Tcl_Obj *inFileObj, Tcl_Obj *outFileObj, |
︙ | |||
1159 1160 1161 1162 1163 1164 1165 | 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 | - + - + | return res; } /*******************************************************************/ static const char *command_opts [] = { "-chan", "-channel", "-cipher", "-command", "-data", "-digest", "-infile", "-filename", |
︙ | |||
1185 1186 1187 1188 1189 1190 1191 | 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 | - + - + | * *------------------------------------------------------------------- */ static int EncryptMain(int type, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *cipherObj = NULL, *cmdObj = NULL, *dataObj = NULL, *digestObj = NULL; Tcl_Obj *inFileObj = NULL, *outFileObj = NULL, *keyObj = NULL, *ivObj = NULL, *macObj = NULL; const char *channel = NULL, *opt; |
︙ | |||
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 | 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 | + + + - + - + - + - + | break; case _opt_key: keyObj = objv[idx]; break; case _opt_mac: macObj = objv[idx]; break; case _opt_padding: GET_OPT_BOOL(objv[idx], &padding); break; } } /* Check for required options */ if (cipherObj == NULL) { Tcl_AppendResult(interp, "No cipher", (char *) NULL); } else if (keyObj == NULL) { Tcl_AppendResult(interp, "No key", (char *) NULL); return TCL_ERROR; } /* Perform encryption function on file, stacked channel, using instance command, or data blob */ if (inFileObj != NULL && outFileObj != NULL) { |
︙ |
Added tests/test_vectors/Symetric_Block/AES-128-CBC.test version [65c5b321f9].
Added tests/test_vectors/Symetric_Block/AES-128-CFB.test version [7d24d887c8].
Added tests/test_vectors/Symetric_Block/AES-128-CFB1.test version [3bd696dc72].
Added tests/test_vectors/Symetric_Block/AES-128-CFB8.test version [6dc07bce40].
Added tests/test_vectors/Symetric_Block/AES-128-CTR.test version [edb0e884ff].
Added tests/test_vectors/Symetric_Block/AES-128-ECB.test version [d0e873f017].
Added tests/test_vectors/Symetric_Block/AES-128-OFB.test version [eac590d856].
Added tests/test_vectors/Symetric_Block/AES-192-CBC.test version [64074eee9c].
Added tests/test_vectors/Symetric_Block/AES-192-CFB.test version [01e591ca3c].
Added tests/test_vectors/Symetric_Block/AES-192-CFB1.test version [932dbfda2a].
Added tests/test_vectors/Symetric_Block/AES-192-CFB8.test version [738f1cb327].
Added tests/test_vectors/Symetric_Block/AES-192-CTR.test version [e9bd75d05d].
Added tests/test_vectors/Symetric_Block/AES-192-ECB.test version [86743a06c2].
Added tests/test_vectors/Symetric_Block/AES-192-OFB.test version [f40553a7c5].
Added tests/test_vectors/Symetric_Block/AES-256-CBC.test version [57c7756a8b].
Added tests/test_vectors/Symetric_Block/AES-256-CFB.test version [6ec5673682].
Added tests/test_vectors/Symetric_Block/AES-256-CFB1.test version [8cc2def4a3].
Added tests/test_vectors/Symetric_Block/AES-256-CFB8.test version [8f01a4d3af].
Added tests/test_vectors/Symetric_Block/AES-256-CTR.test version [3bfdcb10cf].
Added tests/test_vectors/Symetric_Block/AES-256-ECB.test version [c37f09ae87].
Added tests/test_vectors/Symetric_Block/AES-256-OFB.test version [4f13e8c331].
Added tests/test_vectors/Symetric_Block/make_test.tcl version [cec271042b].