CryptoSys API Library Manual
cipherStreamInit
Initialize the CIPHERSTREAM context ready for repeated operations of cipherStreamUpdate.
Syntax
[VBA]
Public Function cipherStreamInit ( _
lpKey() As Byte, _
lpIV() As Byte, _
nOptions As Long, _
Optional nCounter As Long = 0 _
) As Long
Parameters
- lpKey
- Key.
- lpIV
- Initialization Vector (IV, nonce). Use an empty array for Arcfour.
- nOptions
- Algorithm to be used. Select one from:
API_SC_ARCFOUR
API_SC_SALSA20
API_SC_CHACHA20
- nCounter
- Counter value for ChaCha20 only, otherwise ignored.
Return Value
Long: Nonzero handle of the CIPHERSTREAM context, or zero if an error occurs.
Remarks
Arcfour: any length key; use an empty array for IV.
Salsa20: key must be exactly 16 or 32 bytes and IV exactly 8 bytes long.
ChaCha20: key must be exactly 16 or 32 bytes and IV exactly 8, 12, or 16 bytes long. Counter is ignored if IV is 16 bytes.
Note different order of parameters from core function.