managed code? with unmanaged functions how

E3465662c70bd9bebf3f75223a7a5ce4
0
c0mputer_fr0d 101 Aug 12, 2012 at 04:23

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;
}

1 Reply

Please log in or register to post a reply.

46407cc1bdfbd2db4f6e8876d74f990a
0
Kenneth_Gorking 101 Aug 13, 2012 at 14:38

From msdn:

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.