Move a modulo operation into the trusted function