(self, input)
| 53 | return OpenSSL.rand(cipher.get_blocksize()) |
| 54 | |
| 55 | def update(self, input): |
| 56 | i = OpenSSL.c_int(0) |
| 57 | buffer = OpenSSL.malloc(b"", len(input) + self.cipher.get_blocksize()) |
| 58 | inp = OpenSSL.malloc(input, len(input)) |
| 59 | if OpenSSL.EVP_CipherUpdate(self.ctx, OpenSSL.byref(buffer), |
| 60 | OpenSSL.byref(i), inp, len(input)) == 0: |
| 61 | raise Exception("[OpenSSL] EVP_CipherUpdate FAIL ...") |
| 62 | return buffer.raw[0:i.value] |
| 63 | |
| 64 | def final(self): |
| 65 | i = OpenSSL.c_int(0) |
no test coverage detected