]>
git.saurik.com Git - apt.git/blob - apt-pkg/contrib/sha1.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: sha1.h,v 1.3 2001/05/07 05:05:47 jgg Exp $
4 /* ######################################################################
6 SHA1SumValue - Storage for a SHA-1 hash.
7 SHA1Summation - SHA-1 Secure Hash Algorithm.
9 This is a C++ interface to a set of SHA1Sum functions, that mirrors
10 the equivalent MD5 classes.
12 ##################################################################### */
24 #include "hashsum_template.h"
26 typedef HashSumValue
<160> SHA1SumValue
;
28 class SHA1Summation
: public SummationImplementation
30 /* assumes 64-bit alignment just in case */
31 unsigned char Buffer
[64] __attribute__((aligned(8)));
32 unsigned char State
[5*4] __attribute__((aligned(8)));
33 unsigned char Count
[2*4] __attribute__((aligned(8)));
37 bool Add(const unsigned char *inbuf
, unsigned long long inlen
);
38 using SummationImplementation::Add
;
40 SHA1SumValue
Result();