Soak dried chilies 15 minutes, then toast and blend with shallots, garlic, dried shrimp (if using) and tomatoes into a coarse paste.