]> www.average.org Git - pam_pcsc_cr.git/blob - crypto.h
configure.ac: remove sanitizer by default
[pam_pcsc_cr.git] / crypto.h
1 /*
2 Copyright (c) 2013 Eugene Crosser
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12     1. The origin of this software must not be misrepresented; you must
13     not claim that you wrote the original software. If you use this
14     software in a product, an acknowledgment in the product documentation
15     would be appreciated but is not required.
16
17     2. Altered source versions must be plainly marked as such, and must
18     not be misrepresented as being the original software.
19
20     3. This notice may not be removed or altered from any source
21     distribution.
22 */
23
24 #ifndef _CRYPTO_H
25 #define _CRYPTO_H
26
27 int select_crypto_if(const int ifno);
28 const char *crypto_init(const int ifno);
29 unsigned long encrypt(const void *key, const size_t keylen, const void *pt, void *ct, const size_t tlen);
30 unsigned long decrypt(const void *key, const size_t keylen, const void *ct, void *pt, const size_t tlen);
31 unsigned long hash(const void *pt, const size_t tlen, void *tag, size_t *taglen);
32 unsigned long hmac(const void *key, const size_t keylen, const void *pt, const size_t tlen,
33                         void *tag, size_t *taglen);
34 const char *crypto_errstr(const unsigned long err);
35
36 #define HASHSIZE 20
37 #define CBLKSIZE 16
38
39 #endif