]> www.average.org Git - pam_pcsc_cr.git/blob - crypto.c
83ba4efd1d35d0ae618f6cd0f1353b0568075b83
[pam_pcsc_cr.git] / crypto.c
1 #include "crypto.h"
2 #include "crypto_if.h"
3
4 extern struct crypto_interface ossl_crypto_if;
5 extern struct crypto_interface tom_crypto_if;
6
7 static struct crypto_interface *active = &ossl_crypto_if;
8
9 int encrypt(void *pt, int ptlen, void *key, int keylen, void *ct, int *ctlen)
10 {
11         return active->encrypt(pt, ptlen, key, keylen, ct, ctlen);
12 }
13
14 int decrypt(void *ct, int ctlen, void *key, int keylen, void *pt, int *ptlen)
15 {
16         return active->decrypt(ct, ctlen, key, keylen, pt, ptlen);
17 }
18
19 int hash(void *pt, int ptlen, void *tag, int *taglen)
20 {
21         return active->hash(pt, ptlen, tag, taglen);
22 }
23
24 int hmac(void *pt, int ptlen, void *key, int keylen, void *tag, int *taglen)
25 {
26         return active->hmac(pt, ptlen, key, keylen, tag, taglen);
27 }
28