Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
6374c4d1
Unverified
Commit
6374c4d1
authored
Jan 24, 2023
by
Edward Thomson
Committed by
GitHub
Jan 24, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6458 from 0-wiz-0/netbsd
src: hide unused hmac() prototype
parents
036fe1af
d5aafe13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
112 deletions
+0
-112
src/util/hash/rfc6234/sha.h
+0
-112
No files found.
src/util/hash/rfc6234/sha.h
View file @
6374c4d1
...
...
@@ -192,49 +192,6 @@ typedef struct SHA256Context SHA224Context;
typedef
struct
SHA512Context
SHA384Context
;
/*
* This structure holds context information for all SHA
* hashing operations.
*/
typedef
struct
USHAContext
{
int
whichSha
;
/* which SHA is being used */
union
{
SHA1Context
sha1Context
;
SHA224Context
sha224Context
;
SHA256Context
sha256Context
;
SHA384Context
sha384Context
;
SHA512Context
sha512Context
;
}
ctx
;
}
USHAContext
;
/*
* This structure will hold context information for the HMAC
* keyed-hashing operation.
*/
typedef
struct
HMACContext
{
int
whichSha
;
/* which SHA is being used */
int
hashSize
;
/* hash size of SHA being used */
int
blockSize
;
/* block size of SHA being used */
USHAContext
shaContext
;
/* SHA context */
unsigned
char
k_opad
[
USHA_Max_Message_Block_Size
];
/* outer padding - key XORd with opad */
int
Computed
;
/* Is the MAC computed? */
int
Corrupted
;
/* Cumulative corruption code */
}
HMACContext
;
/*
* This structure will hold context information for the HKDF
* extract-and-expand Key Derivation Functions.
*/
typedef
struct
HKDFContext
{
int
whichSha
;
/* which SHA is being used */
HMACContext
hmacContext
;
int
hashSize
;
/* hash size of SHA being used */
unsigned
char
prk
[
USHAMaxHashSize
];
/* pseudo-random key - output of hkdfInput */
int
Computed
;
/* Is the key material computed? */
int
Corrupted
;
/* Cumulative corruption code */
}
HKDFContext
;
/*
* Function Prototypes
*/
...
...
@@ -283,73 +240,4 @@ extern int SHA512FinalBits(SHA512Context *, uint8_t bits,
extern
int
SHA512Result
(
SHA512Context
*
,
uint8_t
Message_Digest
[
SHA512HashSize
]);
/* Unified SHA functions, chosen by whichSha */
extern
int
USHAReset
(
USHAContext
*
context
,
SHAversion
whichSha
);
extern
int
USHAInput
(
USHAContext
*
context
,
const
uint8_t
*
bytes
,
unsigned
int
bytecount
);
extern
int
USHAFinalBits
(
USHAContext
*
context
,
uint8_t
bits
,
unsigned
int
bit_count
);
extern
int
USHAResult
(
USHAContext
*
context
,
uint8_t
Message_Digest
[
USHAMaxHashSize
]);
extern
int
USHABlockSize
(
enum
SHAversion
whichSha
);
extern
int
USHAHashSize
(
enum
SHAversion
whichSha
);
extern
int
USHAHashSizeBits
(
enum
SHAversion
whichSha
);
extern
const
char
*
USHAHashName
(
enum
SHAversion
whichSha
);
/*
* HMAC Keyed-Hashing for Message Authentication, RFC 2104,
* for all SHAs.
* This interface allows a fixed-length text input to be used.
*/
extern
int
hmac
(
SHAversion
whichSha
,
/* which SHA algorithm to use */
const
unsigned
char
*
text
,
/* pointer to data stream */
int
text_len
,
/* length of data stream */
const
unsigned
char
*
key
,
/* pointer to authentication key */
int
key_len
,
/* length of authentication key */
uint8_t
digest
[
USHAMaxHashSize
]);
/* caller digest to fill in */
/*
* HMAC Keyed-Hashing for Message Authentication, RFC 2104,
* for all SHAs.
* This interface allows any length of text input to be used.
*/
extern
int
hmacReset
(
HMACContext
*
context
,
enum
SHAversion
whichSha
,
const
unsigned
char
*
key
,
int
key_len
);
extern
int
hmacInput
(
HMACContext
*
context
,
const
unsigned
char
*
text
,
int
text_len
);
extern
int
hmacFinalBits
(
HMACContext
*
context
,
uint8_t
bits
,
unsigned
int
bit_count
);
extern
int
hmacResult
(
HMACContext
*
context
,
uint8_t
digest
[
USHAMaxHashSize
]);
/*
* HKDF HMAC-based Extract-and-Expand Key Derivation Function,
* RFC 5869, for all SHAs.
*/
extern
int
hkdf
(
SHAversion
whichSha
,
const
unsigned
char
*
salt
,
int
salt_len
,
const
unsigned
char
*
ikm
,
int
ikm_len
,
const
unsigned
char
*
info
,
int
info_len
,
uint8_t
okm
[
],
int
okm_len
);
extern
int
hkdfExtract
(
SHAversion
whichSha
,
const
unsigned
char
*
salt
,
int
salt_len
,
const
unsigned
char
*
ikm
,
int
ikm_len
,
uint8_t
prk
[
USHAMaxHashSize
]);
extern
int
hkdfExpand
(
SHAversion
whichSha
,
const
uint8_t
prk
[
],
int
prk_len
,
const
unsigned
char
*
info
,
int
info_len
,
uint8_t
okm
[
],
int
okm_len
);
/*
* HKDF HMAC-based Extract-and-Expand Key Derivation Function,
* RFC 5869, for all SHAs.
* This interface allows any length of text input to be used.
*/
extern
int
hkdfReset
(
HKDFContext
*
context
,
enum
SHAversion
whichSha
,
const
unsigned
char
*
salt
,
int
salt_len
);
extern
int
hkdfInput
(
HKDFContext
*
context
,
const
unsigned
char
*
ikm
,
int
ikm_len
);
extern
int
hkdfFinalBits
(
HKDFContext
*
context
,
uint8_t
ikm_bits
,
unsigned
int
ikm_bit_count
);
extern
int
hkdfResult
(
HKDFContext
*
context
,
uint8_t
prk
[
USHAMaxHashSize
],
const
unsigned
char
*
info
,
int
info_len
,
uint8_t
okm
[
USHAMaxHashSize
],
int
okm_len
);
#endif
/* _SHA_H_ */
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