Richard Levitte 0109e030db Add a way for the application to get OpenSSL configuration data 5 år sedan
..
aes d6e4287c97 aes/asm/aesv8-armx.pl: ~20% improvement on ThunderX2. 5 år sedan
aria 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
asn1 6098b69e58 Move ASN1_BROKEN macros 5 år sedan
async 9f5a87fd66 add an additional async notification communication method based on callback 5 år sedan
bf 8b00b7b8b3 Following the license change, modify the boilerplates in crypto/bf/ 6 år sedan
bio d34bce03ac Add testing of RDONLY memory BIOs 5 år sedan
blake2 98f29466dc fix truncation of integers on 32bit AIX 5 år sedan
bn 3e3dcf9ab8 Call RSA generation callback at the correct time. 5 år sedan
buffer 0c4fa1f10d Following the license change, modify the boilerplates in crypto/buffer/ 6 år sedan
camellia 5593d9c952 Following the license change, modify the boilerplates in crypto/camellia/ 6 år sedan
cast a5024e0609 Following the license change, modify the boilerplates in crypto/cast/ 6 år sedan
chacha 86a7ac5e76 chacha/asm/chacha-armv8.pl: replace 3+1 code paths with 4+1. 5 år sedan
cmac 8de396f875 Following the license change, modify the boilerplates in crypto/cmac/ 6 år sedan
cms 0fc4d00a00 Change arg to cms_CompressedData_init_bio to be const 5 år sedan
comp 48f66f8115 Following the license change, modify the boilerplates in crypto/comp/ 6 år sedan
conf 23dc8feba8 Coverity: fix two minor NPD issues. 5 år sedan
crmf ce9b996409 replace 'OpenSSL license' by 'Apache License 2.0' 5 år sedan
ct 5477e84273 Following the license change, modify the boilerplates in crypto/ct/ 6 år sedan
des df4439186f Remove unnecessary trailing whitespace 5 år sedan
dh 2500c093aa Increase rounds of Miller-Rabin testing DH_check 5 år sedan
dsa ce1415ed2c Added NULL check to BN_clear() & BN_CTX_end() 5 år sedan
dso 31b6ed76df Rework DSO API conditions and configuration option 5 år sedan
ec 15972296af Fix calling convention bug in ecp_nistz256_ord_sqr_mont 5 år sedan
engine bc362b9b72 Convert the ENGINE_CONF trace calls to use CONF instead 5 år sedan
err 6caf7f3aec Create provider errors and use them 5 år sedan
ess 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 5 år sedan
evp 33b40a1027 If key or iv is NULL set the respective length to 0 5 år sedan
gmac 58efb32c8b Following the license change, modify the boilerplates in crypto/gmac/ 6 år sedan
hmac 48fdeca01d Don't allow SHAKE128/SHAKE256 with HMAC 5 år sedan
idea aa2d9a76b4 Following the license change, modify the boilerplates in crypto/idea/ 6 år sedan
include 718b133a53 Implement AES CBC ciphers in the default provider 5 år sedan
kdf 97cc9c9b01 Coverity: hkdf ENV_MD_size() is an int that can be negative 5 år sedan
kmac 97c213814b Update kmac.c 6 år sedan
lhash bcb5d42171 OPENSSL_LH_flush(): assign NULL after freeing 5 år sedan
md2 4911f55362 Following the license change, modify the boilerplates in crypto/mdN/ 6 år sedan
md4 4911f55362 Following the license change, modify the boilerplates in crypto/mdN/ 6 år sedan
md5 4911f55362 Following the license change, modify the boilerplates in crypto/mdN/ 6 år sedan
mdc2 2bcb0fc862 Following the license change, modify the boilerplates in crypto/mdc2/ 6 år sedan
modes 6465321e40 ARM64 assembly pack: add ThunderX2 results. 5 år sedan
objects 9537fe5757 Single step kdf implementation 5 år sedan
ocsp cc6d92619f Make OCSP_id_cmp and OCSP_id_issuer_cmp accept const params 5 år sedan
pem 8cf85d4899 Fix the allocation size in EVP_OpenInit and PEM_SignFinal 5 år sedan
perlasm e09633107b Check for unpaired .cfi_remember_state 5 år sedan
pkcs12 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 5 år sedan
pkcs7 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 5 år sedan
poly1305 6465321e40 ARM64 assembly pack: add ThunderX2 results. 5 år sedan
property 1393722af3 ossl_method_store_cache_get(): ensure non-NULL property query 5 år sedan
rand b8621bdde7 Fix bug in entropy gathering. 5 år sedan
rc2 5e4435a760 Following the license change, modify the boilerplates in crypto/rcN/ 6 år sedan
rc4 1039c78255 Build: correct assembler generation in crypto/rc4/build.info 5 år sedan
rc5 5e4435a760 Following the license change, modify the boilerplates in crypto/rcN/ 6 år sedan
ripemd 57946a26b6 Following the license change, modify the boilerplates in crypto/ripemd/ 6 år sedan
rsa ad7e17dd6c SP 800-56B steps enumerated. 5 år sedan
seed 39c44eee7f Following the license change, modify the boilerplates in crypto/seed/ 6 år sedan
sha 6465321e40 ARM64 assembly pack: add ThunderX2 results. 5 år sedan
siphash 134148276b Following the license change, modify the boilerplates in crypto/siphash/ 6 år sedan
sm2 8267becb8b Support SM2 certificate verification 5 år sedan
sm3 f9f859adc6 Following the license change, modify the boilerplates in crypto/smN/ 6 år sedan
sm4 f9f859adc6 Following the license change, modify the boilerplates in crypto/smN/ 6 år sedan
srp df4439186f Remove unnecessary trailing whitespace 5 år sedan
stack 4fc56f9022 Following the license change, modify the boilerplates in crypto/stack/ 6 år sedan
store 5c0d0c86af Following the license change, modify the boilerplates in crypto/store/ 6 år sedan
ts 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION 5 år sedan
txt_db 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
ui 5c8b7b4caa Cleanup vxworks support to be able to compile for VxWorks 7 5 år sedan
whrlpool 677c7ab9ea Following the license change, modify the boilerplates in crypto/whrlpool/ 6 år sedan
x509 ccf453610f Make X509_set_sm2_id consistent with other setters 5 år sedan
x509v3 86afd005fb remove 'keyid:' when printing simple X509 authority keyID (without issuer and serial) 5 år sedan
LPdir_nyi.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
LPdir_unix.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
LPdir_vms.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
LPdir_win.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
LPdir_win32.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
LPdir_wince.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
README.sparse_array a40f0f6475 Add sparse array data type. 5 år sedan
alphacpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
arm64cpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
arm_arch.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
armcap.c 5f40dd158c crypto/armcap.c, crypto/ppccap.c: stricter use of getauxval() 5 år sedan
armv4cpuid.pl 3405db97e5 ARM assembly pack: make it Windows-friendly. 5 år sedan
build.info 0109e030db Add a way for the application to get OpenSSL configuration data 5 år sedan
c64xpluscpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
context.c d64b62998b Add an OpenSSL library context 5 år sedan
core_fetch.c dc46e3dde5 Use the right NID when putting a method in the store 5 år sedan
cpt_err.c abbc2c4083 Replumbing: add a configuration module for providers 5 år sedan
cryptlib.c df4439186f Remove unnecessary trailing whitespace 5 år sedan
ctype.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
cversion.c 47ca833835 Add the possibility to display and use MODULESDIR 5 år sedan
dllmain.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
ebcdic.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
ex_data.c 23dc8feba8 Coverity: fix two minor NPD issues. 5 år sedan
getenv.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
ia64cpuid.S 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
info.c 0109e030db Add a way for the application to get OpenSSL configuration data 5 år sedan
init.c e3af453bac OPENSSL_init_crypto(): check config return code correctly 5 år sedan
mem.c 9efa0ae0b6 Create a FIPS provider and put SHA256 in it 5 år sedan
mem_clr.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
mem_dbg.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
mem_sec.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
mips_arch.h 1b9c5f2e2f Fix compiling error for mips32r6 and mips64r6 5 år sedan
o_dir.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
o_fips.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
o_fopen.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
o_init.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
o_str.c e3b35d2b29 openssl_strerror_r: Fix handling of GNU strerror_r 5 år sedan
o_time.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
params.c f55ed701a4 Params API: {utf8,octet}_ptr need to know the data size 5 år sedan
pariscid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
ppc_arch.h c8f370485c PPC: Try out if mftb works before using it 5 år sedan
ppccap.c a28e4890ee poly1305/asm/poly1305-ppc.pl: add vector base 2^26 implementation. 5 år sedan
ppccpuid.pl c8f370485c PPC: Try out if mftb works before using it 5 år sedan
provider.c 3374dc03ed Replumbing: New public API to load or add providers 5 år sedan
provider_conf.c 71849dff56 Rename the PROVIDER_CONF trace to CONF 5 år sedan
provider_core.c ac1055ef13 Replumbing: add functionality to set provider parameters 5 år sedan
provider_local.h c41f3ae0d9 Replumbing: Add a mechanism to pre-populate the provider store 5 år sedan
provider_predefined.c 8a73348be0 Add a skeleton default provider 5 år sedan
s390x_arch.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
s390xcap.c 61d7045bd2 fix --strict-warnings build 5 år sedan
s390xcpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
sparc_arch.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
sparccpuid.S 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
sparcv9cap.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
sparse_array.c 8ab53b193a Make the sparse array code use ossl_uintmax_t as its index rather than size_t. 5 år sedan
threads_none.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
threads_pthread.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
threads_win.c 09305a7d0a Avoid linking error for InitializeCriticalSectionAndSpinCount(). 5 år sedan
trace.c bc362b9b72 Convert the ENGINE_CONF trace calls to use CONF instead 5 år sedan
uid.c aefb980c45 crypto/uid.c: use own macro as guard rather than AT_SECURE 5 år sedan
vms_rms.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
x86_64cpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan
x86cpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ 6 år sedan

