A Gorenstein criterion for strongly F-regular and log terminal singularities