summaryrefslogtreecommitdiff
path: root/lib/libcrypto/modes
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-06-12 15:49:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-06-12 15:49:32 +0000
commit49a392b36834a2c852c7913eca64b1663500622a (patch)
treec526d22b9e2f914670ee1207fe73124442677cfd /lib/libcrypto/modes
parentdba886c38cea7b6970051b037308699d853bc83b (diff)
tags as requested by miod and tedu
Diffstat (limited to 'lib/libcrypto/modes')
-rw-r--r--lib/libcrypto/modes/cbc128.c1
-rw-r--r--lib/libcrypto/modes/ccm128.c1
-rw-r--r--lib/libcrypto/modes/cfb128.c1
-rw-r--r--lib/libcrypto/modes/ctr128.c1
-rw-r--r--lib/libcrypto/modes/cts128.c1
-rw-r--r--lib/libcrypto/modes/gcm128.c1
-rw-r--r--lib/libcrypto/modes/modes.h77
-rw-r--r--lib/libcrypto/modes/modes_lcl.h1
-rw-r--r--lib/libcrypto/modes/ofb128.c1
-rw-r--r--lib/libcrypto/modes/xts128.c1
10 files changed, 86 insertions, 0 deletions
diff --git a/lib/libcrypto/modes/cbc128.c b/lib/libcrypto/modes/cbc128.c
index e4920a93ac2..74fcdbe6e3c 100644
--- a/lib/libcrypto/modes/cbc128.c
+++ b/lib/libcrypto/modes/cbc128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: cbc128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2008 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/ccm128.c b/lib/libcrypto/modes/ccm128.c
index 13bc7adf31d..241e3a97084 100644
--- a/lib/libcrypto/modes/ccm128.c
+++ b/lib/libcrypto/modes/ccm128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: ccm128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2011 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/cfb128.c b/lib/libcrypto/modes/cfb128.c
index 731cb2864aa..593c337e8b7 100644
--- a/lib/libcrypto/modes/cfb128.c
+++ b/lib/libcrypto/modes/cfb128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: cfb128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2008 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/ctr128.c b/lib/libcrypto/modes/ctr128.c
index ab45e0bd7a0..d08437214c3 100644
--- a/lib/libcrypto/modes/ctr128.c
+++ b/lib/libcrypto/modes/ctr128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: ctr128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2008 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/cts128.c b/lib/libcrypto/modes/cts128.c
index 37bd05ed294..e34989adc1a 100644
--- a/lib/libcrypto/modes/cts128.c
+++ b/lib/libcrypto/modes/cts128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: cts128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2008 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/gcm128.c b/lib/libcrypto/modes/gcm128.c
index 09b1949c2a1..45951878e58 100644
--- a/lib/libcrypto/modes/gcm128.c
+++ b/lib/libcrypto/modes/gcm128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: gcm128.c,v 1.8 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2010 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/modes.h b/lib/libcrypto/modes/modes.h
index af8d97d7958..a532cb3f412 100644
--- a/lib/libcrypto/modes/modes.h
+++ b/lib/libcrypto/modes/modes.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: modes.h,v 1.2 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2008 The OpenSSL Project. All rights reserved.
*
@@ -15,6 +16,14 @@ typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], int enc);
+typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ const unsigned char ivec[16]);
+
+typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out,
+ size_t blocks, const void *key,
+ const unsigned char ivec[16],unsigned char cmac[16]);
+
void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], block128_f block);
@@ -27,6 +36,11 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
unsigned char ivec[16], unsigned char ecount_buf[16],
unsigned int *num, block128_f block);
+void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], unsigned char ecount_buf[16],
+ unsigned int *num, ctr128_f ctr);
+
void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], int *num,
@@ -57,3 +71,66 @@ size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], cbc128_f cbc);
+
+size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], block128_f block);
+size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const void *key,
+ unsigned char ivec[16], cbc128_f cbc);
+
+typedef struct gcm128_context GCM128_CONTEXT;
+
+GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
+void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block);
+void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
+ size_t len);
+int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
+ size_t len);
+int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len);
+int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len);
+int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len, ctr128_f stream);
+int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
+ const unsigned char *in, unsigned char *out,
+ size_t len, ctr128_f stream);
+int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag,
+ size_t len);
+void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
+void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
+
+typedef struct ccm128_context CCM128_CONTEXT;
+
+void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
+ unsigned int M, unsigned int L, void *key,block128_f block);
+int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx,
+ const unsigned char *nonce, size_t nlen, size_t mlen);
+void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx,
+ const unsigned char *aad, size_t alen);
+int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx,
+ const unsigned char *inp, unsigned char *out, size_t len);
+int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx,
+ const unsigned char *inp, unsigned char *out, size_t len);
+int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx,
+ const unsigned char *inp, unsigned char *out, size_t len,
+ ccm128_f stream);
+int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx,
+ const unsigned char *inp, unsigned char *out, size_t len,
+ ccm128_f stream);
+size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
+
+typedef struct xts128_context XTS128_CONTEXT;
+
+int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
+ const unsigned char *inp, unsigned char *out, size_t len, int enc);
diff --git a/lib/libcrypto/modes/modes_lcl.h b/lib/libcrypto/modes/modes_lcl.h
index a53333df3d7..eacb253e26a 100644
--- a/lib/libcrypto/modes/modes_lcl.h
+++ b/lib/libcrypto/modes/modes_lcl.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: modes_lcl.h,v 1.7 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2010 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/ofb128.c b/lib/libcrypto/modes/ofb128.c
index 147c80c5498..031110a274e 100644
--- a/lib/libcrypto/modes/ofb128.c
+++ b/lib/libcrypto/modes/ofb128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: ofb128.c,v 1.3 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2008 The OpenSSL Project. All rights reserved.
*
diff --git a/lib/libcrypto/modes/xts128.c b/lib/libcrypto/modes/xts128.c
index 9dcd16885d4..177bde03fa2 100644
--- a/lib/libcrypto/modes/xts128.c
+++ b/lib/libcrypto/modes/xts128.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: xts128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 2011 The OpenSSL Project. All rights reserved.
*