summaryrefslogtreecommitdiffstats
path: root/lib/libmd/ripemd.3
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-03-17 10:00:50 +0000
committerphk <phk@FreeBSD.org>2001-03-17 10:00:50 +0000
commitcf0fcea2b7ae26222f4865e9a6df53972a02f443 (patch)
tree7fe491bdf6b8f8e4c7ca17e38a2e3f0368875806 /lib/libmd/ripemd.3
parent670e711dd19510316ecaa1f30d78f16ba66492f6 (diff)
downloadFreeBSD-src-cf0fcea2b7ae26222f4865e9a6df53972a02f443.zip
FreeBSD-src-cf0fcea2b7ae26222f4865e9a6df53972a02f443.tar.gz
Add a new entrypoint to the hashes in libmd:
char * FooFileChunk(const char *filename, char *buf, off_t offset, off_t length) Which only hashes part of a file. Implement FooFile() in terms of this function. Submitted by: roam
Diffstat (limited to 'lib/libmd/ripemd.3')
-rw-r--r--lib/libmd/ripemd.320
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libmd/ripemd.3 b/lib/libmd/ripemd.3
index 352d452..ed71be5 100644
--- a/lib/libmd/ripemd.3
+++ b/lib/libmd/ripemd.3
@@ -18,6 +18,7 @@
.Nm RIPEMD160_Final ,
.Nm RIPEMD160_End ,
.Nm RIPEMD160_File ,
+.Nm RIPEMD160_FileChunk ,
.Nm RIPEMD160_Data
.Nd calculate the RIPEMD160 message digest
.Sh LIBRARY
@@ -36,6 +37,8 @@
.Ft "char *"
.Fn RIPEMD160_File "const char *filename" "char *buf"
.Ft "char *"
+.Fn RIPEMD160_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
+.Ft "char *"
.Fn RIPEMD160_Data "const unsigned char *data" "unsigned int len" "char *buf"
.Sh DESCRIPTION
The
@@ -72,6 +75,23 @@ calculates the digest of a file, and uses
.Fn RIPEMD160_End
to return the result.
If the file cannot be opened, a null pointer is returned.
+.Fn RIPEMD160_FileChunk
+is similar to
+.Fn RIPEMD160_File ,
+but it only calculates the digest over a byte-range of the file specified,
+starting at
+.Ar offset
+and spanning
+.Ar length
+bytes.
+If the
+.Ar length
+parameter is specified as 0, or more than the length of the remaining part
+of the file,
+.Fn RIPEMD160_FileChunk
+calculates the digest from
+.Ar offset
+to the end of file.
.Fn RIPEMD160_Data
calculates the digest of a chunk of data in memory, and uses
.Fn RIPEMD160_End
OpenPOWER on IntegriCloud