source: asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/misc.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 2.5 KB
Line 
1/* misc.h
2 *
3 * Copyright (C) 2006-2017 wolfSSL Inc.
4 *
5 * This file is part of wolfSSL.
6 *
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20 */
21
22
23
24#ifndef WOLF_CRYPT_MISC_H
25#define WOLF_CRYPT_MISC_H
26
27
28#include <wolfssl/wolfcrypt/types.h>
29
30
31#ifdef __cplusplus
32 extern "C" {
33#endif
34
35
36#ifdef NO_INLINE
37WOLFSSL_LOCAL
38word32 rotlFixed(word32, word32);
39WOLFSSL_LOCAL
40word32 rotrFixed(word32, word32);
41
42WOLFSSL_LOCAL
43word32 ByteReverseWord32(word32);
44WOLFSSL_LOCAL
45void ByteReverseWords(word32*, const word32*, word32);
46
47WOLFSSL_LOCAL
48void XorWords(wolfssl_word*, const wolfssl_word*, word32);
49WOLFSSL_LOCAL
50void xorbuf(void*, const void*, word32);
51
52WOLFSSL_LOCAL
53void ForceZero(const void*, word32);
54
55WOLFSSL_LOCAL
56int ConstantCompare(const byte*, const byte*, int);
57
58#ifdef WORD64_AVAILABLE
59WOLFSSL_LOCAL
60word64 rotlFixed64(word64, word64);
61WOLFSSL_LOCAL
62word64 rotrFixed64(word64, word64);
63
64WOLFSSL_LOCAL
65word64 ByteReverseWord64(word64);
66WOLFSSL_LOCAL
67void ByteReverseWords64(word64*, const word64*, word32);
68#endif /* WORD64_AVAILABLE */
69
70#ifndef WOLFSSL_HAVE_MIN
71 #if defined(HAVE_FIPS) && !defined(min) /* so ifdef check passes */
72 #define min min
73 #endif
74 WOLFSSL_LOCAL word32 min(word32 a, word32 b);
75#endif
76
77#ifndef WOLFSSL_HAVE_MAX
78 #if defined(HAVE_FIPS) && !defined(max) /* so ifdef check passes */
79 #define max max
80 #endif
81 WOLFSSL_LOCAL word32 max(word32 a, word32 b);
82#endif /* WOLFSSL_HAVE_MAX */
83
84
85void c32to24(word32 in, word24 out);
86void c16toa(word16 u16, byte* c);
87void c32toa(word32 u32, byte* c);
88void c24to32(const word24 u24, word32* u32);
89void ato16(const byte* c, word16* u16);
90void ato24(const byte* c, word32* u24);
91void ato32(const byte* c, word32* u32);
92word32 btoi(byte b);
93
94#endif /* NO_INLINE */
95
96
97#ifdef __cplusplus
98 } /* extern "C" */
99#endif
100
101
102#endif /* WOLF_CRYPT_MISC_H */
103
Note: See TracBrowser for help on using the repository browser.