hashcat Forum
function write in C - Printable Version

+- hashcat Forum (https://hashcat.net/forum)
+-- Forum: Developer (https://hashcat.net/forum/forum-39.html)
+--- Forum: hashcat (https://hashcat.net/forum/forum-40.html)
+--- Thread: function write in C (/thread-10487.html)



function write in C - hellohihi - 11-30-2021


  1. Can someone tell me how to write the following function(in inc_common.cl)
  1. DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const int c)
  1. with C language
  1. DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const int c)
  1. {
  1.     u32 r = 0;
  1.     asm volatile ("V_PERM_B32 %0, %1, %2, %3;" : "=v"(r) : "v"(b), "v"(a), "v"(c));
  1.     return r;
  1. }
  1. DECLSPEC u32 hc_byte_perm_S (const u32 a, const u32 b, const int c)
  1. {
  1.     u32 r = 0;
  1.     asm volatile ("prmt.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c));
  1.     return r;
  1. }
  1. I not familiar with GPU asm