GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
hash-wrappers.c
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2016-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 // The hash functions are provided by gnulib. We don't include gnulib
24 // headers directly in Octave's C++ source files to avoid problems that
25 // may be caused by the way that gnulib overrides standard library
26 // functions.
27 
28 #if defined (HAVE_CONFIG_H)
29 # include "config.h"
30 #endif
31 
32 #include "md2.h"
33 #include "md4.h"
34 #include "md5.h"
35 #include "sha1.h"
36 #include "sha256.h"
37 #include "sha512.h"
38 
39 #include "hash-wrappers.h"
40 
41 int octave_md2_digest_size (void) { return MD2_DIGEST_SIZE; }
42 int octave_md4_digest_size (void) { return MD4_DIGEST_SIZE; }
43 int octave_md5_digest_size (void) { return MD5_DIGEST_SIZE; }
44 int octave_sha1_digest_size (void) { return SHA1_DIGEST_SIZE; }
45 int octave_sha224_digest_size (void) { return SHA224_DIGEST_SIZE; }
46 int octave_sha256_digest_size (void) { return SHA256_DIGEST_SIZE; }
47 int octave_sha384_digest_size (void) { return SHA384_DIGEST_SIZE; }
48 int octave_sha512_digest_size (void) { return SHA512_DIGEST_SIZE; }
49 
50 void *
51 octave_md2_buffer_wrapper (const char *buf, size_t len, void *res)
52 {
53  return md2_buffer (buf, len, res);
54 }
55 
56 void *
57 octave_md4_buffer_wrapper (const char *buf, size_t len, void *res)
58 {
59  return md4_buffer (buf, len, res);
60 }
61 
62 void *
63 octave_md5_buffer_wrapper (const char *buf, size_t len, void *res)
64 {
65  return md5_buffer (buf, len, res);
66 }
67 
68 void *
69 octave_sha1_buffer_wrapper (const char *buf, size_t len, void *res)
70 {
71  return sha1_buffer (buf, len, res);
72 }
73 
74 void *
75 octave_sha224_buffer_wrapper (const char *buf, size_t len, void *res)
76 {
77  return sha224_buffer (buf, len, res);
78 }
79 
80 void *
81 octave_sha256_buffer_wrapper (const char *buf, size_t len, void *res)
82 {
83  return sha256_buffer (buf, len, res);
84 }
85 
86 void *
87 octave_sha384_buffer_wrapper (const char *buf, size_t len, void *res)
88 {
89  return sha384_buffer (buf, len, res);
90 }
91 
92 void *
93 octave_sha512_buffer_wrapper (const char *buf, size_t len, void *res)
94 {
95  return sha512_buffer (buf, len, res);
96 }
int octave_md4_digest_size(void)
Definition: hash-wrappers.c:42
int octave_sha224_digest_size(void)
Definition: hash-wrappers.c:45
void * octave_sha256_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:81
int octave_sha512_digest_size(void)
Definition: hash-wrappers.c:48
int octave_md5_digest_size(void)
Definition: hash-wrappers.c:43
void * octave_sha512_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:93
void * octave_md4_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:57
void * octave_sha224_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:75
int octave_sha256_digest_size(void)
Definition: hash-wrappers.c:46
void * octave_sha1_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:69
int octave_md2_digest_size(void)
Definition: hash-wrappers.c:41
int octave_sha1_digest_size(void)
Definition: hash-wrappers.c:44
void * octave_md5_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:63
void * octave_sha384_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:87
int octave_sha384_digest_size(void)
Definition: hash-wrappers.c:47
void * octave_md2_buffer_wrapper(const char *buf, size_t len, void *res)
Definition: hash-wrappers.c:51