OpenCores
Issue List
Hash not work correctly as SHA3-512 #3
Open NULL opened this issue about 2 years ago
NULL commented about 2 years ago

This implementation is correctly work Keccak-512 hash function.

If you want to update it to SHA3-512, you need to fix values in padder1.v component as:

case (byte_num) 0: out = 64'h0600000000000000; 1: out = {in63:56, 56'h06000000000000}; 2: out = {in63:48, 48'h060000000000}; 3: out = {in63:40, 40'h0600000000}; 4: out = {in63:32, 32'h06000000}; 5: out = {in63:24, 24'h060000}; 6: out = {in63:16, 16'h0600}; 7: out = {in63:8, 8'h06}; endcase

WHY?

NULL commented over 1 year ago

Thank you!

Marty

zeese5 commented about 2 months ago

Thank you. Similarly, for the low throughput version,

padder1.v is modified as follows, to get sha3-512 results.

always @ (*)
  case (byte_num)
    0: out = 32'h6000000;
    1: out = {in[31:24], 24'h060000};
    2: out = {in[31:16], 16'h0600};
    3: out = {in[31:8],   8'h06};
  endcase

Assignee
No one
Labels
Bug