import random


def verification_transform(user_fingerprint, user_vcode, user_shuffle_code):
    """
    Performs transformation on the fingerprint feature vector
    required during verification.

    :param user_fingerprint: fingerprint feature vector
    :param user_vcode: verification code of the user
    :return: transformed fingerprint
    """
    # is not this same as enrollment_transform
    transformed_fingerprint = user_fingerprint + user_vcode
    transformed_fingerprint = [-2*n for n in transformed_fingerprint]
    sumOfYiSquare = sum(y*y for y in user_fingerprint)
    sumOfViSquare = sum(v*v for v in user_vcode)
    transformed_fingerprint.extend([sumOfYiSquare, sumOfViSquare, 1, 1])
    random.Random(user_shuffle_code).shuffle(transformed_fingerprint)
    return transformed_fingerprint