Welcome to little lamb

Code » limb » release » tree

[release] / src / liblimb / memxor.h / memxor3.c

/* This file is part of limb                           https://lila.oss/limb
 * Copyright (C) 2023 Olivier Brunel                          jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include <string.h>
#include <limb/memxor.h>

void
memxor3(void *dst, const void *src1, const void *src2, size_t len)
{
    size_t off = ALIGN_OFFSET(src1);

    if (off) {
        memcpy(dst, src1, len);
        memxor(dst, src2, len);
    } else {
        memcpy(dst, src2, len);
        memxor(dst, src1, len);
    }
}