From: LABBE Corentin <clabbe.montjoie@gmail.com>
To: davem@davemloft.net, herbert@gondor.apana.org.au
Cc: LABBE Corentin <clabbe.montjoie@gmail.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 7/8] crypto: testmgr: Constify tested key/iv/plaintext/digest
Date: Tue, 20 Oct 2015 09:34:03 +0200 [thread overview]
Message-ID: <1445326444-11019-8-git-send-email-clabbe.montjoie@gmail.com> (raw)
In-Reply-To: <1445326444-11019-1-git-send-email-clabbe.montjoie@gmail.com>
All key/iv/plaintext/digest in testmgr are constant data.
Furthermore the testmgr will never modify thoses data.
This patch set all members of xxx_testvec as pointer to const.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
crypto/testmgr.h | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 64b8a80..03b2f19 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -37,9 +37,9 @@
struct hash_testvec {
/* only used with keyed hash algorithms */
- char *key;
- char *plaintext;
- char *digest;
+ const char *key;
+ const char *plaintext;
+ const char *digest;
unsigned char tap[MAX_TAP];
unsigned short psize;
unsigned char np;
@@ -65,10 +65,10 @@ struct hash_testvec {
*/
struct cipher_testvec {
- char *key;
- char *iv;
- char *input;
- char *result;
+ const char *key;
+ const char *iv;
+ const char *input;
+ const char *result;
unsigned short tap[MAX_TAP];
int np;
unsigned char also_non_np;
@@ -80,11 +80,11 @@ struct cipher_testvec {
};
struct aead_testvec {
- char *key;
- char *iv;
- char *input;
- char *assoc;
- char *result;
+ const char *key;
+ const char *iv;
+ const char *input;
+ const char *assoc;
+ const char *result;
unsigned char tap[MAX_TAP];
unsigned char atap[MAX_TAP];
int np;
@@ -99,10 +99,10 @@ struct aead_testvec {
};
struct cprng_testvec {
- char *key;
- char *dt;
- char *v;
- char *result;
+ const char *key;
+ const char *dt;
+ const char *v;
+ const char *result;
unsigned char klen;
unsigned short dtlen;
unsigned short vlen;
@@ -126,7 +126,7 @@ struct drbg_testvec {
};
struct akcipher_testvec {
- unsigned char *key;
+ const unsigned char *key;
unsigned char *m;
unsigned char *c;
unsigned int key_len;
--
2.4.10
next prev parent reply other threads:[~2015-10-20 7:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 7:33 [PATCH v2] crypto: add precalculated hash for zero message length LABBE Corentin
2015-10-20 7:33 ` [PATCH 1/8] crypto: hash: add zero length message hash for shax and md5 LABBE Corentin
2015-10-20 7:33 ` [PATCH 2/8] crypto: niagara: Use precalculated hash from headers LABBE Corentin
2015-11-17 9:51 ` Herbert Xu
2015-10-20 7:33 ` [PATCH 3/8] crypto: ccp: " LABBE Corentin
2015-10-22 18:18 ` Tom Lendacky
2015-10-20 7:34 ` [PATCH 4/8] crypto: ux500: " LABBE Corentin
2015-10-21 3:12 ` kbuild test robot
2015-10-20 7:34 ` [PATCH 5/8] crypto: akcipher: fix typos in include/crypto/akcipher.h LABBE Corentin
2015-10-20 7:57 ` Stephan Mueller
2015-10-20 7:34 ` [PATCH 6/8] crypto: akcipher: the key parameter must be const u8 * LABBE Corentin
2015-11-17 9:52 ` Herbert Xu
2015-10-20 7:34 ` LABBE Corentin [this message]
2015-10-20 7:34 ` [PATCH 8/8] crypto: testmgr: Use the xxx_zero_message_hash from headers LABBE Corentin
2015-11-17 9:56 ` Herbert Xu
-- strict thread matches above, loose matches on Subject: below --
2015-10-12 16:53 [PATCH] crypto: add precalculated hash for zero message length LABBE Corentin
2015-10-12 16:53 ` [PATCH 7/8] crypto: testmgr: Constify tested key/iv/plaintext/digest LABBE Corentin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445326444-11019-8-git-send-email-clabbe.montjoie@gmail.com \
--to=clabbe.montjoie@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®