URL
https://opencores.org/ocsvn/gost28147-89/gost28147-89/trunk
Subversion Repositories gost28147-89
[/] [gost28147-89/] [trunk/] [doc/] [gost28147-89.tex] - Rev 5
Compare with Previous | Blame | View Log
\documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage{titlesec} \usepackage{tabularx} \usepackage{lastpage} \usepackage{tocloft} \usepackage[us]{datetime} \usepackage{hyperref} \hypersetup{colorlinks=true,linkcolor=black,urlcolor=blue} \usepackage[top=2.5cm, bottom=2.5cm, left=2.5cm, right=2cm]{geometry} \usepackage{fancyhdr} \pagestyle{fancy} \lhead{GOST 28147-89 Core, rev. \currentRevision} \rhead{\releaseDate} \cfoot{\thepage\ of \pageref{LastPage}} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} \renewcommand\cftsecdotsep{\cftdotsep} \newcommand{\currentRevision}{0.2} \newcommand{\releaseDate}{March 31, 2014} \begin{document} % Title \begin{titlepage} \begin{flushright} \vspace*{4cm} \Huge \textbf{GOST 28147-89}\\IP Core \vspace{4cm} \large Author: Kirill Fomichev\\ \textsl{fanatid@ya.ru} \vspace{4cm} \textbf{Revision \currentRevision\\\releaseDate} \end{flushright} \end{titlepage} % Revision history \begin{flushright} \Large \textbf{Revision History} \normalsize \end{flushright} \begin{flushleft} {\renewcommand{\arraystretch}{1.5} \begin{tabularx}{\textwidth}{|l|l|l|X|} \hline \textbf{Rev.} & \textbf{Date} & \textbf{Author} & \textbf{Description}\\ \hline 0.1 & March 10, 2014 & Kirill Fomichev & Initial Release\\ \hline 0.2 & March 31, 2014 & Kirill Fomichev & Add bidirectional ECB and CFB modules\\ \hline \end{tabularx}} \end{flushleft} % Contents \newpage \tableofcontents % Introduction \newpage \section{Introduction} \subsection{About GOST 28147-89} \paragraph{} The \textsl{GOST block cipher}, defined in standard \textsl{GOST 28147-89}, is a Soviet and Russian government standard symmetric key block cipher. Developed in the 1970s, the standard has been marked "Top Secret" and the downgraded to "Secret" in 1990. Shortly after the dissolution of the USSR, it was declassified and it was released to the public in 1994. \paragraph{} GOST have a 64-bit block size and a key length of 256 bits. It's S-Boxes can be secret, and they contain about 354($log_2(16!^8)$) bits of secret information, so the effective key size can be increased to 610 bits; however, a chosen-key attack can recover the contents of the S-Boxes in approximately $2^{32}$ encryptions. \subsection{This roject} \paragraph{} This project has implements \textsl{GOST block cipher} in three modes: electronic codebook (ECB), cipher feedback (CFB) and message authentication code (MAC). \paragraph{} All files licensed under \textsl{BSD license}. % Interface \newpage \section{Interface} \paragraph{} ECB mode\\ {\renewcommand{\arraystretch}{1.2} \begin{tabularx}{\textwidth}{l|l l X} \hline Signal name & Width & In/Out & Description\\ \hline \textsl{clk} & 1 & In & Clock\\ \textsl{reset} & 1 & In & Terminate current encryption/decryption process \\ \textsl{mode} & 1 & In & Decryption when mode equal 1, otherwise encryption\\ \textsl{load\_data} & 1 & In & Start of encryption/decryption \\ \textsl{sbox} & 512 & In & S-Box \\ \textsl{key} & 256 & In & Key \\ \textsl{in} & 64 & In & Plain text/Cipher text \\ \textsl{out} & 64 & Out & Cipher text/Plain text. Results available after 34 clock cycles. \\ \textsl{busy} & 1 & Out & Status flag, triggered to zero after finished encryption/decryption \\ \hline \end{tabularx}} \paragraph{} ECB mode with pipeline\\ {\renewcommand{\arraystretch}{1.2} \begin{tabularx}{\textwidth}{l|l l X} \hline Signal name & Width & In/Out & Description\\ \hline \textsl{clk} & 1 & In & Clock\\ \textsl{sbox} & 512 & In & S-Box \\ \textsl{key} & 256 & In & Key \\ \textsl{in} & 64 & In & Plain text/Cipher text \\ \textsl{out} & 64 & Out & Cipher text/Plain text. Results available after 32 clock cycles. \\ \hline \end{tabularx}} \paragraph{} CFB mode\\ {\renewcommand{\arraystretch}{1.2} \begin{tabularx}{\textwidth}{l|l l X} \hline Signal name & Width & In/Out & Description\\ \hline \textsl{clk} & 1 & In & Clock\\ \textsl{reset} & 1 & In & Terminate current encryption/decryption process and load gamma from \textsl{in} \\ \textsl{mode} & 1 & In & Decryption when mode equal 1, otherwise encryption\\ \textsl{load\_data} & 1 & In & Start of encryption/decryption \\ \textsl{sbox} & 512 & In & S-Box \\ \textsl{key} & 256 & In & Key \\ \textsl{in} & 64 & In & Gamma/Plain text/Cipher text \\ \textsl{out} & 64 & Out & Cipher text/Plain text. Results available after 35 clock cycles. \\ \textsl{busy} & 1 & Out & Status flag, triggered to zero after finished encryption/decryption \\ \hline \end{tabularx}} \paragraph{} MAC mode\\ {\renewcommand{\arraystretch}{1.2} \begin{tabularx}{\textwidth}{l|l l X} \hline Signal name & Width & In/Out & Description\\ \hline \textsl{clk} & 1 & In & Clock\\ \textsl{reset} & 1 & In & Drop current mac \\ \textsl{load\_data} & 1 & In & Start calculate mac \\ \textsl{sbox} & 512 & In & S-Box \\ \textsl{key} & 256 & In & Key \\ \textsl{in} & 64 & In & Plain text \\ \textsl{out} & 32 & Out & MAC, available after 18 clock cycles. \\ \textsl{busy} & 1 & Out & Status flag, triggered to zero after finished processing\\ \hline \end{tabularx}} % Testbench \newpage \section{Testbench} \paragraph{} Makefile run simulation using \href{http://iverilog.icarus.com/}{Icarus Verilog} in testbench folder. You can see simulation results in \href{http://gtkwave.sourceforge.net/}{GTKWave}. \begin{flushleft} {\renewcommand{\arraystretch}{1.5} \begin{tabularx}{\textwidth}{l|X} \hline \textsl{File name} & \textsl{The module being tested}\\ \hline gost89\_ecb\_tb.v & ECB encryption and decryption\\ \hline gost89\_pipelined\_ecb\_tb.v & Pipelined ECB encryption and decryption\\ \hline gost89\_cfb\_tb.v & CFB encryption and decryption\\ \hline gost89\_mac\_tb.v & MAC mode\\ \hline \end{tabularx}} \end{flushleft} % References \newpage \section{References} \begin{enumerate} \item GOST block cipher,\\ \url{http://en.wikipedia.org/wiki/GOST_(block_cipher)} \item RFC 4357: Additional Cryptographic Algorithms for Use with GOST\\ \url{http://tools.ietf.org/html/rfc4357} \item RFC 5830: GOST 28147-89 encryption, decryption and MAC algorithms\\ \url{http://tools.ietf.org/html/rfc5830} \item Schneier, Bruce (1996). Applied cryptography: protocols, algorithms, and source code in C \end{enumerate} \end{document}