Heat oil in a heavy skillet, add spices and cook over medium heat 5 to 10 minutes, until golden brown, stirring constantly. Add garlic and gingerroot and cook 2 minutes more, then cool.
Put spice mixture in a blender or food processor fitted with the metal blade. Add almonds or cashew nuts and water; grind to a smooth paste. Cover tightly and keep in a cool place for up to 1 month.