<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AES Cryptography Primitive Malfunctioning? in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791521#M2437</link>
    <description>&lt;P&gt;Hi Chris, Andrzej, &lt;/P&gt;&lt;P&gt;Thanks for the good discussion. Exactly, the IPPRigndael256 is the data block size and AES256 means the 256 key size. &lt;/P&gt;&lt;P&gt;In general, AES uses only and only 16 bytes (128 bits) data block size - pieces of plane- or cipher text. AES std does not define AES for other data block size. &lt;/P&gt;&lt;P&gt;According to std and practice AES-128, AES-192 and AES-256 means 128-bit cipher (AES) but with different size of key (128, 192 and 256 bit correspondingly).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;While IPP Rigndael256 means implementation of general Rijndael algorithm with 256 bit data block size. &lt;/P&gt;&lt;P&gt;So the result are different. And Andrzej's modification is exactly right. &lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Ying &lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2010 03:35:13 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2010-06-25T03:35:13Z</dc:date>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791514#M2430</link>
      <description>When I use the 256 bit AES encryption primitives in OFB mode with the test vectors provided by NIST (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf), I do not get the right encrypted or decrypted results.&lt;BR /&gt;&lt;BR /&gt;According to the document using:&lt;BR /&gt;&lt;BR /&gt;Key = 60 3d eb 10 15 ca 71 be 2b 73 ae f0 85 7d 77 81 1f 35 2c 07 3b 61 08 d7 2d 98 10 a3 09 14 df f4&lt;BR /&gt;&lt;BR /&gt;IV = 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f&lt;BR /&gt;&lt;BR /&gt;Plain Text = 6b c1 be e2 2e 40 9f 96 e9 3d 7e 11 73 93 17 2a&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;I should obtain:&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Cipher Text = dc 7e 84 bf da 79 16 4b 7e cd 84 86 98 5d 38 60&lt;BR /&gt;&lt;BR /&gt;I have confirmed that I get these results with both the Java cryptography library, and the open source Crypto++ C++ library, yet the Intel one does not produce these results.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;[cpp]#include &lt;IOSTREAM&gt;
#include "aes.h"
#include "ippcp.h"
using namespace std;

