]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/corecrypto/ccdigest/src/ccdigest_init.c
xnu-2782.1.97.tar.gz
[apple/xnu.git] / osfmk / corecrypto / ccdigest / src / ccdigest_init.c
diff --git a/osfmk/corecrypto/ccdigest/src/ccdigest_init.c b/osfmk/corecrypto/ccdigest/src/ccdigest_init.c
new file mode 100644 (file)
index 0000000..b9b3b88
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ *  ccdigest_init.c
+ *  corecrypto
+ *
+ *  Created by Michael Brouwer on 11/30/10.
+ *  Copyright 2010,2011 Apple Inc. All rights reserved.
+ *
+ */
+
+#include <corecrypto/ccdigest.h>
+#include <corecrypto/ccn.h>
+
+void ccdigest_init(const struct ccdigest_info *di, ccdigest_ctx_t ctx) {
+    ccdigest_copy_state(di, ccdigest_state_ccn(di, ctx), di->initial_state);
+    ccdigest_nbits(di, ctx) = 0;
+    ccdigest_num(di, ctx) = 0;
+}