Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
8bede7d6
Commit
8bede7d6
authored
Aug 23, 2016
by
Rusty Russell
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/pr/45'
Closes: 45
parents
578c4bfb
86769a9a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
ccan/crypto/ripemd160/ripemd160.c
ccan/crypto/ripemd160/ripemd160.c
+3
-3
ccan/crypto/ripemd160/ripemd160.h
ccan/crypto/ripemd160/ripemd160.h
+1
-1
ccan/crypto/sha256/benchmarks/double-sha-bench.c
ccan/crypto/sha256/benchmarks/double-sha-bench.c
+1
-1
ccan/crypto/sha256/sha256.c
ccan/crypto/sha256/sha256.c
+3
-3
ccan/crypto/sha256/sha256.h
ccan/crypto/sha256/sha256.h
+2
-2
No files found.
ccan/crypto/ripemd160/ripemd160.c
View file @
8bede7d6
...
...
@@ -282,7 +282,7 @@ static void add(struct ripemd160_ctx *ctx, const void *p, size_t len)
size_t
bufsize
=
ctx
->
bytes
%
64
;
if
(
bufsize
+
len
>=
64
)
{
/
/ Fill the buffer, and process it.
/
* Fill the buffer, and process it. */
memcpy
(
ctx
->
buf
.
u8
+
bufsize
,
data
,
64
-
bufsize
);
ctx
->
bytes
+=
64
-
bufsize
;
data
+=
64
-
bufsize
;
...
...
@@ -292,7 +292,7 @@ static void add(struct ripemd160_ctx *ctx, const void *p, size_t len)
}
while
(
len
>=
64
)
{
/
/ Process full chunks directly from the source.
/
* Process full chunks directly from the source. */
if
(
alignment_ok
(
data
,
sizeof
(
uint32_t
)))
Transform
(
ctx
->
s
,
(
const
uint32_t
*
)
data
);
else
{
...
...
@@ -305,7 +305,7 @@ static void add(struct ripemd160_ctx *ctx, const void *p, size_t len)
}
if
(
len
)
{
/
/ Fill the buffer with what remains.
/
* Fill the buffer with what remains. */
memcpy
(
ctx
->
buf
.
u8
+
bufsize
,
data
,
len
);
ctx
->
bytes
+=
len
;
}
...
...
ccan/crypto/ripemd160/ripemd160.h
View file @
8bede7d6
...
...
@@ -6,7 +6,7 @@
#include <stdlib.h>
/* Uncomment this to use openssl's RIPEMD160 routines (and link with -lcrypto) */
/
/#define CCAN_CRYPTO_RIPEMD160_USE_OPENSSL 1
/
*#define CCAN_CRYPTO_RIPEMD160_USE_OPENSSL 1*/
#ifdef CCAN_CRYPTO_RIPEMD160_USE_OPENSSL
#include <openssl/ripemd.h>
...
...
ccan/crypto/sha256/benchmarks/double-sha-bench.c
View file @
8bede7d6
...
...
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
memset
(
&
block
,
0
,
sizeof
(
block
));
sha256
(
&
block
.
h
,
&
n
,
sizeof
(
n
));
block
.
u8
[
sizeof
(
block
.
h
)]
=
0x80
;
/
/ Size is 256 bits
/
* Size is 256 bits */
block
.
u8
[
sizeof
(
block
)
-
2
]
=
1
;
start
=
time_now
();
...
...
ccan/crypto/sha256/sha256.c
View file @
8bede7d6
...
...
@@ -181,7 +181,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len)
size_t
bufsize
=
ctx
->
bytes
%
64
;
if
(
bufsize
+
len
>=
64
)
{
/
/ Fill the buffer, and process it.
/
* Fill the buffer, and process it. */
memcpy
(
ctx
->
buf
.
u8
+
bufsize
,
data
,
64
-
bufsize
);
ctx
->
bytes
+=
64
-
bufsize
;
data
+=
64
-
bufsize
;
...
...
@@ -191,7 +191,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len)
}
while
(
len
>=
64
)
{
/
/ Process full chunks directly from the source.
/
* Process full chunks directly from the source. */
if
(
alignment_ok
(
data
,
sizeof
(
uint32_t
)))
Transform
(
ctx
->
s
,
(
const
uint32_t
*
)
data
);
else
{
...
...
@@ -204,7 +204,7 @@ static void add(struct sha256_ctx *ctx, const void *p, size_t len)
}
if
(
len
)
{
/
/ Fill the buffer with what remains.
/
* Fill the buffer with what remains. */
memcpy
(
ctx
->
buf
.
u8
+
bufsize
,
data
,
len
);
ctx
->
bytes
+=
len
;
}
...
...
ccan/crypto/sha256/sha256.h
View file @
8bede7d6
...
...
@@ -6,7 +6,7 @@
#include <stdlib.h>
/* Uncomment this to use openssl's SHA256 routines (and link with -lcrypto) */
/
/#define CCAN_CRYPTO_SHA256_USE_OPENSSL 1
/
*#define CCAN_CRYPTO_SHA256_USE_OPENSSL 1*/
#ifdef CCAN_CRYPTO_SHA256_USE_OPENSSL
#include <openssl/sha.h>
...
...
@@ -82,7 +82,7 @@ void sha256_init(struct sha256_ctx *ctx);
/**
* SHA256_INIT - initializer for an SHA256 context.
*
* This can be used to staticly initialize an SHA256 context (instead
* This can be used to static
al
ly initialize an SHA256 context (instead
* of sha256_init()).
*
* Example:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment