[openssh-commits] [openssh] 01/01: Resync more with OpenBSD's rijndael.c, in particular "#if 0"-ing out some unused code. Should fix compile error reported by plautrba at redhat.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Dec 10 02:09:59 EST 2014


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 4bfad14ca56f8ae04f418997816b4ba84e2cfc3c
Author: Darren Tucker <dtucker at zip.com.au>
Date:   Wed Dec 10 02:12:51 2014 +1100

    Resync more with OpenBSD's rijndael.c, in particular "#if 0"-ing out some
    unused code.  Should fix compile error reported by plautrba at redhat.
---
 rijndael.c | 40 ++++++----------------------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

diff --git a/rijndael.c b/rijndael.c
index 91ef513..0f81a1b 100644
--- a/rijndael.c
+++ b/rijndael.c
@@ -708,25 +708,20 @@ rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits)
 	return 0;
 }
 
+#if 0
 /**
  * Expand the cipher key into the decryption key schedule.
  *
  * @return	the number of rounds for the given cipher key size.
  */
 int
-rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits,
-    int have_encrypt)
+rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits)
 {
 	int Nr, i, j;
 	u32 temp;
 
 	/* expand the cipher key: */
-	if (have_encrypt > 0) {
-		/* Already done */
-		Nr = have_encrypt;
-	} else {
-		Nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits);
-	}
+	Nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits);
 
 	/* invert the order of the round keys: */
 	for (i = 0, j = 4*Nr; i < j; i += 4, j -= 4) {
@@ -761,6 +756,7 @@ rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits,
 	}
 	return Nr;
 }
+#endif
 
 void
 rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16],
@@ -946,6 +942,7 @@ rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16],
 	PUTU32(ct + 12, s3);
 }
 
+#if 0
 static void
 rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16],
     u8 pt[16])
@@ -1129,29 +1126,4 @@ rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16],
    		rk[3];
 	PUTU32(pt + 12, s3);
 }
-
-void
-rijndael_set_key(rijndael_ctx *ctx, u_char *key, int bits, int do_encrypt)
-{
-	ctx->Nr = rijndaelKeySetupEnc(ctx->ek, key, bits);
-	if (do_encrypt) {
-		ctx->decrypt = 0;
-		memset(ctx->dk, 0, sizeof(ctx->dk));
-	} else {
-		ctx->decrypt = 1;
-		memcpy(ctx->dk, ctx->ek, sizeof(ctx->dk));
-		rijndaelKeySetupDec(ctx->dk, key, bits, ctx->Nr);
-	}
-}
-
-void
-rijndael_decrypt(rijndael_ctx *ctx, u_char *src, u_char *dst)
-{
-	rijndaelDecrypt(ctx->dk, ctx->Nr, src, dst);
-}
-
-void
-rijndael_encrypt(rijndael_ctx *ctx, u_char *src, u_char *dst)
-{
-	rijndaelEncrypt(ctx->ek, ctx->Nr, src, dst);
-}
+#endif

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list