key size calculation fix