-
Notifications
You must be signed in to change notification settings - Fork 19
HashPadding
Morard Dany edited this page Aug 16, 2018
·
1 revision
This padding algorithm is used by MD5, SHA2 and works as follow :
- Add a one bit at the end of the message
- Add as sequence of 0 until a block of 448-bits
- Write the size in bits of the message on 64 bits (l0 l1) e.g. 24 => 00000018 00000000
- HashPadding_Std uses the PaddingIO interface.
Core | Target | Performance | Aera | RAM |
---|---|---|---|---|
*_Std | Altera Cyclone V (C6) | - | - | - |
import spinal.crypto.padding.{HashPadding_Config, HashPadding_Std}
val config = HashPadding_Config(
dataInWidth = 32 bits ,
dataOutWidth = 512 bits,
endianess = LITTLE_endian
)
val padding = new HashPadding_Std(config)
padding.io.init := ...
padding.io.cmd <>
padding.io.rsp <>