Philip Pemberton writes: > Hi, > I'm toying with the idea of implementing SHA-1 on a PIC16F or PIC18F chip. > Just out of curiosity, has anyone done this before? > It looks like it'll need about 300 bytes of RAM, so that pretty much limits > it to the higher-end chips, but in theory it should be doable... I have an SHA1 implementation that runs on the PIC16F27A (and others with enough RAM distributed the right way). It needs 117 bytes of RAM 64 bytes of which are in a contiguous block. This means that if fits on the mid range devices with 192 bytes of RAM or more. It is written in absolute code, but as an include file, so that it can be spliced into a larger program. It carefully changes bank select bits only where necessary, so it would need some work to make a relocatable version. As it stands it uses just over half a K words of program memory. RAM layout is dicey for relocatable if you want to take advantage of the fact that you can re-use some of the 117 of RAM for other purposes between bytes of input. (Obviously you can reuse all of the RAM between sums.) I'd be willing to make it available free for non-commercial use, and reasonably license it for commercial use. Do folks have license suggestions? Bill -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist