Replies: 1 comment 2 replies
-
Hi, thanks for the question. Without going into details, the big thing I notice is that you're using The Give |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the question. Without going into details, the big thing I notice is that you're using The Give |
Beta Was this translation helpful? Give feedback.
-
I'm trying to create a keystream class that inherits from
ConstBitStream
. (Yes, I know, "don't roll your own crypto", this is purely for experiments...).This is what I've come up with so far:
You can then create an instance with
KeyStreamAes256(key, iv)
and either use thecipher
method to implement a stream cipher, or consume bits from the key stream usingread
etc.The problem is I've had to fiddle with
__new__
and__init__
quite a bit to get this working, and the type checker (pylance) is still not happy.Also, this depends on bitstring internals (
_datastore
) and is likely to break. In fact this likely doesn't work with the latest version, I'm using version 4.0.2.So my question comes down to this: What is the proper way to create an endless
ConstBitStream
where I can supply the bit stream on demand?Beta Was this translation helpful? Give feedback.
All reactions