Fixed verifyPubKey method to check the length of signed public key

The issue before was that the verifyPubKey method would have a negative
array index error and crash if the signed public key provided was smaller
than the actual signature size.