Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C++ Interface
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
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Sensor Interfacing Language (SOIL)
C++ Interface
Merge requests
!1
use new ssl/tls openssh toolkit
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
use new ssl/tls openssh toolkit
wzl-mq-ms/forschung-lehre/benchmark-optitrack/cpp-interface:647-update_sha256
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
use new ssl/tls openssh toolkit
Tim Heß
requested to merge
wzl-mq-ms/forschung-lehre/benchmark-optitrack/cpp-interface:647-update_sha256
into
main
9 months ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Fixes
#647 (closed)
Closes
#647 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
a30a00b9
1 commit,
9 months ago
1 file
+
8
−
9
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/SIGN/Hasher.cpp
+
8
−
9
View file @ a30a00b9
Edit in single-file editor
Open in Web IDE
Show full file
#include
"Hasher.h"
#include
"Hasher.h"
#include
<openssl/
sha
.h>
#include
<openssl/
evp
.h>
#include
<sstream>
#include
<sstream>
#include
<iomanip>
#include
<iomanip>
std
::
vector
<
unsigned
char
>
SIGN
::
Hasher
::
sha256
(
const
unsigned
char
*
data
,
size_t
length
)
std
::
vector
<
unsigned
char
>
SIGN
::
Hasher
::
sha256
(
const
unsigned
char
*
data
,
size_t
length
)
{
{
SHA256_CTX
context
;
EVP_MD_CTX
*
context
=
EVP_MD_CTX_new
();
SHA256_Init
(
&
context
);
EVP_DigestInit_ex
(
context
,
EVP_sha256
(),
NULL
);
SHA256_Update
(
&
context
,
data
,
length
);
EVP_DigestUpdate
(
context
,
data
,
length
);
std
::
vector
<
unsigned
char
>
buffer
(
SHA256_DIGEST_LENGTH
);
std
::
vector
<
unsigned
char
>
buffer
(
EVP_MD_size
(
EVP_sha256
()));
SHA256_Final
(
buffer
.
data
(),
&
context
);
EVP_DigestFinal_ex
(
context
,
buffer
.
data
(),
NULL
);
EVP_MD_CTX_free
(
context
);
return
buffer
;
return
buffer
;
}
}
SIGN
::
Hasher
::
Hasher
()
SIGN
::
Hasher
::
Hasher
()
@@ -37,7 +36,7 @@ void SIGN::Hasher::reset()
@@ -37,7 +36,7 @@ void SIGN::Hasher::reset()
size_t
SIGN
::
Hasher
::
size
(
void
)
size_t
SIGN
::
Hasher
::
size
(
void
)
{
{
return
SHA256_DIGEST_LENGTH
;
;
return
EVP_MD_size
(
EVP_sha256
())
;
}
}
std
::
string
SIGN
::
Hasher
::
print
(
std
::
vector
<
unsigned
char
>
bytes
,
bool
uppercase
)
std
::
string
SIGN
::
Hasher
::
print
(
std
::
vector
<
unsigned
char
>
bytes
,
bool
uppercase
)
Loading