Richard Levitte 8c0098a8de Move keccak1600_asm_src file information to build.info files há 5 anos atrás
..
aes cd42b9e9c2 Move aes_asm_src file information to build.info files há 5 anos atrás
aria 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
asn1 6aa2e59e1c Add d2i_KeyParams/i2d_KeyParams API's. há 5 anos atrás
async 9f5a87fd66 add an additional async notification communication method based on callback há 5 anos atrás
bf 053d0b2226 Move bf_asm_src file information to build.info files há 5 anos atrás
bio a2e520447e Move a fall through comment há 5 anos atrás
blake2 7ed66e2634 Change EVP_MAC method from copy to dup há 5 anos atrás
bn d9dfeb940c Move bn_asm_src file information to build.info files há 5 anos atrás
buffer 0c4fa1f10d Following the license change, modify the boilerplates in crypto/buffer/ há 5 anos atrás
camellia 94707b0b68 Move cmll_asm_src file information to build.info files há 5 anos atrás
cast e698cfe445 Move cast_asm_src file information to build.info files há 5 anos atrás
chacha bcb7afe18a Move chacha_asm_src file information to build.info files há 5 anos atrás
cmac 7ed66e2634 Change EVP_MAC method from copy to dup há 5 anos atrás
cmp 8869ad4a39 Certificate Management Protocol (CMP, RFC 4210) extension to OpenSSL há 5 anos atrás
cms 19e512a824 Add the content type attribute to additional CMS signerinfo. há 5 anos atrás
comp 48f66f8115 Following the license change, modify the boilerplates in crypto/comp/ há 5 anos atrás
conf f4a96507fb crypto/conf: openssl_config_int() returns unitialized value há 5 anos atrás
crmf 8869ad4a39 Certificate Management Protocol (CMP, RFC 4210) extension to OpenSSL há 5 anos atrás
ct 5477e84273 Following the license change, modify the boilerplates in crypto/ct/ há 5 anos atrás
des d67d04f378 Move des_asm_src file information to build.info files há 5 anos atrás
dh 9aaecbfc98 TLS1.3 FFDHE Support há 5 anos atrás
dsa cd4c83b524 The SHA256 is not a mandatory digest for DSA. há 5 anos atrás
dso 31b6ed76df Rework DSO API conditions and configuration option há 5 anos atrás
ec aa76ff26ce Move ec_asm_src file information to build.info files há 5 anos atrás
engine 21d9856986 Coverity CID 1444957: Error handling issues há 5 anos atrás
err 9aaecbfc98 TLS1.3 FFDHE Support há 5 anos atrás
ess 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION há 5 anos atrás
evp 07c244f0cd Use variables in build.info files where it's worth the while há 5 anos atrás
gmac 7ed66e2634 Change EVP_MAC method from copy to dup há 5 anos atrás
hmac 7ed66e2634 Change EVP_MAC method from copy to dup há 5 anos atrás
idea aa2d9a76b4 Following the license change, modify the boilerplates in crypto/idea/ há 5 anos atrás
include da0d114cd9 Convert drbg_lib to use OPENSSL_CTX for its global data há 5 anos atrás
kdf f0efeea29e PBKDF2 updates to conform to SP800-132 há 5 anos atrás
kmac 7ed66e2634 Change EVP_MAC method from copy to dup há 5 anos atrás
lhash 319e518a5a Make some EVP code available from within the FIPS module há 5 anos atrás
md2 4911f55362 Following the license change, modify the boilerplates in crypto/mdN/ há 5 anos atrás
md4 4911f55362 Following the license change, modify the boilerplates in crypto/mdN/ há 5 anos atrás
md5 792ea008af Move md5_asm_src file information to build.info files há 5 anos atrás
mdc2 2bcb0fc862 Following the license change, modify the boilerplates in crypto/mdc2/ há 5 anos atrás
modes a9bb7e9270 Move modes_asm_src file information to build.info files há 5 anos atrás
objects 53bfacf220 Fix GOST OID há 5 anos atrás
ocsp 878dc8dd95 Join the x509 and x509v3 directories há 5 anos atrás
pem 8cf85d4899 Fix the allocation size in EVP_OpenInit and PEM_SignFinal há 5 anos atrás
perlasm 3062468b0a s390x assembly pack: update perlasm module há 5 anos atrás
pkcs12 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION há 5 anos atrás
pkcs7 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION há 5 anos atrás
poly1305 246b50605f Move poly1305_asm_src file information to build.info files há 5 anos atrás
property 07c244f0cd Use variables in build.info files where it's worth the while há 5 anos atrás
rand a08714e181 Revert the DEVRANDOM_WAIT feature há 5 anos atrás
rc2 5e4435a760 Following the license change, modify the boilerplates in crypto/rcN/ há 5 anos atrás
rc4 6b90902faf Move rc4_asm_src file information to build.info files há 5 anos atrás
rc5 6fe56d8470 Move rc5_asm_src file information to build.info files há 5 anos atrás
ripemd 2ffea44322 Move rmd160_asm_src file information to build.info files há 5 anos atrás
rsa 70b0b977f7 Change default RSA, DSA and DH size to 2048 bit há 5 anos atrás
seed 39c44eee7f Following the license change, modify the boilerplates in crypto/seed/ há 5 anos atrás
sha 8c0098a8de Move keccak1600_asm_src file information to build.info files há 5 anos atrás
siphash 7ed66e2634 Change EVP_MAC method from copy to dup há 5 anos atrás
sm2 8267becb8b Support SM2 certificate verification há 5 anos atrás
sm3 d5e5e2ffaf Move digests to providers há 5 anos atrás
sm4 f9f859adc6 Following the license change, modify the boilerplates in crypto/smN/ há 5 anos atrás
srp df4439186f Remove unnecessary trailing whitespace há 5 anos atrás
stack 3593266d1c Make core code available within the FIPS module há 5 anos atrás
store 5c0d0c86af Following the license change, modify the boilerplates in crypto/store/ há 5 anos atrás
ts 9fdcc21fdc constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION há 5 anos atrás
txt_db 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
ui 5c8b7b4caa Cleanup vxworks support to be able to compile for VxWorks 7 há 5 anos atrás
whrlpool 681c7e905d Move wp_asm_src file information to build.info files há 5 anos atrás
x509 bab6046146 Replace BIO_printf with ASN1_STRING_print in GENERAL_NAME_print há 5 anos atrás
LPdir_nyi.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
LPdir_unix.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
LPdir_vms.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
LPdir_win.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
LPdir_win32.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
LPdir_wince.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
README.sparse_array a40f0f6475 Add sparse array data type. há 5 anos atrás
alphacpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
arm64cpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
arm_arch.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
armcap.c 5f40dd158c crypto/armcap.c, crypto/ppccap.c: stricter use of getauxval() há 5 anos atrás
armv4cpuid.pl 3405db97e5 ARM assembly pack: make it Windows-friendly. há 5 anos atrás
bsearch.c 5c3f1e34b5 ossl_bsearch(): New generic internal binary search utility function há 5 anos atrás
build.info 6e1ba47219 Move cpuid_asm_src file information to build.info files há 5 anos atrás
c64xpluscpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
context.c 3593266d1c Make core code available within the FIPS module há 5 anos atrás
core_fetch.c 2ccb1b4eca EVP fetching: make operation_id part of the method identity há 5 anos atrás
core_namemap.c f2182a4e6f Create internal number<->name mapping API há 5 anos atrás
cpt_err.c 1aedc35fd6 Instead of global data store it in an OPENSSL_CTX há 5 anos atrás
cryptlib.c df4439186f Remove unnecessary trailing whitespace há 5 anos atrás
ctype.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
cversion.c 47ca833835 Add the possibility to display and use MODULESDIR há 5 anos atrás
dllmain.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
ebcdic.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
ex_data.c 1f76076095 Coverity CID 1444951: Null pointer dereferences há 5 anos atrás
getenv.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
ia64cpuid.S 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
info.c 0109e030db Add a way for the application to get OpenSSL configuration data há 5 anos atrás
init.c a2f27fd750 Move the rand_nonce_lock code into drbg_lib.c há 5 anos atrás
mem.c 9efa0ae0b6 Create a FIPS provider and put SHA256 in it há 5 anos atrás
mem_clr.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
mem_dbg.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
mem_sec.c 61783db5b5 Use vxRandLib for VxWorks7 há 5 anos atrás
mips_arch.h 1b9c5f2e2f Fix compiling error for mips32r6 and mips64r6 há 5 anos atrás
o_dir.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
o_fips.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
o_fopen.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
o_init.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
o_str.c e3b35d2b29 openssl_strerror_r: Fix handling of GNU strerror_r há 5 anos atrás
o_time.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
params.c 9830e7ea42 Params conversion tests. há 5 anos atrás
pariscid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
ppc_arch.h c8f370485c PPC: Try out if mftb works before using it há 5 anos atrás
ppccap.c 55a9ca5cc5 crypto/ppccap.c: Fix FIPS build on PPC há 5 anos atrás
ppccpuid.pl c8f370485c PPC: Try out if mftb works before using it há 5 anos atrás
provider.c 24626a47fb Constify OSSL_PROVIDER getter input parameters há 5 anos atrás
provider_conf.c 71849dff56 Rename the PROVIDER_CONF trace to CONF há 5 anos atrás
provider_core.c e7706e63e6 Replumbing: offer a core upcall to get the provider object's library context há 5 anos atrás
provider_local.h c41f3ae0d9 Replumbing: Add a mechanism to pre-populate the provider store há 5 anos atrás
provider_predefined.c 3593266d1c Make core code available within the FIPS module há 5 anos atrás
s390x_arch.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
s390xcap.c 61d7045bd2 fix --strict-warnings build há 5 anos atrás
s390xcpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
sparc_arch.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
sparccpuid.S 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
sparcv9cap.c 41525ed628 Ensure we get all the right defines for AES assembler in FIPS module há 5 anos atrás
sparse_array.c 8ab53b193a Make the sparse array code use ossl_uintmax_t as its index rather than size_t. há 5 anos atrás
threads_none.c 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
threads_pthread.c 3593266d1c Make core code available within the FIPS module há 5 anos atrás
threads_win.c 09305a7d0a Avoid linking error for InitializeCriticalSectionAndSpinCount(). há 5 anos atrás
trace.c bc362b9b72 Convert the ENGINE_CONF trace calls to use CONF instead há 5 anos atrás
uid.c aefb980c45 crypto/uid.c: use own macro as guard rather than AT_SECURE há 5 anos atrás
vms_rms.h 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
x86_64cpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás
x86cpuid.pl 0e9725bcb9 Following the license change, modify the boilerplates in crypto/ há 5 anos atrás

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.