資源簡介
aes加密算法的verilog和c++代碼

代碼片段和文件信息
//?Copyright?2007?Altera?Corporation.?All?rights?reserved.??
//?Altera?products?are?protected?under?numerous?U.S.?and?foreign?patents?
//?maskwork?rights?copyrights?and?other?intellectual?property?laws.??
//
//?This?reference?design?file?and?your?use?thereof?is?subject?to?and?governed
//?by?the?terms?and?conditions?of?the?applicable?Altera?Reference?Design?
//?License?Agreement?(either?as?signed?by?you?or?found?at?www.altera.com).??By
//?using?this?reference?design?file?you?indicate?your?acceptance?of?such?terms
//?and?conditions?between?you?and?Altera?Corporation.??In?the?event?that?you?do
//?not?agree?with?such?terms?and?conditions?you?may?not?use?the?reference?
//?design?file?and?please?promptly?destroy?any?copies?you?have?made.
//
//?This?reference?design?file?is?being?provided?on?an?“as-is“?basis?and?as?an?
//?accommodation?and?therefore?all?warranties?representations?or?guarantees?of?
//?any?kind?(whether?express?implied?or?statutory)?including?without?
//?limitation?warranties?of?merchantability?non-infringement?or?fitness?for
//?a?particular?purpose?are?specifically?disclaimed.??By?making?this?reference
//?design?file?available?Altera?expressly?does?not?recommend?suggest?or?
//?require?that?this?reference?design?file?be?used?in?combination?with?any?
//?other?product?not?provided?by?Altera.
/////////////////////////////////////////////////////////////////////////////
//?baeckler?-?03-07-2006
//??fill?in?rounds?and?constants?for?a?pipelined
//?Rijndael?with?128?bit?key?(AES128)
//
#include?
int?rconst[]?=?{0x10x20x40x80x100x200x400x800x1b0x36};
int?main(void)
{
int?round;
int?n?=?0;
fprintf?(stdout“//?baeckler?-?03-07-2006\n\n“);
fprintf?(stdout“//?pipelined?AES?/?aes?encrypt?and?decrypt?units\n\n“);
fprintf?(stdout“////////////////////////////////////\n“);
fprintf?(stdout“//?Encrypt?using?128?bit?key\n“);
fprintf?(stdout“////////////////////////////////////\n“);
fprintf?(stdout“module?aes_128?(clkclrdat_indat_outkeyinv_key);\n“);
fprintf?(stdout“input?clkclr;\n“);
fprintf?(stdout“input?[127:0]?dat_in;\n“);
fprintf?(stdout“input?[127:0]?key;\n“);
fprintf?(stdout“output?[127:0]?dat_out;\n“);
fprintf?(stdout“output?[127:0]?inv_key;\n\n“);
fprintf?(stdout“parameter?LATENCY?=?10;?//?currently?allowed?010\n“);
fprintf?(stdout“localparam?ROUND_LATENCY?=?(LATENCY?==?10???1?:?0);\n“);
fprintf?(stdout“wire?[127:0]?start1start2start3start4start5;\n“);
fprintf?(stdout“wire?[127:0]?start6start7start8start9start10;\n“);
fprintf?(stdout“wire?[127:0]?key1key2key3key4key5;\n“);
fprintf?(stdout“wire?[127:0]?key6key7key8key9key10;\n\n“);
fprintf?(stdout“assign?start1?=?dat_in?^?key;\n“);
fprintf?(stdout“assign?key1?=?key;\n\n“);
for?(round=1;?round<=10;?round++)
{
fprintf?(stdout“????aes_round_128?r%d?(\n“round);
fprintf?(stdout“????????.clk(clk).clr(clr)\n“);
fprintf?(stdout
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-06-16?05:18??aes\
?????文件????????5719??2009-01-06?03:51??aes\aes_128.cpp
?????文件????????7672??2009-01-06?03:51??aes\aes_128.v
?????文件????????4875??2009-01-06?03:51??aes\aes_128_tb.v
?????文件????????6229??2009-01-06?03:51??aes\aes_256.cpp
?????文件???????11075??2009-01-06?03:51??aes\aes_256.v
?????文件????????5833??2009-01-06?03:51??aes\aes_256_tb.v
?????文件????????4454??2009-01-06?03:51??aes\aes_round_128.v
?????文件????????4822??2009-01-06?03:51??aes\aes_round_256.v
?????文件????????9811??2009-01-06?03:51??aes\evolve_key.v
?????文件????????2547??2009-01-06?03:51??aes\evolve_key_256_tb.v
?????文件????????6108??2009-01-06?03:51??aes\mix_columns.v
?????文件????????2139??2009-01-06?03:51??aes\shift_rows.cpp
?????文件????????2323??2009-01-06?03:51??aes\shift_rows.v
?????文件???????10544??2009-01-06?03:51??aes\sub_bytes.cpp
?????文件???????17771??2009-01-06?03:51??aes\sub_bytes.v
- 上一篇:基于VC6.0的Bresenham直線算法
- 下一篇:C++1A2B猜數字游戲
評論
共有 條評論