shithub: riscv

Download patch

ref: 768edd8f215e4576070170af6bfa4f6d83b8bc22
parent: 51135e37edff6e0cf928fababe1b27c6c48c1087
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jan 6 13:57:14 EST 2023

libsec: fix inconsistent prototypes for des (from drawterm)

--- a/sys/include/ape/libsec.h
+++ b/sys/include/ape/libsec.h
@@ -188,7 +188,7 @@
 
 void	setupDESstate(DESstate *s, uchar key[8], uchar *ivec);
 void	des_key_setup(uchar[8], ulong[32]);
-void	block_cipher(ulong*, uchar*, int);
+void	block_cipher(ulong[32], uchar[8], int);
 void	desCBCencrypt(uchar*, int, DESstate*);
 void	desCBCdecrypt(uchar*, int, DESstate*);
 void	desECBencrypt(uchar*, int, DESstate*);
@@ -219,7 +219,7 @@
 };
 
 void	setupDES3state(DES3state *s, uchar key[3][8], uchar *ivec);
-void	triple_block_cipher(ulong keys[3][32], uchar*, int);
+void	triple_block_cipher(ulong keys[3][32], uchar[8], int);
 void	des3CBCencrypt(uchar*, int, DES3state*);
 void	des3CBCdecrypt(uchar*, int, DES3state*);
 void	des3ECBencrypt(uchar*, int, DES3state*);
--- a/sys/include/libsec.h
+++ b/sys/include/libsec.h
@@ -180,7 +180,7 @@
 
 void	setupDESstate(DESstate *s, uchar key[8], uchar *ivec);
 void	des_key_setup(uchar[8], ulong[32]);
-void	block_cipher(ulong*, uchar*, int);
+void	block_cipher(ulong[32], uchar[8], int);
 void	desCBCencrypt(uchar*, int, DESstate*);
 void	desCBCdecrypt(uchar*, int, DESstate*);
 void	desECBencrypt(uchar*, int, DESstate*);
@@ -211,7 +211,7 @@
 };
 
 void	setupDES3state(DES3state *s, uchar key[3][8], uchar *ivec);
-void	triple_block_cipher(ulong keys[3][32], uchar*, int);
+void	triple_block_cipher(ulong[3][32], uchar[8], int);
 void	des3CBCencrypt(uchar*, int, DES3state*);
 void	des3CBCdecrypt(uchar*, int, DES3state*);
 void	des3ECBencrypt(uchar*, int, DES3state*);
--- a/sys/src/libsec/port/des.c
+++ b/sys/src/libsec/port/des.c
@@ -369,7 +369,7 @@
 }
 
 void
-des_key_setup(uchar key[8], ulong *ek)
+des_key_setup(uchar key[8], ulong ek[32])
 {
 	u32int left, right, v0, v1;
 
@@ -471,7 +471,7 @@
 }
 
 void
-key_setup(uchar key[7], ulong *ek)
+key_setup(uchar key[7], ulong ek[32])
 {
 	uchar k64[8];