Closed gurpreet- closed 6 years ago
The "detached" variants return two items at a time.
For example, the function cryptoBoxDetached(cipher[], mac[], message[]...) populates a cipher[] and a mac[].
cryptoBoxDetached(cipher[], mac[], message[]...)
cipher[]
mac[]
I suppose we could do something like:
cryptoBoxDetached(String cipher, String mac, String message...); saveToDatabase(cipher); saveToDatabase(mac);
But it's not clear what's happening, what's being manipulated and what you provide as initial values for cipher and mac.
cipher
mac
Or we could do something like:
class Detached { byte[] cipher; byte[] mac; } Detached detached = cryptoBoxDetached(...); detached.getCipher(); detached.getMac();
Which I believe is a lot better. Whichever one we choose, it will mean some breaking changes.
This has been sorted in 83dc7d82bcaaefdc4a3ddd0bf3930f61924bd5cc, with the creation of DetachedDecrypt and DetachedEncrypt to manage the mac, cipher and message.
DetachedDecrypt
DetachedEncrypt
message
The "detached" variants return two items at a time.
For example, the function
cryptoBoxDetached(cipher[], mac[], message[]...)
populates acipher[]
and amac[]
.I suppose we could do something like:
But it's not clear what's happening, what's being manipulated and what you provide as initial values for
cipher
andmac
.Or we could do something like:
Which I believe is a lot better. Whichever one we choose, it will mean some breaking changes.