6 /////////////////////////////////////////////////////////////////////////////
8 // File: util_xor_arrays.c
10 // Copyright S. Brennen Ball, 2010
12 // The author provides no guarantees, warantees, or promises, implied or
13 // otherwise. By using this software you agree to indemnify the author
14 // of any damages incurred by using it.
16 /////////////////////////////////////////////////////////////////////////////
18 /////////////////////////////////////////////////////////////////////////////
19 // This library is free software; you can redistribute it and/or
20 // modify it under the terms of the GNU Lesser General Public
21 // License as published by the Free Software Foundation; either
22 // version 2.1 of the License, or (at your option) any later version.
24 // This library is distributed in the hope that it will be useful,
25 // but WITHOUT ANY WARRANTY; without even the implied warranty of
26 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 // Lesser General Public License for more details.
29 // You should have received a copy of the GNU Lesser General Public
30 // License along with this library; if not, write to the Free Software
31 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
32 /////////////////////////////////////////////////////////////////////////////
36 #define __TARG_FUNC_POSTDECL __reentrant
38 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
40 // void util_xor_arrays(const uint8_t * input_block_a, const uint8_t * input_block_b, uint8_t * output_block, const uint16_t len) __TARG_FUNC_POSTDECL
45 // Parameters (when using for pre-encryption):
46 // const uint8_t * input_block_a - input block A
47 // const uint8_t * input_block_b - input block B
48 // uint8_t * output_block - output block
49 // uint16_t len - number of bytes to XOR
54 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
55 void util_xor_arrays(const uint8_t * input_block_a
, const uint8_t * input_block_b
, uint8_t * output_block
, const uint16_t len
) __TARG_FUNC_POSTDECL
59 for(i
= 0; i
< len
; i
++)
61 output_block
[i
] = input_block_a
[i
] ^ input_block_b
[i
];
65 /* compiling util_xor_arrays gave the following error due to target out of range for cjne
66 Error: <a> machine specific addressing or addressing mode error */