<s> """<STR_LIT>""" <EOL> from Crypto . Cipher import AES <EOL> from Crypto . Util import Counter <EOL> class AES_CTR_128 ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , key , iv , counter_wraparound = False ) : <EOL> """<STR_LIT>""" <EOL> assert ( len ( key ) == <NUM_LIT:16> ) <EOL> assert ( len ( iv ) == <NUM_LIT:16> ) <EOL> self . ctr = Counter . new ( <NUM_LIT> , initial_value = long ( iv . encode ( '<STR_LIT>' ) , <NUM_LIT:16> ) , <EOL> allow_wraparound = counter_wraparound ) <EOL> self . cipher = AES . new ( key , AES . MODE_CTR , counter = self . ctr ) <EOL> def crypt ( self , data ) : <EOL> """<STR_LIT>""" <EOL> return self . cipher . encrypt ( data ) </s>
