OpenCores
URL https://opencores.org/ocsvn/present/present/trunk

Subversion Repositories present

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /present
    from Rev 13 to Rev 14
    Reverse comparison

Rev 13 → Rev 14

/trunk/Pure/doc/present_pure.pdf Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
trunk/Pure/doc/present_pure.pdf Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/Pure/doc/src/gajewski.cls =================================================================== --- trunk/Pure/doc/src/gajewski.cls (nonexistent) +++ trunk/Pure/doc/src/gajewski.cls (revision 14) @@ -0,0 +1,196 @@ +%partly based on ruschidoc.cls file from Avalon AES ECB-Core project +\ProvidesClass{gajewski} +\LoadClass[11pt,a4paper,twoside]{article} +\RequirePackage[intlimits,sumlimits]{amsmath} +\RequirePackage{fancyhdr} +\RequirePackage[T1]{fontenc} +\RequirePackage[latin1]{inputenc} +\RequirePackage{amsmath} +\RequirePackage{helvet} +\RequirePackage{lastpage} +\RequirePackage{tabularx} +\RequirePackage{textcomp} +\RequirePackage{graphicx} +\RequirePackage{graphics} +\RequirePackage[bookmarks, plainpages={false}]{hyperref} +\RequirePackage{capt-of} +\graphicspath{{img/}} + +% ************************ Page layout ************************ +\topmargin -20mm +\headheight 30mm +\headsep 6mm +\footskip 11mm +\oddsidemargin 2mm +\evensidemargin 2mm +\marginparsep 145mm +\marginparwidth 8mm +\textwidth 162mm +\textheight 225mm +\parindent 0mm +\parskip 3mm + +% Section and subsection are de-idented (text body is idented) +\def\@secindent{8mm} +% how wide is the header +\def\@htwidth{172mm} + +%% Change the font +\renewcommand{\familydefault}{\sfdefault} +%% Make Registered Trademark symbol raised +\newcommand{\tm}{\textsuperscript{\texttrademark}} +\newcommand{\rtm}{\textsuperscript{\textregistered}} +\renewcommand{\copyright}{\textcopyright} + +\renewcommand{\paragraph}[1]{\newpar{#1}\ \vspace{0.3cm}\\} + +\renewcommand{\section}{\@startsection +{section}% % the name +{1}% % the level +{-\@secindent}% % the indent +{-18pt}% +{6pt}% % the after skip +{\huge\bf}} % the style + +\renewcommand{\subsection}{\@startsection +{subsection}% % the name +{1}% % the level +{-\@secindent}% % the indent +{-6pt}% +{6pt}% % the after skip +{\large\bf}} % the style + +\renewcommand{\subsubsection}{\@startsection +{subsubsection}% % the name +{1}% % the level +{-\@secindent}% % the indent +{-6pt}% +{6pt}% % the after skip +{\bf}} % the style + +% ************************ Date format ************************ +\def\shorttoday{\ifcase\month\or + Jan\or Feb\or Mar\or Apr\or May\or Jun\or Jul\or Aug\or + Sep\or Oct\or Nov\or Dec\fi~\number\day, \number\year} + +\def\shorttoday{\number\day-\ifcase\month\or + Jan\or Feb\or Mar\or Apr\or May\or Jun\or Jul\or Aug\or + Sep\or Oct\or Nov\or Dec\fi-\number\year} + +\newcommand{\paddedday}{\ifnum\number\day<10 0\number\day\else \number\day\fi} +\newcommand{\paddedmonth}{\ifnum\number\month<10 0\number\month\else \number\month\fi} + +\def\shorttoday{\number\year/\paddedmonth/\paddedday} + +% ************************ Document Variables ************************ +% main author +\newcommand*{\authorName}[1]{\def\@authorName{#1}} +\authorName{} +% Additional Authors +\newcommand*{\authorAddress}[1]{\def\@authorAddress{#1}} +\authorAddress{} +\newcommand*{\authorURL}[1]{\def\@authorURL{#1}} +\authorURL{} +\newcommand*{\authorEmail}[1]{\def\@authorEmail{#1}} +\authorEmail{} +% When was the document written/submitted (not compiled) +\newcommand*{\docDate}[1]{\def\@docDate{#1}} +\docDate{} +% unique identifier +\newcommand*{\docID}[1]{\def\@docID{#1}} +\docID{} +% type of document +\newcommand*{\docType}[1]{\def\@docType{#1}} +\docType{Technical Note} +% Title of the document +\newcommand*{\docTitle}[1]{\def\@docTitle{#1}} +\docTitle{} +% Title of the document +\newcommand*{\docSubtitle}[1]{\def\@docSubtitle{#1}} +\docSubtitle{} +% current revision +\newcommand*{\docRevision}[1]{\def\@docRevision{#1}} +\docRevision{0.1} +% Status Draft/revision/ final +\newcommand*{\docStatus}[1]{\def\@docStatus{#1}} +\docStatus{Draft} +% Who will receive the doc -- differnece to customers??? +\newcommand*{\recipientList}[1]{\def\@recipientList{#1}} +% list of keywords +\newcommand*{\keywords}[1]{\def\@keywords{#1}} +\keywords{} +% list of revisions +\newcommand*{\revisionList}[1]{\def\@revisionList{#1}} +\revisionList{} + +% ************************ Header/footer ************************ +\def\@secindent{8mm} + +\pagestyle{fancy} +\renewcommand{\headrulewidth}{0.4pt} +\renewcommand{\footrulewidth}{0.4pt} + +\fancyhead[O,E]{ + \leftskip-\@secindent + \begin{tabularx}{185mm}{p{98mm} p{45mm} p{25mm}} + \hskip2mm \sc{ \@docTitle } & & \hskip2mm \thepage / \pageref{LastPage} + \end{tabularx} +} + + \fancyfoot{} + \fancyfoot[ER,OL]{ + \tiny{All rights reserved - \copyright \number\year \ \@authorName} + } + \fancyfoot[EL,OR]{ + \tiny{\@docID \ (v. \@docRevision) - \@\shorttoday} + } + +\fancypagestyle{plain}{ + \renewcommand{\headrulewidth}{0.0pt} + \renewcommand{\footrulewidth}{0.0pt} + \fancyhead{} + \fancyfoot[EL,OL]{} + \renewcommand{\headrulewidth}{0pt} + } + +% ************************ Revision table ********************* +\newcommand{ \revisionTable } { + \section*{Change History} + \begin{tabularx}{\textwidth} {| p{11mm} | p{14mm} | p{23mm} | X | p{32mm} |} + \hline + Rev. & Chapter & Date & Description & Reviewer \\ + \hline + \@revisionList + \hline + \end{tabularx} +} + +% ************************ Cover table ************************ +\def\@maketitle{ + \vglue40mm + %% Title + \begin{minipage}{0.65\linewidth} + \begin{flushleft} + \Huge{\textbf{\sc{\@docTitle}}} \\ + \LARGE{documentation} + \end{flushleft} + \end{minipage} +%% fancy line + \vskip4pt + \leftskip-17mm + \vspace{3pt} +%% addes5mm + \vglue95mm + \begin{tabularx}{\textwidth}{p{55mm} X p{65mm}} + \begin{minipage}{60mm} + \includegraphics[width=0.3\textwidth]{logo.png} + \end{minipage} & & + \begin{minipage}{62mm} + \Large{\@authorName} \\ + \large{\@authorAddress} + \end{minipage} \\ + & & \\ + \large{\@authorURL} & & \large{\@authorEmail} \\ + \end{tabularx} + \vspace{2ex} +} %% End of maketitle Index: trunk/Pure/doc/src/bibliography.bib =================================================================== --- trunk/Pure/doc/src/bibliography.bib (nonexistent) +++ trunk/Pure/doc/src/bibliography.bib (revision 14) @@ -0,0 +1,34 @@ +@ONLINE{Spartan, +author = {Xilinx}, +title = {Spartan-3E FPGA Family Data Sheet}, +day = 14, +month = feb, +year = {2014}, +url = {http://www.xilinx.com/support/documentation/data_sheets/ds312.pdf} +} + +@ONLINE{Digilent, +author = {Digilent}, +title = {Spartan 3E Starter Board}, +day = 14, +month = feb, +year = {2014}, +url = {http://www.digilentinc.com/Products/Detail.cfm?Prod=S3EBOARD} +} + +@incollection{PRESENT, +year={2007}, +isbn={978-3-540-74734-5}, +booktitle={Cryptographic Hardware and Embedded Systems - CHES 2007}, +volume={4727}, +series={Lecture Notes in Computer Science}, +editor={Paillier, Pascal and Verbauwhede, Ingrid}, +doi={10.1007/978-3-540-74735-2_31}, +title={PRESENT: An Ultra-Lightweight Block Cipher}, +url={http://dx.doi.org/10.1007/978-3-540-74735-2_31}, +publisher={Springer Berlin Heidelberg}, +author={Bogdanov, A. and Knudsen, L.R. and Leander, G. and Paar, C. and Poschmann, A. and Robshaw, M.J.B. and Seurin, Y. and Vikkelsoe, C.}, +pages={450-466} +} + + Index: trunk/Pure/doc/src/present_pure.tex =================================================================== --- trunk/Pure/doc/src/present_pure.tex (nonexistent) +++ trunk/Pure/doc/src/present_pure.tex (revision 14) @@ -0,0 +1,205 @@ +\documentclass{gajewski} + +\bibliographystyle{IEEEtran} + +%%%%%%%%%%%%%%%%% +% Document variables +%%%%%%%%%%%%%%%%% +\docDate{ \today } +\docID{Present cipher} +\docRevision{0.1} +\docStatus{Draft} +\docTitle{\mbox{Present Cipher}} +\authorName{\mbox{Krzysztof Gajewski} \\ and opencores.org} +\authorURL{www.opencores.org} +\authorAddress{\mbox{}} +\authorEmail{gajos@opencores.org} + +\revisionList{ +0.1 & all & 2014/02/01 & First draft & K. Gajewski \\ +} + +\begin{document} + +\maketitle + +\newpage + +\revisionTable + +\newpage + +\tableofcontents +\newpage + +\section{Introduction} + +Present is \textgravedbl ultra-lightweight\textacutedbl \space block cipher developed by A. Bogdanov et al. and proposed in 2007 \cite{PRESENT}. It uses 64 bit data block and 80 bit or 128 bit key. +This cipher consists of 32 rounds, during which: +\begin{itemize} + \item round key is added to plaintext + \item plaintext goues through sBoxes (substitution boxes) + \item plaintext after sBoxes goes through pLayer (permutation layer) + \item round key is updated +\end{itemize} +After that, ciphertext feeds out the output. Briefly algorithm was shown in Fig. \ref{pAlgorithm} +\begin{figure}[!ht]% + \begin{center} + \includegraphics[width=0.66\textwidth]{img/presentAlgorithm.png} + \caption{% + Briefly block scheme of the PRESENT block cipher + }% + \label{pAlgorithm} + \end{center} + \end{figure} +In this project Present block cipher works with 80 bit key. Target was Xilinx\textsuperscript{\textregistered} Spartan 3E XC3S500E \cite{Spartan} on Spartan 3E Starter Board \cite{Digilent} made by Digilent\textsuperscript{\textregistered}. + +\newpage + +\section{Interface} + +Top level component of present was shown in Fig. \ref{penc}. All inputs and outputs are synchronous except \texttt{reset} signal and sampled at rising edge of the clock. Type for all signals is \texttt{STD\_LOGIC} or \texttt{STD\_LOGIC\_VECTOR}. +\begin{figure}[!ht]% + \begin{center} + \includegraphics[width=0.5\textwidth]{img/PresentEnc.png} + \caption{% + Top level component of Present component + }% + \label{penc} + \end{center} + \end{figure} + +\begin{tabularx}{\textwidth}{|p{30mm}|p{11mm}|p{11mm}|X|} + \hline \bf{Signal name} & \bf{Width} & \bf{In/Out} & \bf{Description}\\ + \hline \texttt{key} & 80 & in & secret key used for input data encoding. \\ + \hline \texttt{plaintext} & 64 & in & input data which have to be encoded. \\ + \hline \texttt{clk} & 1 & in & clock signal for the component\\ + \hline \texttt{reset} & 1 & in & \emph{Asynchronous} reset signal. \\ + \hline \texttt{start} & 1 & in & signal which starts encoding process. \\ + \hline \texttt{ciphertext} & 64 & out & encoded text output. \\ + \hline \texttt{ready} & 1 & out & signal informing about end of encoding process. \newline "0" - wait until end of data encoding. \newline "1" - data at the \texttt{ciphertext} output are valid, you can read them. \\ + \hline +\end{tabularx} +\captionof{table}{Input/Output signals of Present component} + +\newpage + +\section{State machine workflow} + +Overall internal structure of Present component is similar to the structure shown in \cite{PRESENT}. Suitable control logic was added in state machine added +to the core. It was shown in Fig. \ref{presentSM}. + +\begin{figure}[!ht]% + \begin{center} + \includegraphics[width=0.5\textwidth]{img/SM.jpg} + \caption{% + State machine of the Present component + }% + \label{presentSM} + \end{center} + \end{figure} + +State machine consist of three states \texttt{NOP}, \texttt{SM\_START} and \texttt{READY}. Some control signal of used multiplexers, registers and counter was omitted. \texttt{NOP} is default state after resetting the core. This state is active as long as \texttt{START} = '0'. + +When \texttt{START} = '1' encoding process starts. Proper \texttt{key} and \texttt{plaintext} must fed the input before start encoding. \texttt{SM\_START} state is active as long as \texttt{START} = '1'. Change of this signal to '0' automatically stops encoding process. + +After 32 clock cycles (counter reach \texttt{'11111'} value), when encoding process is ended, state machine automatically change its state to \texttt{READY}. This informs user by setting \texttt{READY} output to '1'. Then \texttt{ciphertext} output contains proper data, which can be readed by user. This state are active as long as \texttt{START} = '1'. Change this signal to '0', change state machine to \texttt{NOP} state. Core is ready for next data encoding. + +\newpage + +\section{FPGA implementations} + +The component has only been verified on a Xilinx\textsuperscript{\textregistered} Spartan 3E XC3S500E FPGA in FG320 package and synthesized with Xilinx ISE 14.2. Appropriate setup files was prepared with use of ISE Project Navigator, but Makefile scripts was also written. Suitable files was stored in \texttt{./Pure/syn/XC3ES500/} directory. +Implementation in FPGA device was done in another subproject called \texttt{PureTesting}. +Makefile was tested in Windows 8 with use of Cygwin for 64-bit Windows. + +Synthesis results was given in Fig. \ref{SynResults} + +\begin{tabularx}{\textwidth}{|p{45mm}|p{30mm}|p{30mm}|X|} + \hline \multicolumn{4}{|c|}{Xilinx \textregistered Spartan 3E XC3S500E FPGA in FG320 package} \\ + \hline \bf{Parameter} & \bf{Used} & \bf{Available} & \bf{Utilization}\\ + \hline Number of Slices & 248 & 4656 & 5\% \\ + \hline Number of Slice Flip Flops & 151 & 9312 & 1\% \\ + \hline Number of 4 input LUTs & 296 & 9312 & 3\% \\ + \hline Number of bonded IOBs & 212 & 232 & 91\% \\ + \hline Number of GCLKs & 1 & 24 & 4\%\\ + \hline Minimum period & 5.035ns & - & - \\ + \hline Maximum Frequency & 198 MHz & - & - \\ + \hline +\end{tabularx} +\label{SynResults} +\captionof{table}{Synthesis results for Spartan 3E XC3S500E} + +Possible change in used FPGA device may be possible in steps given below\footnotemark[1]: +\begin{enumerate} + \item Copy \texttt{./Pure/syn/XC3ES500/} directory to another one like \texttt{./Pure/syn/YOUR\_FPGA\_SYMBOL/} + \item Go to \texttt{./Pure/syn/XC3ES500/} directory. + \item In \texttt{PresentEnc.xst} file modify the line \texttt{-p xc3s500e-5-fg320} to \texttt{-p YOUR\_FPGA\_SYMBOL} + \item In \texttt{Makefile} file modify the line \texttt{PLATFORM=xc3s500e-fg320-5} to \texttt{PLATFORM=YOUR\_FPGA\_SYMBOL} +\end{enumerate} + +\footnotetext[1]{This solution was not tested and is based on my own observations. Additional care should be taken with *.UCF files. You can make this modifications on your own risk} + + +\newpage + +\section{Simulation} + +Self-checking test bench were provided to the components used for Present encoder. They are stored in \texttt{./Pure/bench/vhdl} directory. Suitable configuration files and Makefile used for running test bench was stored in +\texttt{.Pure/sim/rtl\_sim/bin} directory. Appropriate test vectors was taken from \cite{PRESENT}. + +Makefile was prepared to make "manual run" of tests. If You want to perform it without gui, remove \texttt{-gui} option in Makefaile. + +\newpage + +\section{Troubleshooting} + +During work with Windows 8 64-bit and and Xilinx\textsuperscript{\textregistered} ISE 64-bit some problems may occur: + +\begin{enumerate} + \item Xilinx may be unable to open projects in Project Navigator. + \item When you run \texttt{make} in Cygwin and perform testbench it would be unable to open ISIM gui. + \item When you run ISIM gui (*.exe test bench file) it hangs out or anti virus protection opens. +\end{enumerate} + +To solve problems listed above you have to perform steps listed below: +\begin{enumerate} + \item You have to rename libraries \texttt{libPortabilityNOSH.dll} to \texttt{libPortability.dll} from \texttt{nt64} directories (\href{http://www.gadgetfactory.net/2013/09/having-problems-installing-xilinx-ise-on-windows-8-64bit-here-is-a-fix-video-included/}{http://www.gadgetfactory.net/2013/09/having-problems-installing-xilinx-ise-on-windows-8-64bit-here-is-a-fix-video-included/}) + \item Firstly, install Cygwin X11 (\href{http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows}{http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows}) + \item Temporary switch off anti virus protection. +\end{enumerate} + +\newpage + +\section{License and Liability} + +Copyright \textcopyright 2013 Authors and OPENCORES.ORG + +This source file may be used and distributed without +restriction provided that this copyright statement is not +removed from the file and that any derivative work contains +the original copyright notice and the associated disclaimer. + +This source file is free software; you can redistribute it +and-or modify it under the terms of the GNU Lesser General +Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any +later version. + +This source is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied +warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General +Public License along with this source; if not, download it +from \href{http://www.opencores.org/lgpl.shtml}{http://www.opencores.org/lgpl.shtml} + +Xilinx, Spartan3E is registered trademark of Xilinx Inc. 2100 Logic Drive, San Jose CA USA + +\newpage + +\bibliography{bibliography} + +\end{document} Index: trunk/Pure/doc/src/img/logo.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/Pure/doc/src/img/logo.jpg =================================================================== --- trunk/Pure/doc/src/img/logo.jpg (nonexistent) +++ trunk/Pure/doc/src/img/logo.jpg (revision 14)
trunk/Pure/doc/src/img/logo.jpg Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/Pure/doc/src/img/logo.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/Pure/doc/src/img/logo.png =================================================================== --- trunk/Pure/doc/src/img/logo.png (nonexistent) +++ trunk/Pure/doc/src/img/logo.png (revision 14)
trunk/Pure/doc/src/img/logo.png Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/Pure/doc/src/img/PresentEnc.svg =================================================================== --- trunk/Pure/doc/src/img/PresentEnc.svg (nonexistent) +++ trunk/Pure/doc/src/img/PresentEnc.svg (revision 14) @@ -0,0 +1,192 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + PresentEnc + key (79:0) + plaintext (63:0) + clk + reset + start + ciphertext (63:0) + ready + + Index: trunk/Pure/doc/src/img/presentAlgorithm.svg =================================================================== --- trunk/Pure/doc/src/img/presentAlgorithm.svg (nonexistent) +++ trunk/Pure/doc/src/img/presentAlgorithm.svg (revision 14) @@ -0,0 +1,532 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + sBox Layer + sBox Layer + pLayer + pLayer + plaintext + ciphertext + + + + + + + + ... + key register + update + update + + + + + ... + + + + + + + add round key + add round key + 31 times + + Index: trunk/Pure/doc/src/img/PresentEnc.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/Pure/doc/src/img/PresentEnc.png =================================================================== --- trunk/Pure/doc/src/img/PresentEnc.png (nonexistent) +++ trunk/Pure/doc/src/img/PresentEnc.png (revision 14)
trunk/Pure/doc/src/img/PresentEnc.png Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/Pure/doc/src/img/presentAlgorithm.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/Pure/doc/src/img/presentAlgorithm.png =================================================================== --- trunk/Pure/doc/src/img/presentAlgorithm.png (nonexistent) +++ trunk/Pure/doc/src/img/presentAlgorithm.png (revision 14)
trunk/Pure/doc/src/img/presentAlgorithm.png Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/Pure/doc/src/img/SM.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/Pure/doc/src/img/SM.jpg =================================================================== --- trunk/Pure/doc/src/img/SM.jpg (nonexistent) +++ trunk/Pure/doc/src/img/SM.jpg (revision 14)
trunk/Pure/doc/src/img/SM.jpg Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/Pure/doc/src/img =================================================================== --- trunk/Pure/doc/src/img (nonexistent) +++ trunk/Pure/doc/src/img (revision 14)
trunk/Pure/doc/src/img Property changes : Added: bugtraq:number ## -0,0 +1 ## +true \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.