/* CAO Compiler Copyright (C) 2014 Cryptography and Information Security Group, HASLab - INESC TEC and Universidade do Minho This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef CAO_SBITS_H #define CAO_SBITS_H #include "CAO_globals.h" #ifdef __cplusplus #include #include NTL_CLIENT typedef struct CAO_sbits_s { int size; ZZ *value; } CAO_sbits_s; extern "C" { #endif CAO_RES CAO_sbits_decl(CAO_sbits *, CAO_rint); CAO_RES CAO_sbits_init(CAO_sbits, const char *); CAO_RES CAO_sbits_assign(CAO_sbits, CAO_sbits); CAO_RES CAO_sbits_clone(CAO_sbits *, CAO_sbits); CAO_RES CAO_sbits_dispose(CAO_sbits); #define CAO_sbits_equal(a,b,c) a = _CAO_sbits_equal(b,c) CAO_bool _CAO_sbits_equal(CAO_sbits, CAO_sbits); #define CAO_sbits_nequal(a,b,c) a = _CAO_sbits_nequal(b,c) CAO_bool _CAO_sbits_nequal(CAO_sbits, CAO_sbits); CAO_RES CAO_ubits_not(CAO_ubits, CAO_ubits); CAO_RES CAO_sbits_or(CAO_sbits, CAO_sbits, CAO_sbits); CAO_RES CAO_sbits_xor(CAO_sbits, CAO_sbits, CAO_sbits); CAO_RES CAO_sbits_and(CAO_sbits, CAO_sbits, CAO_sbits); CAO_RES CAO_sbits_shift_up(CAO_sbits, CAO_sbits, CAO_rint); CAO_RES CAO_sbits_shift_down(CAO_sbits, CAO_sbits, CAO_rint); CAO_RES CAO_sbits_rot_up(CAO_sbits, CAO_sbits, CAO_rint); CAO_RES CAO_sbits_rot_down(CAO_sbits, CAO_sbits, CAO_rint); CAO_RES CAO_sbits_range_select(CAO_sbits, CAO_sbits, CAO_rint, CAO_rint); CAO_RES CAO_sbits_select(CAO_sbits, CAO_sbits, CAO_rint); CAO_RES CAO_sbits_range_set(CAO_sbits, CAO_sbits, CAO_rint, CAO_rint); CAO_RES CAO_sbits_set(CAO_sbits, CAO_sbits, CAO_rint); CAO_RES CAO_sbits_concat(CAO_sbits, CAO_sbits, CAO_ubits); CAO_RES CAO_sbits_dump(CAO_sbits); CAO_RES CAO_sbits_cast_int(CAO_int, CAO_sbits); CAO_RES CAO_int_cast_sbits(CAO_sbits, CAO_int); CAO_RES CAO_sbits_cast_sbits(CAO_ubits, CAO_ubits); #ifdef __cplusplus } #endif #endif