def find_c_prime_at_index(self, ciphertext: bytearray, index: int):
    if (not isinstance(ciphertext, bytearray)):
        raise PaddownException(f'ciphertext not an instance of {bytearray}')
    ciphertext_temp = ciphertext
    for c_prime in range(256):
        ciphertext_temp[index] = c_prime
        if self.has_valid_padding(ciphertext_temp):
            return c_prime
    raise PaddownException(f'No valid padding found, is .has_valid_padding(...) implemented correctly?')
def find_c_prime_at_index(self, ciphertext: bytearray, index: int):
    if (not isinstance(ciphertext, bytearray)):
        raise PaddownException(f'ciphertext not an instance of {bytearray}')
    ciphertext_temp = ciphertext
    for c_prime in range(256):
        ciphertext_temp[index] = c_prime
        if self.has_valid_padding(ciphertext_temp):
            return c_prime
    raise PaddownException(f'No valid padding found, is .has_valid_padding(...) implemented correctly?')