forked from ryancdotorg/threshcrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crypt.h
34 lines (29 loc) · 1.55 KB
/
crypt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* threshcrypt crypt.h
* Copyright 2012 Ryan Castellucci <code@ryanc.org>
* This software is published under the terms of the Simplified BSD License.
* Please see the 'COPYING' file for details.
*/
#ifndef THRESHCRYPT_CRYPT_H_
#define THRESHCRYPT_CRYPT_H_
#define encrypt_data(idat, odat, sz, mk, ks, nh, hs) \
crypt_data(idat, odat, sz, mk, ks, nh, NULL, hs, NULL, MODE_ENCRYPT)
#define decrypt_data(idat, odat, sz, mk, ks, ch, hs) \
crypt_data(idat, odat, sz, mk, ks, NULL, ch, hs, NULL, MODE_DECRYPT)
#define encrypt_block(idat, odat, sz, mk, ks, nh, hs, iv) \
crypt_data(idat, odat, sz, mk, ks, nh, NULL, hs, &iv, MODE_ENCRYPT)
#define decrypt_block(idat, odat, sz, mk, ks, ch, hs, iv) \
crypt_data(idat, odat, sz, mk, ks, NULL, ch, hs, &iv, MODE_DECRYPT)
int crypt_data(const unsigned char *, unsigned char *, size_t,
const unsigned char *, size_t, unsigned char *,
const unsigned char *, size_t, unsigned char **, int);
int hmac_vrfymem(int, const unsigned char *, unsigned long,
const unsigned char *, unsigned long,
const unsigned char *, unsigned long *);
#define pbkdf2_vrfy(a, b, c, d, e, f, g, h) \
_pbkdf2_vrfy(a, b, c, d, e, f, g, (unsigned long *)h)
int _pbkdf2_vrfy(const unsigned char *, unsigned long,
const unsigned char *, unsigned long,
int, int,
const unsigned char *, unsigned long *);
/* vim: set ts=2 sw=2 et ai si: */
#endif /* THRESHCRYPT_CRYPT_H_ */