'PHP libsodium change predefined constant
I am trying to change the below libsoium predefined constant
SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES
from 12 to 20 and I am unable to find where this is being set or even better how I can set it at run time.
I searched my entire server for any possible ini files to no avail.
Any tips greatly appreciated.
PS: There is also no docs for configuration changes https://www.php.net/manual/en/sodium.configuration.php
Solution 1:[1]
In case someone would need to do this, the only way I managed to work around it is by including the sodium compat library and tweak that one instead of the native one that comes with php.
Find CRYPTO_AEAD_AES256GCM_NPUBBYTES and change it from 12 to 20
const CRYPTO_AEAD_AES256GCM_NPUBBYTES = 20;
in file sodium_compat/Compat.php
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Oliver M Grech |
