Constant-time scalar implementation