summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_oaep.c
diff options
context:
space:
mode:
authorjsing <>2022-02-19 15:59:12 +0000
committerjsing <>2022-02-19 15:59:12 +0000
commit25a9629e43e037feecbfc10137ec9671aac8194a (patch)
tree0d7dce316bfd02d76d70207678ebbaff2d3d10b6 /src/lib/libcrypto/rsa/rsa_oaep.c
parent486359b287c701ccfeaf658337192a78b563e4b4 (diff)
downloadopenbsd-25a9629e43e037feecbfc10137ec9671aac8194a.tar.gz
openbsd-25a9629e43e037feecbfc10137ec9671aac8194a.tar.bz2
openbsd-25a9629e43e037feecbfc10137ec9671aac8194a.zip
Reduce memmoves in memory BIOs.
Currently, a read/write memory BIO pulls up the data via memmove() on each read. This becomes very expensive when a lot of small reads are performed, especially if there is a reasonable amount of data stored in the memory BIO. Instead, store a read offset into the buffer and only perform a memmove() to pull up the data on a write, if we have read more than 4096 bytes. This way we only perform memmove() when the space saving will potentially be of benefit, while avoiding frequent memmove() in the case of small interleaved reads and writes. Should address oss-fuzz #19881. ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_oaep.c')
0 files changed, 0 insertions, 0 deletions