<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 27, 2021 at 9:34 PM Salz, Rich via cryptography <<a href="mailto:cryptography@metzdowd.com">cryptography@metzdowd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_1095117673133734287WordSection1">
<p class="MsoNormal"><span style="font-size:11pt"><a href="https://mailarchive.ietf.org/arch/msg/cfrg/qLTveWOdTJcLn4HP3ev-vrj05Vg/" target="_blank">https://mailarchive.ietf.org/arch/msg/cfrg/qLTveWOdTJcLn4HP3ev-vrj05Vg/</a> :<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">I can confirm that I have abandoned all OCB patents<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">and placed into the public domain all OCB-related IP of mine.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">While I have been telling people this for quite some time, I don't<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">think I ever made a proper announcement to the CFRG or on the<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">OCB webpage. Consider that done.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">I hope people will use the scheme to do positive things.</span></p></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Looks to me like it could be reasonably easy to convert the existing .NET crypto provider to support this mode by piggybacking on the existing ECB mode. The reason I want to build on .NET rather than roll my own AES is I want to get the benefit of any hardware acceleration that may be available on a given platform. Microsoft is far more likely to do this than I am. And if I do, I will want to have the benefit for all AES related crypto, not just OCB.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The heart of the API is ICryptoTransform.TransformBlock:</div><br></div><div>public int TransformBlock (byte[] <span class="gmail_default" style="font-size:small"></span>inputBuffer, int inputOffset, int<span class="gmail_default" style="font-size:small"></span> inputCount, byte[] <span class="gmail_default" style="font-size:small"></span><span class="gmail_default" style="font-size:small"></span>outputBuffer, int outputOffset);<br></div><div><br></div><div><div class="gmail_default" style="font-size:small">Transform Block is ALWAYS called on an even block boundary but it can be called on multiple blocks. It is called sequentially so it doesn't allow direct use to be made of the parallel capabilities of OCB.</div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">So I can create a wrapper around an ECB mode cipher:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">0) create a buffer that is at least as large as the maximum size of <span class="gmail_default"></span><span class="gmail_default"></span>inputCount that is going to be presented to the AES encryptor.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For each call:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1) Xor <span class="gmail_default">the bytes of </span>inputBuffer with the buffer</div><div class="gmail_default" style="font-size:small">2) call Transform block</div><div class="gmail_default" style="font-size:small">3) Xor <span class="gmail_default">the bytes of </span><span class="gmail_default"></span>outputBuffer with the buffer</div><br></div><div><div class="gmail_default" style="font-size:small">The wrapper is even symmetric! I can use the same one for Encrypt and Decrypt.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I am going to be changing the padding mode however as I am padding packets out to fill the Ethernet MTA. So I can simply specify that a round number of AES blocks are used. So I can dispose of the ciphertext stealing part (except for purposes of validating against the test vectors) as my code is simply a special case of the general padding scheme.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The RFC would be sooooo much easier to read in the new HTML format.</div><div class="gmail_default" style="font-size:small"></div><br></div><div><br></div><div><br></div><div> </div></div></div></div></div></div></div></div></div></div>