haskell-crypto / cryptonite

lowlevel set of cryptographic primitives for haskell
Other
226 stars 139 forks source link

What's the equivalent of "RC4.update(..)" of other libraries in cryptonite? #321

Closed GildedHonour closed 4 years ago

GildedHonour commented 4 years ago

In Elixir or Erlang one can do:

rc4stream = :crypto.crypto_init(:rc4, bin_data, true)           # encrypt -> true
encoded_bin_data = :crypto.crypto_update(rc4stream, bin_data2)

https://erlang.org/doc/man/crypto.html#crypto_update-2

In cryptonite there're these operations:

a) initialize - clear b) combine and c) generate - unclear

Which, b or c, is equivalent of crypto_update ?

Also, both of them return (State, ba). Which of those variables contain the output?