<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux-compat/src/crypto, branch master</title>
<subtitle>WireGuard kernel module backport for Linux 3.10 - 5.5</subtitle>
<id>https://git.zx2c4.com/wireguard-linux-compat/atom/src/crypto?h=master</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux-compat/atom/src/crypto?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/'/>
<updated>2021-12-13T16:25:37Z</updated>
<entry>
<title>crypto: curve25519-x86_64: use in/out register constraints more precisely</title>
<updated>2021-12-13T16:25:37Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2021-12-13T16:25:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=273018b7eaccf2f8d146c00f21db7dbd9678bd43'/>
<id>urn:sha1:273018b7eaccf2f8d146c00f21db7dbd9678bd43</id>
<content type='text'>
Rather than passing all variables as modified, pass ones that are only
read into that parameter. This helps with old gcc versions when
alternatives are additionally used, and lets gcc's codegen be a little
bit more efficient. This also syncs up with the latest Vale/EverCrypt
output.

This also forward ports 3c9f3b6 ("crypto: curve25519-x86_64: solve
register constraints with reserved registers").

Cc: Aymeric Fromherz &lt;aymeric.fromherz@inria.fr&gt;
Cc: Mathias Krause &lt;minipli@grsecurity.net&gt;
Link: https://lore.kernel.org/wireguard/1554725710.1290070.1639240504281.JavaMail.zimbra@inria.fr/
Link: https://github.com/project-everest/hacl-star/pull/501
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>crypto: curve25519-x86_64: solve register constraints with reserved registers</title>
<updated>2021-12-06T21:47:01Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@grsecurity.net</email>
</author>
<published>2021-07-06T13:27:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=3c9f3b6997fe8cbb5e7b80ea5d622b5d0e827003'/>
<id>urn:sha1:3c9f3b6997fe8cbb5e7b80ea5d622b5d0e827003</id>
<content type='text'>
The register constraints for the inline assembly in fsqr() and fsqr2()
are pretty tight on what the compiler may assign to the remaining three
register variables. The clobber list only allows the following to be
used: RDI, RSI, RBP and R12. With RAP reserving R12 and a kernel having
CONFIG_FRAME_POINTER=y, claiming RBP, there are only two registers left
so the compiler rightfully complains about impossible constraints.

Provide alternatives that'll allow a memory reference for 'out' to solve
the allocation constraint dilemma for this configuration.

Also make 'out' an input-only operand as it is only used as such. This
not only allows gcc to optimize its usage further, but also works around
older gcc versions, apparently failing to handle multiple alternatives
correctly, as in failing to initialize the 'out' operand with its input
value.

Signed-off-by: Mathias Krause &lt;minipli@grsecurity.net&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>compat: remove unused version.h headers</title>
<updated>2021-02-07T15:11:33Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2021-02-07T15:11:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=897b4b9152d3680da1db4c380aaa48a52313c680'/>
<id>urn:sha1:897b4b9152d3680da1db4c380aaa48a52313c680</id>
<content type='text'>
We don't need this in all files, and it just complicates things.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>crypto: do not export symbols</title>
<updated>2020-04-15T04:18:27Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2020-04-15T04:18:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=52978fcc265c472773b0b334d31705573ae8cb98'/>
<id>urn:sha1:52978fcc265c472773b0b334d31705573ae8cb98</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>curve25519-x86_64: avoid use of r12</title>
<updated>2020-02-19T20:48:13Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2018-08-06T22:31:24Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=118398c1c6540d44a070266cf3a39c5077775c8e'/>
<id>urn:sha1:118398c1c6540d44a070266cf3a39c5077775c8e</id>
<content type='text'>
This causes problems with RAP and KERNEXEC for PaX, as r12 is a
reserved register.

It also leads to a more compact instruction encoding, saving about 100
cycles.

Suggested-by: PaX Team &lt;pageexec@freemail.hu&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>chacha20poly1305: defensively protect against large inputs</title>
<updated>2020-02-06T11:45:34Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2020-02-06T11:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=a7e4885d83a33ad1f857df1b9d68abafe49378f3'/>
<id>urn:sha1:a7e4885d83a33ad1f857df1b9d68abafe49378f3</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>curve25519: x86_64: replace with formally verified implementation</title>
<updated>2020-01-21T15:07:52Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2020-01-21T15:07:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=55df79c6c08e31f24370f3ddc69e37729b4c5676'/>
<id>urn:sha1:55df79c6c08e31f24370f3ddc69e37729b4c5676</id>
<content type='text'>
This comes from INRIA's HACL*/Vale. It implements the same algorithm and
implementation strategy as the code it replaces, only this code has been
formally verified, sans the base point multiplication, which uses code
similar to prior, only it uses the formally verified field arithmetic
alongside reproducable ladder generation steps. This doesn't have a
pure-bmi2 version, which means haswell no longer benefits, but the
increased (doubled) code complexity is not worth it for a single
generation of chips that's already old.

Performance-wise, this is around 1% slower on older microarchitectures,
and slightly faster on newer microarchitectures, mainly 10nm ones or
backports of 10nm to 14nm. This implementation is "everest" below:

Xeon E5-2680 v4 (Broadwell)

 armfazh: 133340 cycles per call
 everest: 133436 cycles per call

Xeon Gold 5120 (Sky Lake Server)

 armfazh: 112636 cycles per call
 everest: 113906 cycles per call

Core i5-6300U (Sky Lake Client)

 armfazh: 116810 cycles per call
 everest: 117916 cycles per call

Core i7-7600U (Kaby Lake)

 armfazh: 119523 cycles per call
 everest: 119040 cycles per call

Core i7-8750H (Coffee Lake)

 armfazh: 113914 cycles per call
 everest: 113650 cycles per call

Core i9-9880H (Coffee Lake Refresh)

 armfazh: 112616 cycles per call
 everest: 114082 cycles per call

Core i3-8121U (Cannon Lake)

 armfazh: 113202 cycles per call
 everest: 111382 cycles per call

Core i7-8265U (Whiskey Lake)

 armfazh: 127307 cycles per call
 everest: 127697 cycles per call

Core i7-8550U (Kaby Lake Refresh)

 armfazh: 127522 cycles per call
 everest: 127083 cycles per call

Xeon Platinum 8275CL (Cascade Lake)

 armfazh: 114380 cycles per call
 everest: 114656 cycles per call

Achieving these kind of results with formally verified code is quite
remarkable, especialy considering that performance is favorable for
newer chips.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>global: fix up spelling</title>
<updated>2019-12-12T11:24:05Z</updated>
<author>
<name>Josh Soref</name>
<email>jsoref@gmail.com</email>
</author>
<published>2019-12-10T16:22:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=11a71b7d6971750a8892e1b18eb8688d91e48fe8'/>
<id>urn:sha1:11a71b7d6971750a8892e1b18eb8688d91e48fe8</id>
<content type='text'>
Signed-off-by: Josh Soref &lt;jsoref@gmail.com&gt;
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>chacha20poly1305: double check the sgmiter logic with test</title>
<updated>2019-12-06T17:03:23Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2019-12-06T17:03:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=9a0ace85312fc8c4b69e98c00552839b2756c77b'/>
<id>urn:sha1:9a0ace85312fc8c4b69e98c00552839b2756c77b</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
<entry>
<title>crypto: use new assembler macros for 5.5</title>
<updated>2019-12-05T14:27:37Z</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2019-12-05T14:27:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux-compat/commit/?id=6d9a9aa29b77a22f4de2e56b815639e06a876b48'/>
<id>urn:sha1:6d9a9aa29b77a22f4de2e56b815639e06a876b48</id>
<content type='text'>
Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
</content>
</entry>
</feed>
