<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libcrypto/rc4/rc4.c, branch OPENBSD_7_9</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2025-08-17T08:04:25+00:00</updated>
<entry>
<title>Further simplify the rc4 implementation.</title>
<updated>2025-08-17T08:04:25+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2025-08-17T08:04:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c9f6ed45b268d1c6b5608ff56379e3b051625806'/>
<id>urn:sha1:c9f6ed45b268d1c6b5608ff56379e3b051625806</id>
<content type='text'>
The RC4_CHUNK related code is intended to process native word sized
chunks if the input and output are naturally aligned. However, RC4_CHUNK
is currently a mess of machine dependent defines.

Replace this with uint64_t on all architectures - 64 bit architectures will
be happy with this and on 32 bit architectures the compiler can decompose
this into multiple 32 bit operations. Provide separate rc4_chunk()
implementations for big and little endian, since not all architectures
have a byte swap instruction that would make this a cheap conversion.

Thanks to gkoehler@ and tb@ for testing on big endian.

ok tb@
</content>
</entry>
<entry>
<title>Clean up parts of rc4.</title>
<updated>2025-08-14T14:55:43+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2025-08-14T14:55:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=3d3d845569e98c5b0f11899e4958cca728c8b99a'/>
<id>urn:sha1:3d3d845569e98c5b0f11899e4958cca728c8b99a</id>
<content type='text'>
Provide a static inline rc4_step() function that replaces the near
identical RC4_STEP and RC4_LOOP macros. Simplify the processing loop and
use for loops with small constants, which the compiler can unroll if it
wants to do so.

Inline the SK_LOOP macro in rc4_set_key_internal(), also using a small loop
that the compiler will most likely unroll.

ok tb@
</content>
</entry>
<entry>
<title>Mop up RC4_INDEX.</title>
<updated>2025-01-27T14:02:32+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2025-01-27T14:02:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=d97873f8db01cd052f45675db2ed3d9584c93c44'/>
<id>urn:sha1:d97873f8db01cd052f45675db2ed3d9584c93c44</id>
<content type='text'>
The RC4_INDEX define switches between base pointer indexing and per-byte
pointer increment. This supposedly made a huge difference to performance
on x86 at some point, however compilers have improved somewhat since then.
There is no change (or effectively no change) in generated assembly on
a the majority of LLVM platforms and even when there is some change
(e.g. aarch64), there is no noticable performance difference.

Simplify the (still messy) macros/code and mop up RC4_INDEX.

ok tb@
</content>
</entry>
<entry>
<title>Provide and use crypto_arch.h.</title>
<updated>2024-08-11T13:02:39+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-08-11T13:02:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5dcef2b3ea9eb7ace8ed74c27534785fc0b87130'/>
<id>urn:sha1:5dcef2b3ea9eb7ace8ed74c27534785fc0b87130</id>
<content type='text'>
Provide a per architecture crypto_arch.h - this will be used in a similar
manner to bn_arch.h and will allow for architecture specific #defines and
static inline functions. Move the HAVE_AES_* and HAVE_RC4_* defines here.

ok tb@
</content>
</entry>
<entry>
<title>Use static inline for rc4_set_key_internal().</title>
<updated>2024-03-28T12:11:26+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-03-28T12:11:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=e45946a7bbb9930880549017ee5a85918edc1d00'/>
<id>urn:sha1:e45946a7bbb9930880549017ee5a85918edc1d00</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Hide symbols in RC4</title>
<updated>2024-03-28T08:18:13+00:00</updated>
<author>
<name>joshua</name>
<email></email>
</author>
<published>2024-03-28T08:18:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=f62594c39479115536dfc56a66c3f22e527f1c38'/>
<id>urn:sha1:f62594c39479115536dfc56a66c3f22e527f1c38</id>
<content type='text'>
ok jsing tb beck
</content>
</entry>
<entry>
<title>Use C functions for RC4 public API.</title>
<updated>2024-03-28T01:49:29+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-03-28T01:49:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=ee4f7c5caf1aa306d0a5b443f5c9133ae646925b'/>
<id>urn:sha1:ee4f7c5caf1aa306d0a5b443f5c9133ae646925b</id>
<content type='text'>
Rather than having public API switch between C and assembly, always
use C functions as entry points, which then call an assembly
implementation (if available). This makes it significantly easier
to deal with symbol aliasing/namespaces and it also means we
benefit from vulnerability prevention provided by the C compiler.

Rename the assembly generated functions from RC4() to rc4_internal()
and RC4_set_key() to rc4_set_key_internal(). Always include rc4.c
and change it to use defines that are similar to those used in BN.

ok beck@ joshua@ tb@
</content>
</entry>
<entry>
<title>Consolidate rc4 code.</title>
<updated>2024-03-27T12:54:42+00:00</updated>
<author>
<name>jsing</name>
<email></email>
</author>
<published>2024-03-27T12:54:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=0a0f5acdc5ba55ea5be44178642a216b3c020186'/>
<id>urn:sha1:0a0f5acdc5ba55ea5be44178642a216b3c020186</id>
<content type='text'>
Discussed with tb@
</content>
</entry>
<entry>
<title>Remove meat which either duplicates code found in apps/, or is only of value</title>
<updated>2014-04-22T20:31:38+00:00</updated>
<author>
<name>miod</name>
<email></email>
</author>
<published>2014-04-22T20:31:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=ccd10d4d23f7a3754a02c017e32f26716e75824a'/>
<id>urn:sha1:ccd10d4d23f7a3754a02c017e32f26716e75824a</id>
<content type='text'>
for 20th century historians, and can be put in the Attic.
</content>
</entry>
<entry>
<title>resolve conflicts</title>
<updated>2008-09-06T12:17:54+00:00</updated>
<author>
<name>djm</name>
<email></email>
</author>
<published>2008-09-06T12:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=6b62d1fdd8a4fd35acfcc0c4bb1bf8b757fa8cda'/>
<id>urn:sha1:6b62d1fdd8a4fd35acfcc0c4bb1bf8b757fa8cda</id>
<content type='text'>
</content>
</entry>
</feed>
