<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>




<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 auto;">
<tbody>
<tr>
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; overflow: hidden;" align="left" bgcolor="#ffffff">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border-collapse: separate; border-spacing: 0;">
<tbody>
<tr>
<td style="color: #333333; border-bottom-width: 1px; border-bottom-color: #ededed; border-bottom-style: solid; font-size: 15px; font-weight: bold; line-height: 1.4; padding: 20px 0;">
Merge request <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1521">!1521</a> was reviewed by <a href="https://gitlab.com/dueno">Daiki Ueno</a>
</td>
</tr>
<tr>
<td style="overflow: hidden; font-size: 14px; line-height: 1.4; display: grid;">
<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
started a new
discussion on <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1521#note_821771006">lib/accelerated/x86/aes-gcm-aead.h</a>:
</p>
<table>
<tr class="line_holder">
<td class="old_line diff-line-num" data-linenumber="12" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
12
</td>
<td class="new_line diff-line-num" data-linenumber="12" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
12
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;"><pre style="margin: 0;"> <span id="LC12" class="line" lang="c">       <span class="cm" style="color: #998; font-style: italic;">/* proper AEAD cipher */</span></span>
</pre></td>
</tr>
<tr class="line_holder old">
<td class="old_line diff-line-num old" data-linenumber="13" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
13
</td>
<td class="new_line diff-line-num old" data-linenumber="13" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb"><pre style="margin: 0;">-<span id="LC13" class="line" lang="c">       <span class="k" style="font-weight: 600;">if</span> <span class="p">(</span><span class="n" style="color: #333;">encr_size</span> <span class="o" style="font-weight: 600;"><</span> <span class="n" style="color: #333;">plain_size</span> <span class="o" style="font-weight: 600;">+</span> <span class="n" style="color: #333;">tag_size</span><span class="p">)</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="14" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="13" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
13
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC13" class="line" lang="c">       <span class="k" style="font-weight: 600;">if</span> <span class="p"><span class="idiff left addition">(</span></span><span class="n" style="color: #333;"><span class="idiff addition">unlikely</span></span><span class="p">(</span><span class="n" style="color: #333;">encr_size</span> <span class="o" style="font-weight: 600;"><</span> <span class="n" style="color: #333;">plain_size</span> <span class="o" style="font-weight: 600;">+</span> <span class="n" style="color: #333;">tag_size</span><span class="p">)<span class="idiff right addition">)</span></span></span>
</pre></td>
</tr>

</table>
<div style="border-bottom-width: 1px; border-bottom-color: #ededed; border-bottom-style: solid;">
<p dir="auto">Maybe good to use the same condition used elsewhere (<code>plain_size < encr_size - tag_size</code>)? That would avoid integer overflow as <a href="https://www.enyo.de/fw/notes/style-guide-conditions.html" rel="nofollow noreferrer noopener" target="_blank">suggested</a>.</p>
</div>

<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
commented on a
discussion on <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1521#note_821771019">lib/accelerated/afalg.c</a>:
</p>
<table>
<tr class="line_holder">
<td class="old_line diff-line-num" data-linenumber="137" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
137
</td>
<td class="new_line diff-line-num" data-linenumber="140" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
140
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;"><pre style="margin: 0;"> <span id="LC140" class="line" lang="c">      <span class="n" style="color: #333;">iov</span><span class="p">.</span><span class="n" style="color: #333;">iov_base</span> <span class="o" style="font-weight: 600;">=</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">void</span> <span class="o" style="font-weight: 600;">*</span><span class="p">)</span><span class="n" style="color: #333;">dst</span><span class="p">;</span></span>
</pre></td>
</tr>
<tr class="line_holder old">
<td class="old_line diff-line-num old" data-linenumber="138" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
138
</td>
<td class="new_line diff-line-num old" data-linenumber="141" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb"><pre style="margin: 0;">-<span id="LC138" class="line" lang="c">      <span class="n" style="color: #333;">iov</span><span class="p">.</span><span class="n" style="color: #333;">iov_len</span> <span class="o" style="font-weight: 600;">=</span> <span class="p"><span class="idiff left deletion">(</span></span><span class="n" style="color: #333;"><span class="idiff deletion">src_size</span></span><span class="idiff deletion"> </span><span class="o" style="font-weight: 600;"><span class="idiff deletion">></span></span><span class="idiff deletion"> </span><span class="n" style="color: #333;"><span class="idiff deletion">dst_size</span></span><span class="p"><span class="idiff deletion">)</span></span><span class="idiff deletion"> </span><span class="o" style="font-weight: 600;"><span class="idiff deletion">?</span></span><span class="idiff deletion"> </span><span class="n" style="color: #333;"><span class="idiff deletion">dst_size</span></span><span class="idiff deletion"> </span><span class="o" style="font-weight: 600;"><span class="idiff deletion">:</span></span><span class="idiff right deletion"> </span><span class="n" style="color: #333;">src_size</span><span class="p">;</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="139" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="141" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
141
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC141" class="line" lang="c">      <span class="n" style="color: #333;">iov</span><span class="p">.</span><span class="n" style="color: #333;">iov_len</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">src_size</span><span class="p">;</span></span>
</pre></td>
</tr>

</table>
<div style="border-bottom-width: 1px; border-bottom-color: #ededed; border-bottom-style: solid;">
<p dir="auto">There was a discussion on this in the original <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1404" data-original="MR" data-link="true" data-link-reference="true" data-project="179611" data-merge-request="92266949" data-project-path="gnutls/gnutls" data-iid="1404" data-mr-title="Add Linux kernel AF_ALG backend" data-reference-type="merge_request" data-container="body" data-placement="top" title="" class="gfm gfm-merge_request">MR</a>, but I am not really sure. <a href="https://gitlab.com/FrantisekKrenzelok" data-user="5391804" data-reference-type="user" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="František Krenželok">@FrantisekKrenzelok</a> or <a href="https://gitlab.com/smuellerDD" data-user="1650358" data-reference-type="user" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="Stephan Mueller">@smuellerDD</a> might remember the reason. If <code>gnutls-cli --benchmark-ciphers</code> works with AF_ALG with this change, I guess that's ok.</p>
</div>

</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1521">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/1a3437b5fbfa48d9428a94356cfb9ba2/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.com/gnutls/gnutls/-/merge_requests/1521"}}</script>


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