DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦2795d9302⟧ TextFile

    Length: 674 (0x2a2)
    Types: TextFile
    Notes: UNIX file
    Names: »knapsack.h«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »cmd/knapsack/knapsack.h« 

TextFile

/*
 * Header for knapsack encryption scheme.
 */
#include <mprec.h>

#define K	64	/* Length of knapsack vector. */
#define R	56	/* Modulus of random number gen. is 2^R. */
#define PKCL	16	/* Public Key Component Length when stored. */

/*
 * knapsack structure
 */
struct knapsack {
	mint m1;
	mint w1;
	mint w1inv;
	mint m2;
	mint w2;
	mint w2inv;
	mint d[K];
	int shufl[K];
};

#define	or	||
#define	and	&&
#define	not	!
#define	TRUE	(0==0)
#define	FALSE	(not TRUE)

#define	PUBKEYDIR	"/usr/spool/pubkey"
#define	PPSIZ		130	/* Passphrase buffer size. */

#define	MCFBAS		95
#define	MCFZERO		040
#define	MCFL		21

/*
 * Function returning non-int.
 */
char *pubkeyfile();