work
This commit is contained in:
		
							parent
							
								
									83869d02c8
								
							
						
					
					
						commit
						60225494f4
					
				
							
								
								
									
										24
									
								
								autogen.sh
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								autogen.sh
									
									
									
									
									
								
							| 
						 | 
					@ -11,7 +11,6 @@ OUT=Makefile.am
 | 
				
			||||||
touch NEWS AUTHORS ChangeLog
 | 
					touch NEWS AUTHORS ChangeLog
 | 
				
			||||||
echo > $OUT
 | 
					echo > $OUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PROGS="ccr-keygen ccr-encrypt ccr-decrypt ccr-info"
 | 
					 | 
				
			||||||
DISTDIRS=""
 | 
					DISTDIRS=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "AUTOMAKE_OPTIONS = subdir-objects" >>$OUT
 | 
					echo "AUTOMAKE_OPTIONS = subdir-objects" >>$OUT
 | 
				
			||||||
| 
						 | 
					@ -28,20 +27,15 @@ echo "libcodecrypt_la_LDFLAGS = ${COMMON_LDFLAGS}" >>$OUT
 | 
				
			||||||
#echo "libcodecrypt_la_LDADD = ${COMMON_LDADD} " >>$OUT
 | 
					#echo "libcodecrypt_la_LDADD = ${COMMON_LDADD} " >>$OUT
 | 
				
			||||||
[ -f "lib/Makefile.am.extra" ] && cat "lib/Makefile.am.extra" >>$OUT
 | 
					[ -f "lib/Makefile.am.extra" ] && cat "lib/Makefile.am.extra" >>$OUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "bin_PROGRAMS = $PROGS" >>$OUT
 | 
					echo "bin_PROGRAMS = ccr" >>$OUT
 | 
				
			||||||
for i in $PROGS 
 | 
					echo "ccrdir = src/" >>$OUT
 | 
				
			||||||
do 
 | 
					echo "ccr_SOURCES = `( find src/ -type f -name \*.c ; find src/ -type f -name \*.cpp ) |tr \"\n\" \" \" ` " >>$OUT
 | 
				
			||||||
	name=`echo $i |tr '-' '_'`
 | 
					echo "noinst_HEADERS += `find src/ -type f -name \*.h |tr \"\n\" \" \" `" >>$OUT
 | 
				
			||||||
	dir="src/${i#ccr-}"
 | 
					echo "ccr_CPPFLAGS = -I\$(srcdir)/$i/ ${COMMON_CPPFLAGS}" >>$OUT
 | 
				
			||||||
	echo "${name}dir = $dir/" >>$OUT
 | 
					echo "ccr_CFLAGS = ${COMMON_CFLAGS}" >>$OUT
 | 
				
			||||||
	echo "${name}_SOURCES = `( find $dir/ -type f -name \*.c ; find $dir/ -type f -name \*.cpp ) |tr \"\n\" \" \" ` " >>$OUT
 | 
					echo "ccr_LDFLAGS = ${COMMON_LDFLAGS}" >>$OUT
 | 
				
			||||||
	echo "noinst_HEADERS += `find $dir/ -type f -name \*.h |tr \"\n\" \" \" `" >>$OUT
 | 
					echo "ccr_LDADD = libcodecrypt.la ${COMMON_LDADD} " >>$OUT
 | 
				
			||||||
	echo "${name}_CPPFLAGS = -I\$(srcdir)/$i/ ${COMMON_CPPFLAGS}" >>$OUT
 | 
					[ -f "src/Makefile.am.extra" ] && cat "src/Makefile.am.extra" >>$OUT
 | 
				
			||||||
	echo "${name}_CFLAGS = ${COMMON_CFLAGS}" >>$OUT
 | 
					 | 
				
			||||||
	echo "${name}_LDFLAGS = ${COMMON_LDFLAGS}" >>$OUT
 | 
					 | 
				
			||||||
	echo "${name}_LDADD = libcodecrypt.la ${COMMON_LDADD} " >>$OUT
 | 
					 | 
				
			||||||
	[ -f "$dir/Makefile.am.extra" ] && cat "$dir/Makefile.am.extra" >>$OUT
 | 
					 | 
				
			||||||
