A semiconductor device is composed of a first IC chip having a data
processing function and a second IC chip having a non-volatile memory for
storing confidential reference data. Both of the IC chips are provided
with connection pads on the facing sides of the two chips, so that they
can be bonded in a chip-on-chip configuration. Each of the connection
pads of the second IC chip is located at the position of a corresponding
connection pad of the first IC chip. An externally input data is compared
with the reference data for verification. The input data is authenticated
based on the result of the verification.