Change algorithm signature. Mirror functionality for second domain.