Yes, you can carry it on. There is no prohibition against carrying chocolate.
You may want to declare it as food, but it is not something I usually consider food.
TSA may give it a glance on the xray because it may look like something they may think is a bomb, but it is not prohibited.