1 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
20 * Note: our _priv ivar is actually a feeHash pointer.
22 #import "NSCryptors.h"
27 @implementation NSMD5Hash
31 return [[self alloc] init];
37 _priv = feeHashAlloc();
45 - (void)digestData:(NSData *)data
50 feeHashAddData(_priv, [data bytes], [data length]);
53 - (NSData *)messageDigest
61 cp = feeHashDigest(_priv);
62 md = [NSData dataWithBytes:cp length:feeHashDigestLen()];
67 - (NSData *)digestData:(NSData *)data withSalt:(NSData *)salt
73 [self digestData:salt];
75 [self digestData:data];
76 return [self messageDigest];