Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Z
zhimingd_comp30023_2019_project-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zhiming Deng
zhimingd_comp30023_2019_project-2
Commits
0ed8bcc9
Commit
0ed8bcc9
authored
May 24, 2019
by
Zhiming Deng
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
ff382c83
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sha256.h
+34
-0
34 additions, 0 deletions
sha256.h
with
34 additions
and
0 deletions
sha256.h
0 → 100644
+
34
−
0
View file @
0ed8bcc9
/*********************************************************************
* Filename: sha256.h
* Author: Brad Conte (brad AT bradconte.com)
* Copyright:
* Disclaimer: This code is presented "as is" without any guarantees.
* Details: Defines the API for the corresponding SHA1 implementation.
*********************************************************************/
#ifndef SHA256_H
#define SHA256_H
/*************************** HEADER FILES ***************************/
#include
<stddef.h>
/****************************** MACROS ******************************/
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
/**************************** DATA TYPES ****************************/
typedef
unsigned
char
BYTE
;
// 8-bit byte
typedef
unsigned
int
WORD
;
// 32-bit word, change to "long" for 16-bit machines
typedef
struct
{
BYTE
data
[
64
];
WORD
datalen
;
unsigned
long
long
bitlen
;
WORD
state
[
8
];
}
SHA256_CTX
;
/*********************** FUNCTION DECLARATIONS **********************/
void
sha256_init
(
SHA256_CTX
*
ctx
);
void
sha256_update
(
SHA256_CTX
*
ctx
,
const
BYTE
data
[],
size_t
len
);
void
sha256_final
(
SHA256_CTX
*
ctx
,
BYTE
hash
[]);
#endif // SHA256_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment