summaryrefslogtreecommitdiff
path: root/sys/crypto
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2003-02-15 22:58:00 +0000
committerJason Wright <jason@cvs.openbsd.org>2003-02-15 22:58:00 +0000
commit1f48542324310c7bb07bae5b7d6252f09c7bfbe1 (patch)
treeab7583984448c2873dd3cad5be1757cb05976c26 /sys/crypto
parent4a0dddfd01348e3c2a7f9b347673233797e055d7 (diff)
skeleton support for LZS compression
Diffstat (limited to 'sys/crypto')
-rw-r--r--sys/crypto/cryptodev.h5
-rw-r--r--sys/crypto/xform.c19
-rw-r--r--sys/crypto/xform.h4
3 files changed, 24 insertions, 4 deletions
diff --git a/sys/crypto/cryptodev.h b/sys/crypto/cryptodev.h
index 5e6dd370f10..8cc9ccc1690 100644
--- a/sys/crypto/cryptodev.h
+++ b/sys/crypto/cryptodev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.h,v 1.36 2003/02/15 18:55:50 jason Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.37 2003/02/15 22:57:58 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -94,7 +94,8 @@
#define CRYPTO_SHA1 14
#define CRYPTO_DEFLATE_COMP 15 /* Deflate compression algorithm */
#define CRYPTO_NULL 16
-#define CRYPTO_ALGORITHM_MAX 16 /* Keep updated - see below */
+#define CRYPTO_LZS_COMP 17 /* LZS compression algorithm */
+#define CRYPTO_ALGORITHM_MAX 17 /* Keep updated - see below */
#define CRYPTO_ALGORITHM_ALL (CRYPTO_ALGORITHM_MAX + 1)
diff --git a/sys/crypto/xform.c b/sys/crypto/xform.c
index f8d1ae58508..a1687fb607a 100644
--- a/sys/crypto/xform.c
+++ b/sys/crypto/xform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.c,v 1.20 2002/11/12 18:23:13 jason Exp $ */
+/* $OpenBSD: xform.c,v 1.21 2003/02/15 22:57:58 jason Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -95,6 +95,7 @@ int RMD160Update_int(void *, u_int8_t *, u_int16_t);
u_int32_t deflate_compress(u_int8_t *, u_int32_t, u_int8_t **);
u_int32_t deflate_decompress(u_int8_t *, u_int32_t, u_int8_t **);
+u_int32_t lzs_dummy(u_int8_t *, u_int32_t, u_int8_t **);
/* Encryption instances */
struct enc_xform enc_xform_des = {
@@ -226,6 +227,12 @@ struct comp_algo comp_algo_deflate = {
deflate_decompress
};
+struct comp_algo comp_algo_lzs = {
+ CRYPTO_DEFLATE_COMP, "LZS",
+ 90, lzs_dummy,
+ lzs_dummy
+};
+
/*
* Encryption wrapper routines.
*/
@@ -478,3 +485,13 @@ deflate_decompress(data, size, out)
{
return deflate_global(data, size, 1, out);
}
+
+u_int32_t
+lzs_dummy(data, size, out)
+ u_int8_t *data;
+ u_int32_t size;
+ u_int8_t **out;
+{
+ *out = NULL;
+ return (0);
+}
diff --git a/sys/crypto/xform.h b/sys/crypto/xform.h
index a44b6102a55..330e6931a35 100644
--- a/sys/crypto/xform.h
+++ b/sys/crypto/xform.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.h,v 1.11 2002/11/12 18:23:13 jason Exp $ */
+/* $OpenBSD: xform.h,v 1.12 2003/02/15 22:57:58 jason Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -84,4 +84,6 @@ extern struct auth_hash auth_hash_hmac_sha1_96;
extern struct auth_hash auth_hash_hmac_ripemd_160_96;
extern struct comp_algo comp_algo_deflate;
+extern struct comp_algo comp_algo_lzs;
+
#endif /* _CRYPTO_XFORM_H_ */