<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma,new york,times,serif;font-size:10pt"><div>Mike,<br><br>I have the same results as you.<br><br><br>-- Edmund<br></div><div style="font-family:tahoma, new york, times, serif;font-size:10pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Mike Jones <Michael.Jones@microsoft.com><br><b><span style="font-weight: bold;">To:</span></b> "Axel.Nennker@telekom.de" <Axel.Nennker@telekom.de>; "ejay@mgi1.com" <ejay@mgi1.com>; "emmanuel@raviart.com" <emmanuel@raviart.com>; "bcampbell@pingidentity.com" <bcampbell@pingidentity.com><br><b><span style="font-weight: bold;">Cc:</span></b> "openid-connect-interop@googlegroups.com" <openid-connect-interop@googlegroups.com>; "openid-specs-ab@lists.openid.net"
 <openid-specs-ab@lists.openid.net><br><b><span style="font-weight: bold;">Sent:</span></b> Wed, August 29, 2012 12:40:37 PM<br><b><span style="font-weight: bold;">Subject:</span></b> RE: Changes to the JOSE use of the Concat KDF to add additional inputs<br></font><br>Thanks for looking at this, Axel.  As you surmised, the output length in bits is a 32-bit big-endian integer.  The hash input values, including the OtherInfo values, were actually already in the log file.  I've annotated the hash input values below, so that hopefully the process will be totally clear.<br><br>                Thanks again,<br>                -- Mike<br><br>Hash input when using CMK1 to generate CEK:<br>[0, 0, 0, 1, -- Round 1<br> 4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206,<br> 107, 124, 212, 45, 111, 107, 9,
 219, 200, 177, 0, 240, 143, 156, 44, 207, -- 256 bit CMK<br> 0, 0, 0, 128, -- 128 bit CEK being generated<br> 65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54, -- "A128CBC+HS256"<br> 69, 110, 99, 114, 121, 112, 116, 105, 111, 110] -- "Encryption"<br><br>Hash input when using CMK1 to generate CIK:<br>[0, 0, 0, 1, -- Round 1<br> 4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206,<br> 107, 124, 212, 45, 111, 107, 9, 219, 200, 177, 0, 240, 143, 156, 44, 207, -- 256 bit CMK<br> 0, 0, 1, 0, -- 256 bit CIK being generated<br> 65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54, -- "A128CBC+HS256"<br> 73, 110, 116, 101, 103, 114, 105, 116, 121] -- "Integrity"<br><br>Hash input when using CMK2 to generate CEK:<br>[0, 0, 0, 1, -- Round 1<br> 148, 116, 199, 126, 2, 117, 233, 76, 150, 149, 89, 193, 61, 34, 239, 226,<br> 109, 71, 59, 160, 192, 140, 150, 235, 106, 204, 49, 176, 68, 119, 13, 34,<br> 49, 19, 41, 69, 5, 20, 252, 145, 104, 129,
 137, 138, 67, 23, 153, 83,<br> 81, 234, 82, 247, 48, 211, 41, 130, 35, 124, 45, 156, 249, 7, 225, 168, -- 512 bit CMK<br> 0, 0, 1, 0, -- 256 bit CEK being generated<br> 65, 50, 53, 54, 67, 66, 67, 43, 72, 83, 53, 49, 50, -- "A256CBC+HS512"<br> 69, 110, 99, 114, 121, 112, 116, 105, 111, 110] -- "Encryption"<br><br>Hash input when using CMK2 to generate CIK:<br>[0, 0, 0, 1, -- Round 1<br> 148, 116, 199, 126, 2, 117, 233, 76, 150, 149, 89, 193, 61, 34, 239, 226,<br> 109, 71, 59, 160, 192, 140, 150, 235, 106, 204, 49, 176, 68, 119, 13, 34,<br> 49, 19, 41, 69, 5, 20, 252, 145, 104, 129, 137, 138, 67, 23, 153, 83,<br> 81, 234, 82, 247, 48, 211, 41, 130, 35, 124, 45, 156, 249, 7, 225, 168, -- 512 bit CMK<br> 0, 0, 2, 0, -- 512 bit CIK being generated<br> 65, 50, 53, 54, 67, 66, 67, 43, 72, 83, 53, 49, 50, -- "A256CBC+HS512"<br> 73, 110, 116, 101, 103, 114, 105, 116, 121] -- "Integrity"<br><br>-----Original Message-----<br>From: <a
 ymailto="mailto:Axel.Nennker@telekom.de" href="mailto:Axel.Nennker@telekom.de">Axel.Nennker@telekom.de</a> [mailto:<a ymailto="mailto:Axel.Nennker@telekom.de" href="mailto:Axel.Nennker@telekom.de">Axel.Nennker@telekom.de</a>] <br>Sent: Wednesday, August 29, 2012 7:49 AM<br>To: Mike Jones; <a ymailto="mailto:ejay@mgi1.com" href="mailto:ejay@mgi1.com">ejay@mgi1.com</a>; <a ymailto="mailto:emmanuel@raviart.com" href="mailto:emmanuel@raviart.com">emmanuel@raviart.com</a>; <a ymailto="mailto:bcampbell@pingidentity.com" href="mailto:bcampbell@pingidentity.com">bcampbell@pingidentity.com</a><br>Cc: <a ymailto="mailto:openid-connect-interop@googlegroups.com" href="mailto:openid-connect-interop@googlegroups.com">openid-connect-interop@googlegroups.com</a>; <a ymailto="mailto:openid-specs-ab@lists.openid.net" href="mailto:openid-specs-ab@lists.openid.net">openid-specs-ab@lists.openid.net</a><br>Subject: RE: Changes to the JOSE use of the Concat KDF to add
 additional inputs<br><br>How many bytes does the field output length in bits have?<br><br>Currently we have otherInfo being the ASCII label ("Encryption" or "Integrity") bytes.<br><br>What is the new otherInfo?<br><br>Could you please put this byte arrays into the log file too?<br><br>I tried with<br>[0, 0, 1, 0, 65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54, 69, 110, 99, 114, 121, 112, 116, 105, 111, 110] This is four bytes for the keylength in bits (256), followed by the bytes for "A128CBC+HS256", followed by "Encryption"-bytes.<br>This does not produce CEK1 but:<br>[91, 54, 29, -109, 90, 39, 66, -120, 117, -91, -128, -60, 9, -117, -97, -119, -18, 55, 113, -31, -102, 70, 33, 9, 107, 117, -3, -6, -22, -23, 17, -22]<br> <br>I tried with a two byte keylength in bits too. No success.<br><br>Axel<br><br><br><br>public void testConcatKdf256OtherInfo201208_A128CBC_HS256() throws Exception {<br>    Digest kdfDigest = new
 SHA256Digest();<br>    byte[] zBytes = { 4, (byte) 211, 31, (byte) 197, 84, (byte) 157, (byte) 252, (byte) 254, 11, 100, (byte) 157,<br>        (byte) 250, 63, (byte) 170, 106, (byte) 206, 107, 124, (byte) 212, 45, 111, 107, 9, (byte) 219, (byte) 200,<br>        (byte) 177, 0, (byte) 240, (byte) 143, (byte) 156, 44, (byte) 207 };<br>    int keylength = 32;<br>    int outputLengthInBits = keylength * 8;<br>    ByteArrayOutputStream baos = new ByteArrayOutputStream();<br>    baos.write((byte)(outputLengthInBits >> 24));<br>    baos.write((byte)(outputLengthInBits >> 16));<br>    baos.write((byte)(outputLengthInBits >> 8));<br>    baos.write((byte)outputLengthInBits);<br>//    baos.write(outputLengthInBits);<br>    String encStr = "A128CBC+HS256";<br>   
 baos.write(encStr.getBytes());<br>    final byte[] encryption = { 69, 110, 99, 114, 121, 112, 116, 105, 111, 110 };<br>    baos.write(encryption);<br>    byte[] otherInfo = baos.toByteArray();<br>    KDFConcatGenerator kdfConcatGenerator = new KDFConcatGenerator(kdfDigest, otherInfo);<br>    kdfConcatGenerator.init(new KDFParameters(zBytes, null));<br>    byte[] out = new byte[keylength];<br>    kdfConcatGenerator.generateBytes(out, 0, out.length);<br>    byte[] CEK1 = { 37, (byte)245, (byte)125, (byte)247, (byte)113, (byte)155, (byte)238, (byte)98, (byte)228, (byte)206, (byte)62, (byte)65, (byte)81, (byte)153, (byte)79, (byte)91 };<br>    String expectedB64 = Base64.encodeBytesNoBreaks(CEK1);<br>    assertEquals(expectedB64, Base64.encodeBytesNoBreaks(out));<br><br> 
 }<br><br>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>From: Mike Jones [mailto:<a ymailto="mailto:Michael.Jones@microsoft.com" href="mailto:Michael.Jones@microsoft.com">Michael.Jones@microsoft.com</a>]<br>Sent: Wednesday, August 29, 2012 2:52 AM<br>To: Edmund Jay; Emmanuel Raviart; Brian Campbell; Nennker, Axel<br>Cc: <a ymailto="mailto:openid-connect-interop@googlegroups.com" href="mailto:openid-connect-interop@googlegroups.com">openid-connect-interop@googlegroups.com</a>; <a ymailto="mailto:openid-specs-ab@lists.openid.net" href="mailto:openid-specs-ab@lists.openid.net">openid-specs-ab@lists.openid.net</a><br>Subject: Changes to the JOSE use of the Concat KDF to add additional inputs<br><br>Updated sample Concat KDF inputs and outputs are attached.  Previously the Concat inputs for each hash round were:<br>. Round number<br>. Content Master Key<br>. ASCII label ("Encryption" or
 "Integrity")<br><br>Now the hash inputs for each hash round are:<br>. Round number<br>. Content Master Key<br>. Output length in bits<br>. ASCII "enc" parameter value<br>. ASCII label ("Encryption" or "Integrity")<br><br>Note that the former "enc", "int", and "kdf" parameters are being combined into a single composite "enc" parameter.  The defined values for it will be "A128CBC+HS256", "A256CBC+HS512", "A128GCM", and "A256GCM" (no change for the latter two).  There's one example each for the first two composite algorithms.<br><br>Also note that the HMAC SHA-512 hash function is used in second case.  (Previously, HMAC SHA-256 was always used.)<br><br>Let me know if any of this is unclear, or if you want to provide other feedback, please let me know.  I'll be producing encryption examples using these values next.<br><br>It would be *great* if one or more of you could verify that you can reproduce these
 results.<br><br>                                                            Thanks again,<br>                                                            -- Mike<br><br><br><br></div></div>



</div></body></html>