On the Construction of Hardware-friendly 4X4 and 5X5 S-boxes