done
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
libtoolize --force && aclocal && autoconf && automake --add-missing
 | 
					libtoolize --force && aclocal && autoconf && automake --add-missing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,25 +6,61 @@
 | 
				
			||||||
extern "C" {
 | 
					extern "C" {
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ccr_mce_pubkey {
 | 
						/* codecrypt matrix/vector/whatever type */
 | 
				
			||||||
};
 | 
						typedef char* ccr_mtx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ccr_mce_privkey {
 | 
						/* macros for faster allocation/accessing */
 | 
				
			||||||
};
 | 
					#define ccr_mtx_alloc_size(veclen,nvec) ((((veclen)+7)/8)*(nvec))
 | 
				
			||||||
 | 
					#define ccr_mtx_vec_offset ccr_mtx_alloc_size
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ccr_nd_pubkey {
 | 
						struct ccr_mce_pubkey {
 | 
				
			||||||
};
 | 
							/* params */
 | 
				
			||||||
 | 
							int n, k, t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct ccr_nd_privkey {
 | 
							/* n*k G' pubkey matrix */
 | 
				
			||||||
};
 | 
							ccr_mtx g;
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int ccr_mce_gen(struct ccr_mce_pubkey*, struct ccr_mce_privkey*);
 | 
						struct ccr_mce_privkey {
 | 
				
			||||||
int ccr_mce_encrypt(struct ccr_mce_pubkey*, const char*, char*);
 | 
							/* params */
 | 
				
			||||||
int ccr_mce_decrypt(struct ccr_mce_privkey*, const char*, char*);
 | 
							int n, k, t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int ccr_nd_gen(struct ccr_nd_pubkey*, struct ccr_nd_privkey*);
 | 
							/* goppa polynomial of degree t */
 | 
				
			||||||
int ccr_nd_encrypt(struct ccr_nd_privkey*, const char*, char*);
 | 
							ccr_mtx poly;
 | 
				
			||||||
int ccr_nd_decrypt(struct ccr_nd_pubkey*, const char*, char*);
 | 
					
 | 
				
			||||||
 | 
							/* inverses of P and S matrices */
 | 
				
			||||||
 | 
							ccr_mtx pinv, sinv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* parity check matrix */
 | 
				
			||||||
 | 
							ccr_mtx h;
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						struct ccr_nd_pubkey {
 | 
				
			||||||
 | 
							/* params */
 | 
				
			||||||
 | 
							int n, k, t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* pubkey matrix */
 | 
				
			||||||
 | 
							ccr_mtx h;
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						struct ccr_nd_privkey {
 | 
				
			||||||
 | 
							/* params */
 | 
				
			||||||
 | 
							int n, k, t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* goppa polynomial of degree t */
 | 
				
			||||||
 | 
							ccr_mtx poly;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* inverses of P and S matrices */
 | 
				
			||||||
 | 
							ccr_mtx pinv, sinv;
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int ccr_mce_gen (struct ccr_mce_pubkey*, struct ccr_mce_privkey*);
 | 
				
			||||||
 | 
						int ccr_mce_encrypt (struct ccr_mce_pubkey*, const char*, char*);
 | 
				
			||||||
 | 
						int ccr_mce_decrypt (struct ccr_mce_privkey*, const char*, char*);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int ccr_nd_gen (struct ccr_nd_pubkey*, struct ccr_nd_privkey*);
 | 
				
			||||||
 | 
						int ccr_nd_encrypt (struct ccr_nd_privkey*, const char*, char*);
 | 
				
			||||||
 | 
						int ccr_nd_decrypt (struct ccr_nd_pubkey*, const char*, char*);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __cplusplus
 | 
					#ifdef __cplusplus
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
int main() {
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
int main() {
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
int main() {
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,4 +0,0 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
int main() {
 | 
					 | 
				
			||||||
	return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in a new issue