libsodium WAS working fine but now I managed to break it and can't find how to unbreak it.
Amazon AWS Ubuntu Xenial, libsodium18 installed, php-sodium from Ondrej Sury PPA installed but instead of working I now get:
Undefined constant 'Sodium\CRYPTO_SECRETBOX_NONCEBYTES'
The annoying thing is it's fine in Zesty but there's no stable AWS Zesty image still. I'm sure I've just forgotten some simple thing but it's just ceased working.
Found it.
PHP sodium function names have changed so instead of calling \Sodium\crypto_secretbox_open() you now have to call sodium_crypto_secretbox_open()
I seriously hope this post helps someone avoid the grief I've had in the last 24 hours wondering what I'd *^&%'d up - it might well be the only thing on the internet actually pointing this change out that Google finds...
The revised function names and constants are all listed at https://paragonie.com/book/pecl-libsodium/read/01-quick-start.md