Jump to content


managed code? with unmanaged functions how


1 reply to this topic

#1 c0mputer-fr0d

    Member

  • Members
  • PipPip
  • 30 posts

Posted 12 August 2012 - 04:23 AM

I keep getting these errors when trying to use cryptolib++
aligned data types not supported in managed code.
I successfully added cryptolib to my project now it is just fussing over this.
here's the code I'm trying to compile it is in vc++

private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) {
     String^ TxT = textBox1->Text;
unsigned char HASH [32];
unsigned char byteval [32] = {0x53, 0x28, 0x40, 0x6e, 0x2f, 0x64, 0x63, 0x5d, 0x2d, 0x61, 0x77, 0x40, 0x76, 0x71, 0x77, 0x28, 
0x74, 0x61, 0x7d, 0x66, 0x61, 0x73, 0x3b, 0x5d, 0x66, 0x6d, 0x3c, 0x3f, 0x7b, 0x66, 0x72, 0x36};
int nDatalength = sizeof(byteval);
// byteval = Convert::ToByte(textBox1->Text);
SHA256().CalculateDigest(HASH,byteval,nDatalength);
textBox3->Text = byteval;
}


#2 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 13 August 2012 - 02:38 PM

From msdn:

Quote

The CLR must be able to allocate data as needed, which might not be possible if the data is aligned with declarations such as __m128 or align.

"Stupid bug! You go squish now!!" - Homer Simpson





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users