From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1de6257d3e8a8ddb X-Google-Attributes: gidfee84,public From: nmm1@cus.cam.ac.uk (Nick Maclaren) Subject: Re: MD5 implementation Date: 1996/01/11 Message-ID: <4d40un$373@lyra.csx.cam.ac.uk>#1/1 X-Deja-AN: 134922990 references: <30F4CCAF.41C6@adv.magwien.gv.at> <4d3usa$gfm@nntpd2.cxo.dec.com> organization: University of Cambridge, England newsgroups: comp.unix.osf.osf1 In article <4d3usa$gfm@nntpd2.cxo.dec.com>, Michael Spratte wrote: > >In article <30F4CCAF.41C6@adv.magwien.gv.at>, Michael Gsandtner writes: >|>Where can I get a MD5 (rfc1321) encryption implementation for a >|>64 Bit alpha running DEC/OSF1 ? >|>The reference implementation included in the RFC works fine only >|>on 32 Bit machines. > >I've had no problem with the RFC1321 code running on Digital UNIX. All >I did was modify global.h: > >/* UINT4 defines a four byte word */ >#if defined(__osf__) && defined(__alpha) >typedef unsigned int UINT4; >#else >typedef unsigned long int UINT4; >#endif > >With this modification, the code works identically on ULTRIX, OpenVMS, >Digital UNIX, and Windows NT. I am sorry to say that I think that this is a revolting solution! It isn't difficult to do the job properly (i.e. without any #ifs that depend on any particular system). For such code, see /pub/software/programs/checksum/... on cus.cam.ac.uk. Yes, that code has #ifs that fix up SunOS (no EXIT_SUCCESS etc.) and has alternate code for POSIX/UNIX systems (to allow its use in a pipe). But otherwise it works without #ifs under OS/2, MVS and many UNICES (including DEC OSF/1). If it doesn't, please tell me and I shall regard it as a bug. Nick Maclaren, University of Cambridge Computer Laboratory, New Museums Site, Pembroke Street, Cambridge CB2 3QG, England. Email: nmm1@cam.ac.uk Tel.: +44 1223 334761 Fax: +44 1223 334679