Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Olm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
Olm
Commits
acae4e84
Commit
acae4e84
authored
8 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Remove functions which return strings
We don't want anything which does dynamic memory allocation in the library.
parent
9ac6ab0f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/olm/crypto.hh
+0
-2
0 additions, 2 deletions
include/olm/crypto.hh
include/olm/memory.hh
+0
-19
0 additions, 19 deletions
include/olm/memory.hh
src/crypto.cpp
+0
-5
0 additions, 5 deletions
src/crypto.cpp
with
0 additions
and
26 deletions
include/olm/crypto.hh
+
0
−
2
View file @
acae4e84
...
...
@@ -17,7 +17,6 @@
#include
<cstdint>
#include
<cstddef>
#include
<string>
namespace
olm
{
...
...
@@ -27,7 +26,6 @@ static const std::size_t IV_LENGTH = 16;
struct
Curve25519PublicKey
{
std
::
uint8_t
public_key
[
KEY_LENGTH
];
std
::
string
to_string
()
const
;
};
...
...
This diff is collapsed.
Click to expand it.
include/olm/memory.hh
+
0
−
19
View file @
acae4e84
...
...
@@ -87,23 +87,4 @@ std::uint8_t * store_array(
return
destination
+
sizeof
(
T
);
}
/** convert an array of bytes to a string representation */
template
<
typename
T
>
std
::
string
bytes_to_string
(
T
start
,
T
end
)
{
std
::
ostringstream
ss
;
ss
<<
std
::
hex
<<
std
::
setfill
(
'0'
);
while
(
start
!=
end
)
{
ss
<<
std
::
setw
(
2
)
<<
static_cast
<
int
>
(
*
start
++
);
if
(
start
!=
end
)
{
ss
<<
":"
;
}
}
return
ss
.
str
();
}
template
<
typename
T
>
std
::
string
bytes_to_string
(
T
start
,
size_t
len
)
{
return
bytes_to_string
(
start
,
start
+
len
);
}
}
// namespace olm
This diff is collapsed.
Click to expand it.
src/crypto.cpp
+
0
−
5
View file @
acae4e84
...
...
@@ -101,11 +101,6 @@ inline static void hmac_sha256_final(
}
// namespace
std
::
string
olm
::
Curve25519PublicKey
::
to_string
()
const
{
return
olm
::
bytes_to_string
(
std
::
begin
(
public_key
),
std
::
end
(
public_key
));
};
void
olm
::
curve25519_generate_key
(
std
::
uint8_t
const
*
random_32_bytes
,
olm
::
Curve25519KeyPair
&
key_pair
...
...
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