赞
踩
32 bit hash计算 (使用function函数)
function [31:0] hash_func;
input [31:0] r;
input [95:0] k;
input [63:0] b;
reg [31:0] result;
reg [95:0] key;
integer j;
begin
key = k;
result = r;
for(j = 0; j < 64; j = j + 1) begin
if(b[63-j] == 1'b1)
result = result ^ key[95:64];
key = {key[94:0],1'b0};
end
hash_func = result;
end
endfunctiom
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。