README.sparse_array

The sparse_array.c file contains an implementation of a sparse array that
attempts to be both space and time efficient.

The sparse array is represented using a tree structure. Each node in the
tree contains a block of pointers to either the user supplied leaf values or
to another node.

There are a number of parameters used to define the block size:

OPENSSL_SA_BLOCK_BITS Specifies the number of bits covered by each block
SA_BLOCK_MAX Specifies the number of pointers in each block
SA_BLOCK_MASK Specifies a bit mask to perform modulo block size
SA_BLOCK_MAX_LEVELS Indicates the maximum possible height of the tree

These constants are inter-related:
SA_BLOCK_MAX = 2 ^ OPENSSL_SA_BLOCK_BITS
SA_BLOCK_MASK = SA_BLOCK_MAX - 1
SA_BLOCK_MAX_LEVELS = number of bits in size_t divided by
OPENSSL_SA_BLOCK_BITS rounded up to the next multiple
of OPENSSL_SA_BLOCK_BITS

OPENSSL_SA_BLOCK_BITS can be defined at compile time and this overrides the
built in setting.

As a space and performance optimisation, the height of the tree is usually
less than the maximum possible height. Only sufficient height is allocated to
accommodate the largest index added to the data structure.

The largest index used to add a value to the array determines the tree height:

