Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
crypto
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
elixxir
crypto
Commits
6f3eb9c0
Commit
6f3eb9c0
authored
Apr 14, 2022
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Update description for diffieHellman.GeneratePrivateKey to be clear about appropriate key sizes
parent
3de167bd
No related branches found
No related tags found
2 merge requests
!38
Release
,
!35
Add test for isUnencrypted based on panic we see in client code
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffieHellman/dhkx.go
+10
-5
10 additions, 5 deletions
diffieHellman/dhkx.go
with
10 additions
and
5 deletions
diffieHellman/dhkx.go
+
10
−
5
View file @
6f3eb9c0
...
...
@@ -10,18 +10,23 @@ package diffieHellman
import
(
"fmt"
"io"
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/xx_network/crypto/csprng"
"io"
)
const
DefaultPrivateKeyLengthBits
=
256
const
DefaultPrivateKeyLength
=
DefaultPrivateKeyLengthBits
/
8
// Creates a private key of the passed length in bits in the given group using
// the passed csprng. The length of the key must be within the prime of the
// group. It is recommended to use the "DefaultPrivateKeyLength"
// for most use cases.
// GeneratePrivateKey creates a private key of the passed length in
// bits in the given group using the passed csprng. The length of the
// key must be within the prime of the group. It is recommended to use
// the size of the prime for most use cases, but it is possible to use
// key private key sizes as small as DefaultPrivateKeyLength safely so
// long as the prime group size is over 3072 bits. See RFC 3766 (pg
// 19) and/or ECRYPT CSA "Algorithms, Key Size and Protocols Report
// (2018)" (pg 48) for more details.
// key size must be divisible by 8
func
GeneratePrivateKey
(
size
int
,
group
*
cyclic
.
Group
,
source
io
.
Reader
)
*
cyclic
.
Int
{
...
...
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