www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Adding pclmulqdq assembly instruction to dlang asm.

reply "\u2603" <snowman nomail.com> writes:
pclmulqdq is an assembly instruction on Intel CPUs that has been
introduced together with the AES instructions. pclmulqdq provides
multiplication on binary fields and is very usefull for
implementing fast and timing attack resistant cryptographic
algorithms (e.g. GCM). The D asm supports all AES instructions
but not pclmulqdq. How can I add support for this instruction?
Could I write a patch myself? Compiler development is unknown
land to me and I'd be very glad to get some help!
Jun 13 2015
next sibling parent "nhk8" <nhk8 sdfsdf.pl> writes:
On Saturday, 13 June 2015 at 19:48:07 UTC, \u2603 wrote:
 pclmulqdq is an assembly instruction on Intel CPUs that has been
 introduced together with the AES instructions. pclmulqdq 
 provides
 multiplication on binary fields and is very usefull for
 implementing fast and timing attack resistant cryptographic
 algorithms (e.g. GCM). The D asm supports all AES instructions
 but not pclmulqdq. How can I add support for this instruction?
 Could I write a patch myself? Compiler development is unknown
 land to me and I'd be very glad to get some help!
waiting for its support as inline asm opcode you can still use the instruction by writing it directly as bytecode: --- asm{ db 0x66; db 0x0f; db 0x3a; db 0x44; } --- expect that the regs arguments might be a somehow tricky to write...but still faisable.
Jun 13 2015
prev sibling next sibling parent reply "Etienne Cimon" <etcimon gmail.com> writes:
On Saturday, 13 June 2015 at 19:48:07 UTC, \u2603 wrote:
 pclmulqdq is an assembly instruction on Intel CPUs that has been
 introduced together with the AES instructions. pclmulqdq 
 provides
 multiplication on binary fields and is very usefull for
 implementing fast and timing attack resistant cryptographic
 algorithms (e.g. GCM). The D asm supports all AES instructions
 but not pclmulqdq. How can I add support for this instruction?
 Could I write a patch myself? Compiler development is unknown
 land to me and I'd be very glad to get some help!
You mean like this? https://github.com/etcimon/botan/blob/master/source/botan/modes/aead/gcm.d#L437
Jun 13 2015
parent "\u2603" <snowman nomail.org> writes:
Thanks! Directly using opcodes does the trick.
Jun 14 2015
prev sibling parent "Brian Schott" <briancschott gmail.com> writes:
https://issues.dlang.org/show_bug.cgi?id=14697
Jun 14 2015