Grind all the ingredients except oil into a smooth paste. Heat oil in a heavy-bottomed pan and fry the ground paste over medium heat until the oil separates from the mixture. Drain any excess oil and allow it to cool completely. Store in an airtight container and refrigerate.