- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A bit rotate is very common in cryptography. If you need to encrypt or decrypt data fast and you chose a method to be able to encrypt and/or decrypt data out of order. Which is the case for RC5, RC6, Serpent, and others with these methods ECB, CBC (decryption only), CFB (decryption only), and CTR/ICM/SIC. Also used in MD4, MD5, SHA-1, SHA-2 family.
Adding PROTD will save one register and two instructions:
SSE2: MOVDQA XMM1,XMM0 PSLLD XMM0,1 PSRLD XMM1,32-1 POR XMM0,XMM1 SSE5: PROTD XMM0,XMM0,1 AVX: VPSLLD XMM1,XMM0,1 VPSRLD XMM0,XMM0,32-1 POR XMM0,XMM0,XMM1
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A bit rotate is very common in cryptography. If you need to encrypt or decrypt data fast and you chose a method to be able to encrypt and/or decrypt data out of order. Which is the case for RC5, RC6, Serpent, and others with these methods ECB, CBC (decryption only), CFB (decryption only), and CTR/ICM/SIC. Also used in MD4, MD5, SHA-1, SHA-2 family.
Adding PROTD will save one register and two instructions:
SSE2: MOVDQA XMM1,XMM0 PSLLD XMM0,1 PSRLD XMM1,32-1 POR XMM0,XMM1 SSE5: PROTD XMM0,XMM0,1 AVX: VPSLLD XMM1,XMM0,1 VPSRLD XMM0,XMM0,32-1 POR XMM0,XMM0,XMM1
I agree but can you post the rest of your loop so we can figure out if the overall loop gets faster (+ by how much)?
Regards,
Mark Buxton
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree but can you post the rest of your loop so we can figure out if the overall loop gets faster (+ by how much)?
Regards,
Mark Buxton
It would also be interesting to have an instruction to extract Carry from each of the DWORDs.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page