Shimano uses two crank bolt sizes and they are dramatically different in diameter. The older square taper bottom brackets all use 8mm x 1.0 mm bolts. Newer splined cranks (Octalink) use a 15 mm diameter bolt in the hollow axle. There is no mistaking one for the other.
If the bolts you have look anything alike and come even close to looking like they match the holes, they are the same.