Multi-IP-Based Soc Design Including CCM Security Mode of Operation
Total Page:16
File Type:pdf, Size:1020Kb
Master Thesis ICT/ECS-2006-71 Multi-IP-Based SoC Design Including CCM Security Mode of Operation By Solmaz Ghaznavi A thesis presented to the University of Waterloo and KTH University in the fulfillment of the thesis requirement for the degree of Master of Science in System on-Chip Design Waterloo, Ontario, Canada, 2006 © Solmaz Ghaznavi, 2006 Supervisor: Professor Cathy Gebotys Examiner: Professor Axel Jantsch I hereby declare that I am the sole author of this thesis. I authorize the University of Waterloo and KTH University to lend this thesis to other institutions or individuals for the purpose of scholarly research. I further authorize the University of Waterloo and KTH University to reproduce this thesis by photocopying or by other means, in total or in print, at the request of other institutions is individuals for the purpose of scholarly research. ii Abstract Embedding security in many mobile electronic devices is of great importance. With the emergence of powerful self-contained FPGAs which include microprocessors, memory etc. for SoC designs, it has shifted focus to these programmable platforms. A co-design approach can be used to optimize speed, area and power consumption by partitioning function onto the on-chip microprocessor and programmable logic blocks. FPGAs typically provide higher efficiency compared to software. On the other hand they offer more flexibility and much lower design and debug costs compared to specifically-built hardware. This thesis mainly implements CCM security mode of operation on a FPGA platform by using the AES encryption algorithm, it then builds a complete SoC that is based on multi IP cores including CCM. Except for the hard on-chip IP cores (i.e. microprocessors and memory), the device controllers, the PLB and OPB buses and CCM are all soft IP peripherals to build a complex system. The idea of building the elements as soft IP cores makes it very easy for further on-chip developments or modifications. The CCM core that sits on the same PLB bus at 80 MHz, can easily communicate with PowerPC or DDR SDRAM or BRAM controllers which are on the same bus. The implementation exploits iterative structure of AES to save the hardware resources; it implements the key expansion core as well. It also reports on the challenges and problems throughout the implementation. iii Acknowledgements I would like to thank my supervisor, Professor Cathy Gebotys, for all her advice, guidance and encouragement. I would like to acknowledge CMC (Canadian Microelectronics Corporation) support for using the AP1100 board. I would also like to thank my parents and my best friend Adela for their support. iv Table of Contents Abstract ......................................................................................................................................... iii List of Figures.............................................................................................................................. vii List of Tables............................................................................................................................... viii 1 Introduction............................................................................................................................... 1 1.1 Thesis Objective.................................................................................................................. 2 1.2 Security Algorithm Choice................................................................................................... 2 1.3 Thesis Overview.................................................................................................................. 3 2 Board and the FPGA Features ................................................................................................ 4 2.1 Board Architecture .............................................................................................................. 4 2.2 Configuration, Debugging and Power Connections............................................................ 6 2.3 FPGA Features ................................................................................................................... 7 2.3.1 Configurable Logic Blocks ........................................................................................... 8 2.3.2 Slice Description .......................................................................................................... 9 2.3.3 Memory Style ............................................................................................................. 10 2.3.3.1 Distributed SelectRAM+ ..................................................................................... 10 2.3.3.2 Block SelectRAM+.............................................................................................. 12 2.3.4 FPGA Clocking .......................................................................................................... 14 3 Security Standards................................................................................................................. 15 3.1 CCM .................................................................................................................................. 16 3.1.1 CCM Cryptographic Techniques................................................................................ 17 3.1.1.1 Counter Mode Encryption (CTR)........................................................................ 17 3.1.1.2 CBC-MAC........................................................................................................... 19 3.1.2 CCM Security Assurance........................................................................................... 21 3.2 Advanced Encryption Standard (AES).............................................................................. 21 3.2.1 AES Cipher ................................................................................................................ 22 3.2.2 Key Expansion........................................................................................................... 24 4 Design and Analysis of CCM in SoC .................................................................................... 26 4.1 Security Design Objective ................................................................................................. 26 4.2 High Level Design Architecture......................................................................................... 26 4.2.1 User Logic S/W Register Support.............................................................................. 28 4.2.2 Memory Map of PowerPC.......................................................................................... 29 4.3 CCM Implementation and Analysis................................................................................... 31 4.3.1 Key Expansion and Synthesis Analysis..................................................................... 31 4.3.2 Cipher Module and Synthesis Analysis ..................................................................... 33 4.3.3 Comparison with Previous Research......................................................................... 34 4.3.3.1 Microprocessor Implementation ......................................................................... 35 4.3.3.2 FPGA Implementation ........................................................................................ 36 4.3.3.2.1 AES Iterative Implementation ..................................................................... 36 4.3.3.2.2 AES Unrolled Implementation..................................................................... 37 4.3.4 Conclusion ................................................................................................................. 38 v 4.4 Testing and Debugging ..................................................................................................... 39 4.5 Software Tools and Some Practical Hints......................................................................... 40 5 Discussion and Conclusions ................................................................................................ 42 5.1 Summary ........................................................................................................................... 42 5.2 Limitations and Future Work ............................................................................................. 42 References ................................................................................................................................... 44 Appendix A: AES Cipher HDL Synthesis Report ..................................................................... 45 Appendix B: MixColumns HDL Synthesis Report.................................................................... 47 Appendix C: Key Expansion HDL Synthesis Report ............................................................... 48 Appendix D: S-box (AES Forward Cipher)................................................................................ 50 Appendix E: Test Vectors ........................................................................................................... 51 Appendix F: VHDL Codes ........................................................................................................... 53 vi List of Figures Figure 2-1. AP1100 Board Architecture .......................................................................................... 5 Figure 2-2. Virtex-II Pro CLB Element............................................................................................. 8 Figure 2-3.