check bytes for pad value
| 1074 | |
| 1075 | // check bytes for pad value |
| 1076 | static int pad_check(const byte* input, byte pad, int len) |
| 1077 | { |
| 1078 | int good = 0; |
| 1079 | int bad = 0; |
| 1080 | |
| 1081 | for (int i = 0; i < len; i++) { |
| 1082 | if (input[i] == pad) |
| 1083 | good++; |
| 1084 | else |
| 1085 | bad++; |
| 1086 | } |
| 1087 | |
| 1088 | if (good == len) |
| 1089 | return 0; |
| 1090 | else |
| 1091 | return 0 - bad; // failure |
| 1092 | } |
| 1093 | |
| 1094 | |
| 1095 | // get number of compression rounds |