Calculating power consumption by a cipher program
If any program is run it consumes some power. There is no way to programmatically calculate the power consumption for a given cryptographic primitive, because this not only depend on how you implemented said primitive but also on the hardware (mostly CPU) used. The best thing you can have is to measure the time it took to calculate the primitive.