speed improvements for SecretBuffer