<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<div class="moz-cite-prefix">On 6/24/2020 4:58 PM, Bernd Eckenfels
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR03MB43890588B65067E62BB98215FF950@AM6PR03MB4389.eurprd03.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">
<div data-ogsc="" style="">
<div dir="ltr">Hello,</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">JCE implements the AESWrap cipher, but it's
does not offer the KWP mode of NIST 800-38F. KW and KWP use
the same wrapping algorithm W which is also used by AESWrap,
however do to different initialisation vectors the existing
implementation can not be used to implement the padded
wrapping.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Is it possible to offer KWP as a special
padding mode for AESWrap or have the W mode be it's own
block mode so you can implement the padding externally?</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Gruss</div>
<div dir="ltr">Bernd</div>
<div class="ms-outlook-ios-signature"
id="ms-outlook-mobile-signature">
<div dir="ltr"><br>
</div>
<div style="direction: ltr;">-- </div>
<div style="direction: ltr;"><a class="moz-txt-link-freetext" href="http://bernd.eckenfels.net">http://bernd.eckenfels.net</a></div>
</div>
</div>
</div>
</blockquote>
<p>You probably know that BouncyCastle implements KWP?</p>
<p>Reading the comments in the AESWrapCipher code, this was created
against the XML encryption standards even though the underlying
code is a straight implementation of RFC3394. <br>
</p>
<p>Rather than twiddle with this current implementation and name
mapping, it may make more sense to redo this as a normal
<Alg>/<mode>/<padding> mapping. E.g.
"AES/KeyWrap-NIST/NoPadding" or KWPPadding or AutoPadding rather
than the current "AESWrap". That would then allow for
"ChaCha20/KeyWrap-NIST/AutoPadding" and others.<br>
</p>
<p>I.e., copy the code from the current AESWrapCipher and convert it
to a mode. More work now, less later. The AutoPadding would
select the no padding if the encoded key size was a multiple of
the block length, and the KWP padding if the encoded key size was
not a multiple. Or read the IV to determine which for unwrapping.
<br>
</p>
<p>Mike</p>
<p><br>
</p>
</body>
</html>