// File: /workspace/github_cpp_makefile_star2_O3/DiplIngFrankGerlach[P]MST/SampleAndTesting.cpp
// Function: main
int main()
{
   char plaintext[32];  

   strcpy(plaintext,"1123456789012345678901234567890");

   uint8_t hash[16];   
   DM_Hash::hash((uint8_t*) plaintext,32,hash);

   Util::dumpHex(hash,16); 

   char testInput[100];
   strcpy(testInput,"helloWorld");


   uint8_t* authPlaintext(NULL);
   uint32_t length(0);
   Util::dumpHex((uint8_t*)testInput,strlen(testInput));
   MST_Hash mstHash;
   if(mstHash.createAuthPlaintext( (uint8_t*)testInput,strlen(testInput)+1,&authPlaintext,&length) )
   {
      Util::dumpHex(authPlaintext,length);
   }
   else cout << "failure" << endl;

   uint8_t* plaintextBack;  
   uint32_t lengthPT;
   if( mstHash.checkAndExtractPlaintext(authPlaintext, length,&plaintextBack,&lengthPT) )
   {
      cout << ((char*)plaintext) << endl; 
   }
   else cout << "failure check" << endl;

   unitTestSuite(); 
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movups 0x266d(%rip), %xmm0     # 0x5870
leaq -0x90(%rbp), %rbx
movaps %xmm0, 0x10(%rbx)
movups 0x264b(%rip), %xmm0     # 0x5860
movaps %xmm0, (%rbx)
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x33ca
movq %r14, %rdi
movl $0x10, %esi
callq 0x3470
movabsq $0x726f576f6c6c6568, %rax # imm = 0x726F576F6C6C6568
leaq -0x100(%rbp), %r14
movq %rax, (%r14)
movl $0x646c72, 0x7(%r14)    # imm = 0x646C72
xorl %r15d, %r15d
leaq -0x48(%rbp), %rax
movq %r15, (%rax)
leaq -0x2c(%rbp), %r12
movl %r15d, (%r12)
movq %r14, %rdi
callq 0x1070
movq %r14, %rdi
movl %eax, %esi
callq 0x3470
leaq -0x40(%rbp), %r13
movq %r15, (%r13)
movl %r15d, 0x8(%r13)
movq %r14, %rdi
callq 0x1070
leal 0x1(%rax), %edx
movq %r13, %rdi
movq %r14, %rsi
leaq -0x48(%rbp), %rcx
movq %r12, %r8
callq 0x34e6
testb %al, %al
je 0x32b4
movq -0x48(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x3470
jmp 0x32fa
movq 0x4d1d(%rip), %r14      # 0x7fd8
leaq 0x25c9(%rip), %rsi      # 0x588b
movl $0x7, %edx
movq %r14, %rdi
callq 0x1130
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq 0x4ceb(%rip), %rdi      # 0x7fd8
callq 0x1040
movq %rax, %rdi
callq 0x10b0
movq -0x48(%rbp), %rsi
movl -0x2c(%rbp), %edx
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rcx
leaq -0x4c(%rbp), %r8
callq 0x35be
testb %al, %al
je 0x3323
movq %rbx, %rdi
callq 0x1070
movq %rax, %rdx
jmp 0x332f
movl $0xd, %edx
leaq 0x2564(%rip), %rbx      # 0x5893
movq 0x4ca2(%rip), %r14      # 0x7fd8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1130
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq 0x4c79(%rip), %rdi      # 0x7fd8
callq 0x1040
movq %rax, %rdi
callq 0x10b0
callq 0x446e
movq -0x40(%rbp), %rdi
movl -0x38(%rbp), %edx
xorl %esi, %esi
callq 0x1080
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x338d
callq 0x1150
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x33a3
movq %rax, %rbx
movq -0x40(%rbp), %rdi
movl -0x38(%rbp), %edx
xorl %esi, %esi
callq 0x1080
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x33c2
callq 0x1150
movq %rbx, %rdi
callq 0x11a0