+----------------------+---------------------+
| Largest Added Index | Height of Tree |
+----------------------+---------------------+
| SA_BLOCK_MAX - 1 | 1 |
| SA_BLOCK_MAX ^ 2 - 1 | 2 |
| SA_BLOCK_MAX ^ 3 - 1 | 3 |
| ... | ... |
| size_t max | SA_BLOCK_MAX_LEVELS |
+----------------------+---------------------+

The tree height is dynamically increased as needed based on additions.

An empty tree is represented by a NULL root pointer. Inserting a value at
index 0 results in the allocation of a top level node full of null pointers
except for the single pointer to the user's data (N = SA_BLOCK_MAX for
breviety):

+----+
|Root|
|Node|
+-+--+
|
|
|
v
+-+-+---+---+---+---+
| 0 | 1 | 2 |...|N-1|
| |nil|nil|...|nil|
+-+-+---+---+---+---+
|
|
|
v
+-+--+
|User|
|Data|
+----+
Index 0


Inserting at element 2N+1 creates a new root node and pushes down the old root
node. It then creates a second second level node to hold the pointer to the
user's new data:

+----+
|Root|
|Node|
+-+--+
|
|
|
v
+-+-+---+---+---+---+
| 0 | 1 | 2 |...|N-1|
| |nil| |...|nil|
+-+-+---+-+-+---+---+
| |
| +------------------+
| |
v v
+-+-+---+---+---+---+ +-+-+---+---+---+---+
| 0 | 1 | 2 |...|N-1| | 0 | 1 | 2 |...|N-1|
|nil| |nil|...|nil| |nil| |nil|...|nil|
+-+-+---+---+---+---+ +---+-+-+---+---+---+
| |
| |
| |
v v
+-+--+ +-+--+
|User| |User|
|Data| |Data|
+----+ +----+
Index 0 Index 2N+1


The nodes themselves are allocated in a sparse manner. Only nodes which exist
along a path from the root of the tree to an added leaf will be allocated.
The complexity is hidden and nodes are allocated on an as needed basis.
Because the data is expected to be sparse this doesn't result in a large waste
of space.

Values can be removed from the sparse array by setting their index position to
NULL. The data structure does not attempt to reclaim nodes or reduce the
height of the tree on removal. For example, now setting index 0 to NULL would
result in:

+----+
|Root|
|Node|
+-+--+
|
|
|
v
+-+-+---+---+---+---+
| 0 | 1 | 2 |...|N-1|
| |nil| |...|nil|
+-+-+---+-+-+---+---+
| |
| +------------------+
| |
v v
+-+-+---+---+---+---+ +-+-+---+---+---+---+
| 0 | 1 | 2 |...|N-1| | 0 | 1 | 2 |...|N-1|
|nil|nil|nil|...|nil| |nil| |nil|...|nil|
+---+---+---+---+---+ +---+-+-+---+---+---+
|
|
|
v
+-+--+
|User|
|Data|
+----+
Index 2N+1


Accesses to elements in the sparse array take O(log n) time where n is the
largest element. The base of the logarithm is SA_BLOCK_MAX, so for moderately
small indices (e.g. NIDs), single level (constant time) access is achievable.
Space usage is O(minimum(m, n log(n)) where m is the number of elements in the
array.

Note: sparse arrays only include pointers to types. Thus, SPARSE_ARRAY_OF(char)
can be used to store a string.