Exemplo n.º 1
0
def add(cp1, cp2, size):
    _check_params(len(cp1), size)

    if len(cp1) != len(cp2):
        raise error("Lengths should be the same")

    rv = ffi.new("char[]", len(cp1))
    lib.add(rv, cp1, cp2, len(cp1), size)
    return ffi.buffer(rv)[:]
Exemplo n.º 2
0
def add(cp1, cp2, size):
    _check_params(len(cp1), size)

    if len(cp1) != len(cp2):
        raise error("Lengths should be the same")

    rv = ffi.new("unsigned char[]", len(cp1))
    lib.add(rv, cp1, cp2, len(cp1), size)
    return ffi.buffer(rv)[:]