fixed bytePad to prevent extra padding.
@@ -185,7 +185,7 @@ private void bytePad(byte[] X, int w)
int required = w - ((bytes.length + encX.length) % w);
- if (required > 0)
+ if (required > 0 && required != w)
{
while (required > padding.length)
{
