// File: DiplIngFrankGerlach[P]MST/UnitTest.cpp
// Function: unitTestSuite()
void unitTestSuite()
{
   testProc(1); 
   testProc(16); 
   testProc(15); 
   testProc(77); 
   testProc(32);
   testProc(256);
   testProc(2200);
   testProc(2048);
   //testProc(1000000);

   {
	   uint8_t ctr[]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
	   uint8_t desiredResult[]={2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
	   MST_Endpoint::incrementMC(ctr);
	   assert(memcmp(ctr,desiredResult,16)==0);

   }
   {   
	   uint8_t ctr[]={255,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
	   uint8_t desiredResult[]={0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
	   MST_Endpoint::incrementMC(ctr);

	   assert(memcmp(ctr,desiredResult,16)==0);
   }
   {   
	   uint8_t ctr[]={255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255};
	   uint8_t desiredResult[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
	   MST_Endpoint::incrementMC(ctr);

	   assert(memcmp(ctr,desiredResult,16)==0);
   }
   {   
	   uint8_t ctr[]={255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255};
	   uint8_t desiredResult[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255};
	   MST_Endpoint::incrementMC(ctr);

	   assert(memcmp(ctr,desiredResult,16)==0);
   }
   encryptedCommunicationExample();
   encryptedCommunicationFailTest();

   replayAttackFailTest();
   duplicateObfuscationTest();
   
   encryptedCommunicationExampleComplex();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl $0x1, %edi
callq 0x5e40
movl $0x10, %edi
callq 0x5e40
movl $0xf, %edi
callq 0x5e40
movl $0x4d, %edi
callq 0x5e40
movl $0x20, %edi
callq 0x5e40
movl $0x100, %edi            # imm = 0x100
callq 0x5e40
movl $0x898, %edi            # imm = 0x898
callq 0x5e40
movl $0x800, %edi            # imm = 0x800
callq 0x5e40
movq 0x1ece(%rip), %rax      # 0x8f10
movq %rax, -0x10(%rbp)
movq 0x1ecb(%rip), %rax      # 0x8f18
movq %rax, -0x8(%rbp)
movq 0x1ec8(%rip), %rax      # 0x8f20
movq %rax, -0x20(%rbp)
movq 0x1ec5(%rip), %rax      # 0x8f28
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x7760
leaq -0x10(%rbp), %rax
leaq -0x20(%rbp), %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7098
jmp 0x70b7
leaq 0x1dec(%rip), %rdi      # 0x8e8b
leaq 0x1845(%rip), %rsi      # 0x88eb
movl $0x115, %edx            # imm = 0x115
leaq 0x1df9(%rip), %rcx      # 0x8eab
callq 0x20e0
movq 0x1e72(%rip), %rax      # 0x8f30
movq %rax, -0x30(%rbp)
movq 0x1e6f(%rip), %rax      # 0x8f38
movq %rax, -0x28(%rbp)
movq 0x1e6c(%rip), %rax      # 0x8f40
movq %rax, -0x40(%rbp)
movq 0x1e69(%rip), %rax      # 0x8f48
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x7760
leaq -0x30(%rbp), %rax
leaq -0x40(%rbp), %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7114
jmp 0x7133
leaq 0x1d70(%rip), %rdi      # 0x8e8b
leaq 0x17c9(%rip), %rsi      # 0x88eb
movl $0x11d, %edx            # imm = 0x11D
leaq 0x1d7d(%rip), %rcx      # 0x8eab
callq 0x20e0
movq 0x1e16(%rip), %rax      # 0x8f50
movq %rax, -0x50(%rbp)
movq 0x1e13(%rip), %rax      # 0x8f58
movq %rax, -0x48(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20c0
leaq -0x50(%rbp), %rdi
callq 0x7760
leaq -0x50(%rbp), %rax
leaq -0x60(%rbp), %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x718a
jmp 0x71a9
leaq 0x1cfa(%rip), %rdi      # 0x8e8b
leaq 0x1753(%rip), %rsi      # 0x88eb
movl $0x124, %edx            # imm = 0x124
leaq 0x1d07(%rip), %rcx      # 0x8eab
callq 0x20e0
movq 0x1db0(%rip), %rax      # 0x8f60
movq %rax, -0x70(%rbp)
movq 0x1dad(%rip), %rax      # 0x8f68
movq %rax, -0x68(%rbp)
movq 0x1daa(%rip), %rax      # 0x8f70
movq %rax, -0x80(%rbp)
movq 0x1da7(%rip), %rax      # 0x8f78
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x7760
leaq -0x70(%rbp), %rax
leaq -0x80(%rbp), %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7206
jmp 0x7225
leaq 0x1c7e(%rip), %rdi      # 0x8e8b
leaq 0x16d7(%rip), %rsi      # 0x88eb
movl $0x12b, %edx            # imm = 0x12B
leaq 0x1c8b(%rip), %rcx      # 0x8eab
callq 0x20e0
callq 0x6010
callq 0x6810
callq 0x6a10
callq 0x6cc0
callq 0x62e0
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)