int main()
{
	Ipp8u i_key[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73,
					   0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, 0x1f, 0x35, 0x2c, 0x07,
					   0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14,
					   0xdf, 0xf4};

	Ipp8u i_iv[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
					  0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};

	Ipp8u i_data[16] = {0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d,
						0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a};

	Ipp8u i_enc_data[16];
	Ipp8u i_dec_data[16];

	int context_size;
	ippsRijndael256GetSize(&amp;amp;context_size);
	IppsRijndael256Spec* aes_spec = (IppsRijndael256Spec*)(new Ipp8u[context_size]);
	ippsRijndael256Init(i_key, IppsRijndaelKey256, aes_spec);
	ippsRijndael256EncryptOFB(i_data, i_enc_data, 16, 1, aes_spec, i_iv);
	ippsRijndael256DecryptOFB(i_enc_data, i_dec_data, 16, 1, aes_spec, i_iv);

	cout &amp;lt;&amp;lt; "Encrypted: ";
	for (int i = 0; i &amp;lt; 16; ++i)
		printf("%x ", i_enc_data&lt;I&gt;);
	cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; "Decrypted: ";
	for (int i = 0; i &amp;lt; 16; ++i)
		printf("%x ", i_dec_data&lt;I&gt;);
	cout &amp;lt;&amp;lt; endl;

	return 0;
}
[/cpp]&lt;/I&gt;&lt;/I&gt;&lt;/IOSTREAM&gt;&lt;/PRE&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any thoughts?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Chris&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Jun 2010 17:46:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791514#M2430</guid>
      <dc:creator>ckentitt</dc:creator>
      <dc:date>2010-06-23T17:46:23Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791515#M2431</link>
      <description>Hello Chris&lt;BR /&gt;Tray this way:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;#include&lt;CSTRING&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt; &lt;BR /&gt;#include "ippcp.h" &lt;BR /&gt;using namespace std; &lt;BR /&gt;&lt;BR /&gt;int main() &lt;BR /&gt;{ &lt;BR /&gt; Ipp8u i_key[32] = {0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, &lt;BR /&gt;      0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, 0x1f, 0x35, 0x2c, 0x07, &lt;BR /&gt;      0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, &lt;BR /&gt;      0xdf, 0xf4}; &lt;BR /&gt;&lt;BR /&gt; Ipp8u i_iv0[16] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, &lt;BR /&gt;      0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};&lt;BR /&gt; Ipp8u i_iv[16];&lt;BR /&gt; memcpy(i_iv,i_iv0,sizeof(i_iv0)); &lt;BR /&gt;&lt;BR /&gt; Ipp8u i_data[16] = {0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, &lt;BR /&gt;      0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a}; &lt;BR /&gt;&lt;BR /&gt; Ipp8u i_enc_data[16]; &lt;BR /&gt; Ipp8u i_dec_data[16]; &lt;BR /&gt;&lt;BR /&gt; int context_size; &lt;BR /&gt; ippsRijndael128GetSize(&amp;amp;context_size); &lt;BR /&gt; IppsRijndael128Spec* aes_spec = (IppsRijndael128Spec*)(new Ipp8u[context_size]); &lt;BR /&gt; ippsRijndael128Init(i_key, IppsRijndaelKey256, aes_spec); &lt;BR /&gt; ippsRijndael128EncryptOFB(i_data, i_enc_data, 16, 16, aes_spec, i_iv0); &lt;BR /&gt; ippsRijndael128DecryptOFB(i_enc_data, i_dec_data, 16, 16, aes_spec, i_iv); &lt;BR /&gt;&lt;BR /&gt; cout &amp;lt;&amp;lt; "Encrypted: "; &lt;BR /&gt; for (int i = 0; i &amp;lt; 16; ++i) &lt;BR /&gt;  printf("%x ", i_enc_data&lt;I&gt;); &lt;BR /&gt; cout &amp;lt;&amp;lt; endl &amp;lt;&amp;lt; "Decrypted: "; &lt;BR /&gt; for (int i = 0; i &amp;lt; 16; ++i) &lt;BR /&gt;  printf("%x ", i_dec_data&lt;I&gt;); &lt;BR /&gt; cout &amp;lt;&amp;lt; endl; &lt;BR /&gt;&lt;BR /&gt; return 0; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1) AES=Rijndael128 &lt;BR /&gt;2)Note: IppsRijndaelKey256&lt;BR /&gt;3)IV shold be copied&lt;BR /&gt;&lt;BR /&gt;Andrzej Ch&lt;/I&gt;&lt;/I&gt;&lt;/STDIO.H&gt;&lt;/CSTRING&gt;&lt;/IOSTREAM&gt;</description>
      <pubDate>Wed, 23 Jun 2010 21:14:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791515#M2431</guid>
      <dc:creator>achrzesz2</dc:creator>
      <dc:date>2010-06-23T21:14:58Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791516#M2432</link>
      <description>&lt;DIV&gt;Thanks for the reply.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;So I see you've copied the IV, which I'm guessing is because the IV is updated to the next one after running encrypt and I need the same IV to decrypt. That's fine but that would only explain a problem in the decryption stage, not the encryption, and the encryption results do not match the official results.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;You've also changed from 256 bit AES to 128. I do not want 128 bit, nor should that be a factor in why the 256 bit version is not working.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Finally, I see you changed the OFB block size to 16 instead of 1, I have tried both and neither produce a correct result.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Or am I missing something in your post?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;-Chris&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Jun 2010 21:21:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791516#M2432</guid>
      <dc:creator>ckentitt</dc:creator>
      <dc:date>2010-06-23T21:21:21Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791517#M2433</link>
      <description>Hello Chris&lt;BR /&gt;The modifieded code gives right encrryption dc 7e 84 bf da 79 16 4b 7e cd 84 86 98 5d 38 60 &lt;BR /&gt;I can repeat that in standard AES only Rijndael128 algorithm can be used &lt;BR /&gt;The 256 means key-length not block length&lt;BR /&gt;&lt;BR /&gt;Andrzej Ch</description>
      <pubDate>Wed, 23 Jun 2010 21:44:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791517#M2433</guid>
      <dc:creator>achrzesz2</dc:creator>
      <dc:date>2010-06-23T21:44:25Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791518#M2434</link>
      <description>I'm aware that the 256 is the key-length, that is what I want! I want 256 bit encryption, not 128. The fact that 128 works, does not change my question as to why 256 does not.</description>
      <pubDate>Thu, 24 Jun 2010 11:52:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791518#M2434</guid>
      <dc:creator>ckentitt</dc:creator>
      <dc:date>2010-06-24T11:52:31Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791519#M2435</link>
      <description>Hello Chris&lt;BR /&gt;In the example from sp800-38a.pdf you are intersted&lt;BR /&gt;the plain-text&lt;BR /&gt; cipher-text&lt;BR /&gt; initial vector&lt;BR /&gt;have 128-bits (no 256-bits)&lt;BR /&gt;&lt;BR /&gt;Only the key is 256-bit long&lt;BR /&gt;&lt;BR /&gt;THAT IS AES 256-BIT ENCRYPTION&lt;BR /&gt;&lt;BR /&gt;A quote from FIPS 197:&lt;BR /&gt;&lt;BR /&gt;This standard specifies the Rijndael algorithm ([3] and [4]), &lt;BR /&gt;a symmetric block cipher that can&lt;BR /&gt;process data blocks of 128 bits, &lt;BR /&gt;using cipher keys with lengths of 128, 192, and 256 bits.&lt;BR /&gt;Rijndael was designed to handle additional block sizes and key lengths, &lt;BR /&gt;however they are not adopted in this standard.</description>
      <pubDate>Thu, 24 Jun 2010 12:47:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791519#M2435</guid>
      <dc:creator>achrzesz2</dc:creator>
      <dc:date>2010-06-24T12:47:38Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791520#M2436</link>
      <description>Ah!!!&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I get it - the 256 in the primitive I was using is the block size, not the key length. That's odd, I would've thought it the other way around. Sorry for the confusion! Thanks for your help.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;-Chris&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Jun 2010 13:04:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791520#M2436</guid>
      <dc:creator>ckentitt</dc:creator>
      <dc:date>2010-06-24T13:04:43Z</dc:date>
    </item>
    <item>
      <title>AES Cryptography Primitive Malfunctioning?</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791521#M2437</link>
      <description>&lt;P&gt;Hi Chris, Andrzej, &lt;/P&gt;&lt;P&gt;Thanks for the good discussion. Exactly, the IPPRigndael256 is the data block size and AES256 means the 256 key size. &lt;/P&gt;&lt;P&gt;In general, AES uses only and only 16 bytes (128 bits) data block size - pieces of plane- or cipher text. AES std does not define AES for other data block size. &lt;/P&gt;&lt;P&gt;According to std and practice AES-128, AES-192 and AES-256 means 128-bit cipher (AES) but with different size of key (128, 192 and 256 bit correspondingly).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;While IPP Rigndael256 means implementation of general Rijndael algorithm with 256 bit data block size. &lt;/P&gt;&lt;P&gt;So the result are different. And Andrzej's modification is exactly right. &lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Ying &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2010 03:35:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/AES-Cryptography-Primitive-Malfunctioning/m-p/791521#M2437</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2010-06-25T03:35:13Z</dc:date>
    </item>
  </channel>
</rss>

