615 Public method to perform the encryption operation. |
615 Public method to perform the encryption operation. |
616 |
616 |
617 @param input data to be encrypted (bytes) |
617 @param input data to be encrypted (bytes) |
618 @param mode mode of operation (0, 1 or 2) |
618 @param mode mode of operation (0, 1 or 2) |
619 @param key key to be used (bytes) |
619 @param key key to be used (bytes) |
620 @param size length of the key (integer) |
620 @param size length of the key (16, 24 or 32) |
621 @param IV initialisation vector (bytearray) |
621 @param IV initialisation vector (bytearray) |
622 @return tuple with mode of operation, length of the input and |
622 @return tuple with mode of operation, length of the input and |
623 the encrypted data (integer, integer, bytes) |
623 the encrypted data (integer, integer, bytes) |
624 """ |
624 """ |
625 if len(key) % size: |
625 if len(key) % size: |
707 @param input data to be encrypted (bytes) |
707 @param input data to be encrypted (bytes) |
708 @param originalsize unencrypted string length (required for CBC) |
708 @param originalsize unencrypted string length (required for CBC) |
709 (integer) |
709 (integer) |
710 @param mode mode of operation (0, 1 or 2) |
710 @param mode mode of operation (0, 1 or 2) |
711 @param key key to be used (bytes) |
711 @param key key to be used (bytes) |
712 @param size length of the key (integer) |
712 @param size length of the key (16, 24 or 32) |
713 @param IV initialisation vector (bytearray) |
713 @param IV initialisation vector (bytearray) |
714 @return decrypted data (bytes) |
714 @return decrypted data (bytes) |
715 """ |
715 """ |
716 if len(key) % size: |
716 if len(key) % size: |
717 raise ValueError("Illegal size ({0}) for key '{1}'.".format( |
717 raise ValueError("Illegal size ({0}) for key '{1}'.".format( |