Abstract

Among the many error detection techniques used in (tele)communications, the Cyclic Redundancy Check (CRC) is probably the most powerful one. Roughly speaking the CRC is merely a modulo-2 division of the data (bits) to be transmitted by some 'magical' polynomial known for its high error detection capabilities. CRCs permit ensure that data transmitted over noisy media arrive intact.A common use of CRCs among industrial partners in large software development to projects is to identify quickly shared files. This is the case in the aerospace industry for instance, at least in Europe. CRCs can be computed for any sort of file, be it a document file processed by a COTS word processor, an image file, source code, a data file an executable file. The chances that two different files produce the same CRC checksum are astronomically small. It is our experience it never happened since our involvement in the ARIANE 5 program, the new European launcher, six years ago.A major issue however is due to the many variations among CRCs algorithms. For instance, most UNIX platforms provide a CRC checksum command, but few of them compute the same CRC checksum for a given file (obviously, the file format being identical). This issue has been addressed by the X/Open standardisation committee in charge of the UNIX specification. The so-called X/Open Single UNIX Specification [1], nicknamed UNIX95, contains a precise description of a CRC algorithm, which fully complies with the POSIX one [2]. As UNIX vendors are actually upgrading their product to become UNIX95 branded, one may expect these variations will disappear in the near future, in the UNIX world at least.In this paper we present an implementation of the POSIX/UNIX95 CRC algorithm in Ada95. Our purpose is three-fold. Firstly we want to provide standard source code that can be recompiled on any platform, UNIX-like or not, and be reused by other projects. Secondly we want the implementation to be scalable, typically from a 16-bit CRC ckecksum up to (at least) a 64-bit CRC ckecksum, as 64 bit CPUs become available on the market. The scalability goal is achieved by designing a generic implementation, the POSIX/UNIX95 CRC being a specific 32-bit of instantiation of it. The implementation is based on previous well designed and optimized work done in C [3], the purpose here is not to reinvent the wheel but to make it generic and scalable. Thirdly, the implementation illustrates some of the of new features of the Ada95 language: shifting and rotating procedures, modular types, aliased accesses, generic formal package, child packages and exception information, to name a few.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call