Validate shared key length in client/server constructor