safeclib
safec libc extension with all C11 Annex K functions (by rurban)
memset_benchmark
This repository contains high-performance implementations of memset and memcpy in assembly. (by nadavrot)
safeclib | memset_benchmark | |
---|---|---|
8 | 11 | |
311 | 296 | |
- | - | |
7.0 | 1.8 | |
17 days ago | over 2 years ago | |
C | Assembly | |
GNU General Public License v3.0 or later | - |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
safeclib
Posts with mentions or reviews of safeclib.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-05-22.
-
LLVM's Libc Gets Much Faster memcpy For RISC-V
Of course assembler spezializations are an anti-pattern, because the optimizer should be fixed to do it much better. Better C code is often 2x faster than hand optimized assembler.
Eg my C memcpy with inlined and vectorized clang beats glibc or gcc memcpy in assembler easily. https://github.com/rurban/safeclib/blob/master/tests/perf_me...
-
Site with common coding mistakes that cause security threats with code examples?
+1 This along with https://github.com/rurban/safeclib (and its forks/derivatives).
- Safeclib – C11 Annex K implementation
-
What are the major dialects of C nowadays?
I have yet to look into Annex K. It didn't seem to gain much traction. Some people at Red Hat wrote a field experience report about it. I recently discovered an implementation of Annex K functions that claims to be pretty portable, safeclib.
-
memmove_s?
See my testsuite and remarks at https://github.com/rurban/safeclib/blob/master/doc/libc-overview.md , esp. towards the windows implementation
- Why does Windows 10 run faster than Fedora?
-
A 100LOC C impl of memset, that is faster than glibc's
I do it because nobody else implemented a secure memset. What they call secure is just avoiding that the compiler ignores it. A secure memset also cleans the caches with a memory barrier, so that meltdown cannot read it.
explicit_bzero and it's numerous variants are not only insecure, but also slow. (byte wise!)
Only safelibc has a secure memset_s. https://github.com/rurban/safeclib/blob/master/tests/perf_me...
memset_benchmark
Posts with mentions or reviews of memset_benchmark.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-11-28.
-
Function multi-versioning in GCC 6 (2016)
mem* do not need to be called via ifunc. That is a toolchain decision. See e.g. https://github.com/nadavrot/memset_benchmark for recent data about the cost of PLT indirection for small copies.
- Optimising Memset and Memcpy
- Fast Memset and Memcpy implementations
-
A 100LOC C impl of memset, that is faster than glibc's
Probably poorly. It is a violation to cast an unaligned pointer to an aligned type. And the code looks like it does just that right here: https://github.com/nadavrot/memset_benchmark/blob/main/src/l...
This is undefined behavior under C99 §6.3.2.3 Paragraph 7.
-
A faster implementation of memset in 100 LOC
I was impressed by the notion until I saw the code...
What are some alternatives?
When comparing safeclib and memset_benchmark you can also consider the following projects:
qemu
gcc
fancy-memset - small, fast memset based on microsoft's design
libu8ident - unicode security guidelines for identifiers
libnbd
copies-and-fills
llvm-project - The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
fancy-memcmp - small, fast memcmp
nbdkit
safeclib vs qemu
memset_benchmark vs gcc
safeclib vs gcc
memset_benchmark vs fancy-memset
safeclib vs libu8ident
memset_benchmark vs libnbd
safeclib vs fancy-memset
memset_benchmark vs qemu
safeclib vs copies-and-fills
memset_benchmark vs llvm-project
safeclib vs fancy-memcmp
memset_benchmark vs nbdkit