1. A hash value calculation apparatus, which calculates a hash value of a message, comprising: an input unit configured to input an extended block obtained from a message to be processed; a hash value calculation unit configured to execute a hash value calculation of the input block and to output a hash intermediate value; a plurality of intermediate value storage units configured to store the hash intermediate value output by said hash value calculation unit for the message to be processed; an output unit configured to output a hash value obtained by executing the hash value calculation for blocks of the message to be processed; and a switching unit configured to switch said plurality of intermediate value storage units used to store the hash intermediate value output from said hash value calculation unit to control the hash value calculation for a plurality of messages, wherein a first intermediate value storage unit of the plurality of intermediate value storage units is used for calculating a hash value of a first message among the plurality of messages, and a second intermediate value storage unit is used for holding a hash intermediate value for a second message when calculating the hash value of the first message using the hash value calculation unit.