<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>We are currently working on the implementation of the "CRYSTALS"
schemes Kyber<br>
and Dilithium (SPHINCS⁺ to follow soon) in Libgcrypt. In this
course we came<br>
across a problem with the secure memory [^1] management in
Libgcrypt. Namely,<br>
the current hard limit for secure memory is 32kB. That seems to be
a reasonable<br>
default value as there are apparently indeed OSs which have limits
for locked in<br>
this domain. However, the heap memory requirements for the
largest parameter<br>
sets of the CRYSTALS schemes are<br>
- Kyber 33,376 bytes (key generation)<br>
- Dilithium 135,968 bytes (probably also key generation, but not
determined yet)<br>
<br>
For Kyber we could possibly increase the default pool size to
still reasonable<br>
64kB. But in the case of multiple threads using Kyber operations
this will still<br>
not suffice.<br>
<br>
This raises the question of how to deal with this limitation. When
the secure<br>
memory pool set up with the default size is exhausted, even in
non-FIPS mode,<br>
further requests for secure memory fail. This is not ideal, since
many modern<br>
systems will provide much higher margins for lockable memory.<br>
<br>
So one possibility I see is to<br>
- implement an allocation function for the CRYSTALS schemes that
first tries to<br>
allocate secure memory and if that fails, and FIPS mode is not
activated, then<br>
simply allocates non-secure memory<br>
- possibly rework the secure memory management so that it tries to
lock further<br>
memory blocks when secure memory is requested after the
initially set up pool<br>
is exhausted. For instance on my Debian 11 x86 for instance I
have limit of 4<br>
MB for locked memory, thus allowing to exceed the rather
pessimistic default<br>
value by orders of magnitude.<br>
<br>
The Libgcrypt core developers please let us know their thoughts
regarding these<br>
issues.<br>
<br>
<br>
[^1]: i.e. heap memory that is protected from being swapped
(locked memory) to<br>
disk and overwritten when freed<br>
<br>
</p>
<div class="moz-signature">-- <br>
<!-- MTG AG HTML signature v.1.0 - Messen 2022, 2022-03-14 - Author: Andreas Cholet -->
<p style="line-height: 1.1;"><font face="Arial"><span
style="font-size: small; color: rgb(93, 93, 95);">
<strong>MTG AG</strong><br>
Dr. Falko Strenzke<br>
Executive System Architect<br>
<!--up to here--> </span></font></p>
<font face="Arial">
<p>
<span style="font-size: small; color: rgb(93, 93, 95);">
<span style="display:inline-block;width:4em">Phone: </span>+49
6151 8000 24<br>
<span style="display:inline-block;width:4em">E-Mail: </span><a class="moz-txt-link-abbreviated" href="mailto:falko.strenzke@mtg.de">falko.strenzke@mtg.de</a><br>
<span style="display:inline-block;width:4em">Web: </span><a
href="https://www.mtg.de" title="MTG AG Internet"
target="_blank">mtg.de</a><br>
<br>
<br>
<strong>MTG Exhibitions – See you in 2023</strong>
</span></p>
<font face="Arial">
<hr
style="width:320px; text-align:left;margin-left:0; height: 0,1px">
<a
href="https://community.e-world-essen.com/institutions/allExhibitors?query=true&keywords=mtg"
title="Info E-world 2023" target="_blank" rel="“noopener"
noreferrer"="">
<img data-filename="Eworld.png"
src="cid:part1.m0Evz5Eo.X0hHsl35@mtg.de"
style="width:126px; margin-left: 6px"></a>
<span style="font-size: small; color: rgb(93, 93, 95);">
<a href="https://www.itsa365.de/de-de/companies/m/mtg-ag"
title="Info itsa365 2023" target="_blank" rel="“noopener"
noreferrer"="">
<img data-filename="itsa.png"
src="cid:part2.Muum0MoZ.HexvTRfO@mtg.de"
style="width:83px; margin-left: 60px"></a></span></font>
<span style="font-size: small; color: rgb(93, 93, 95);">
<!--a href="https://www.mtg.de/de/aktuelles/Hannover-Messe-2021-IT-Security-fuer-das-IoT/" title="Mehr Informationen" target="_blank"><strong>Mehr Informationen</strong></a -->
</span><br>
<br>
</font>
<p style="line-height: 1.2;"><font face="Arial">
<span style="font-size: x-small; color: rgb(93, 93, 95);">
MTG AG - Dolivostr. 11 - 64293 Darmstadt, Germany<br>
Commercial register: HRB 8901<br>
Register Court: Amtsgericht Darmstadt<br>
Management Board: Jürgen Ruf (CEO), Tamer Kemeröz<br>
Chairman of the Supervisory Board: Dr. Thomas Milde<br>
<br>
This email may contain confidential and/or privileged
information. If you are not the correct recipient or have
received this email in error,
<br>
please inform the sender immediately and delete this email.
Unauthorised copying or distribution of this email is not
permitted.<br>
<br>
Data protection information: <a
href="https://www.mtg.de/en/privacy-policy"
title="MTG Privacy policy" target="_blank">Privacy policy</a>
</span></font></p>
</div>
</body>
</html>