Preheat the oven to 375° F, and place a baking sheet on the lowest rack, to catch any drips when the cake bakes. Put the sugar, unsweetened chocolate, butter and 1 cup of water in a saucepan. Place over medium heat and stir occasionally until all of the ingredients are melted and blended. Remove from the heat and let cool slightly.
Meanwhile, sift together the flour, baking soda, baking powder and salt. In a small bowl, stir together the milk and vinegar. Grease and flour two 9-inch round cake pans. (If you prefer, you can grease them, line it with parchment and then grease and flour it. This is not necessary, but parchment does make getting the cake out easier.)
When the chocolate in the pan has cooled a bit, whisk in the milk mixture and eggs. In several additions and without over-mixing, whisk in the dry ingredients. When the mixture is smooth, add the vanilla and whisk once or twice, to blend. Pour the batter into the pans and bake on the middle rack until a skewer inserted in the center comes out clean, about 20 minutes. Let the cakes cool completely, then remove from the pan and cool on a rack and proceed by making the buttercream.
For the buttercream:
Combine the cranberries, sugar, salt and 2/3 cup water in a saucepan and cook over medium heat for 5 to 7 minutes, stirring occasionally, until the cranberries slacken and release their juice, then start to thicken. Purée the mixture in a blender and cool completely. (You should have about 2 cups of cranberry purée.)
On medium speed, using electric beaters or a standing mixer fitted with the whisk attachment, beat the butter, egg yolks if using, confectioners' sugar and 1/4 cup cranberry purée for about 5 minutes, scraping down the bowl several times, until you have a fluffy, light pink icing. Do not worry if the icing curdles at first. Persevere, and it will all come together.
Level the 2 cooled cake layers with a serrated knife. Use about half the icing to fill between the layers of the cake and to apply a crumb coat. Chill the cake for 10 to 15 minutes, then finish icing. Refrigerate the cake until ready to serve.