-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
<!-- Detail in a few bullet points the work accomplished in this PR. Before you submit, don't forget to: * Make sure the GitHub PR fields are correct: ✓ Set a good Title for your PR. ✓ Assign yourself to the PR. ✓ Assign one or more reviewer(s). ✓ Link to a Jira issue, and/or other GitHub issues or PRs. ✓ In the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. * Don't waste reviewers' time: ✓ If it's a draft, select the Create Draft PR option. ✓ Self-review your changes to make sure nothing unexpected slipped through. * Try to make your intent clear: ✓ Write a good Description that explains what this PR is meant to do. ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding Jira ticket. ✓ Highlight what Testing you have done. ✓ Acknowledge any changes required to the Documentation. --> We are renaming crypto-hash-extra to crypto-primitives. We are adding all cryptonite resources that are used elsewhere and adopting logical structure. We are removing cryptonite dependence from other packages and base on crypto-primitives. ### Comments <!-- Additional comments, links, or screenshots to attach, if any. --> ### Issue Number adp-322 <!-- Reference the Jira/GitHub issue that this PR relates to, and which requirements it tackles. Note: Jira issues of the form ADP- will be auto-linked. -->
- Loading branch information
Showing
59 changed files
with
239 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
cabal-version: 3.0 | ||
name: crypto-hash-extra | ||
name: crypto-primitives | ||
version: 0.1.0.0 | ||
synopsis: Extra functionality for cryptographic hashing | ||
synopsis: Cryptographic primitives | ||
license: Apache-2.0 | ||
author: Cardano Foundation (High Assurance Lab) | ||
maintainer: [email protected] | ||
|
@@ -24,7 +24,13 @@ library | |
-freverse-errors | ||
|
||
hs-source-dirs: src | ||
exposed-modules: Crypto.Hash.Extra | ||
exposed-modules: Cryptography.Cipher.ChaChaPoly1305 | ||
Cryptography.Core | ||
Cryptography.ECC.Edwards25519 | ||
Cryptography.Hash.Blake | ||
Cryptography.Hash.Core | ||
Cryptography.KDF.PBKDF2 | ||
Cryptography.KDF.Scrypt | ||
build-depends: | ||
, base >= 4.14.3 && < 4.19 | ||
, bytestring >= 0.10.12 && < 0.13 | ||
|
17 changes: 17 additions & 0 deletions
17
lib/crypto-primitives/src/Cryptography/Cipher/ChaChaPoly1305.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Cryptography.Cipher.ChaChaPoly1305 | ||
( decrypt | ||
, encrypt | ||
, initialize | ||
, finalize | ||
, finalizeAAD | ||
, nonce12 | ||
) where | ||
|
||
import Crypto.Cipher.ChaChaPoly1305 | ||
( decrypt | ||
, encrypt | ||
, finalize | ||
, finalizeAAD | ||
, initialize | ||
, nonce12 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Cryptography.Core | ||
( CryptoError (..) | ||
, CryptoFailable (..) | ||
, eitherCryptoError | ||
|
||
, MonadRandom (..) | ||
) where | ||
|
||
import Crypto.Error | ||
( CryptoError (..) | ||
, CryptoFailable (..) | ||
, eitherCryptoError | ||
) | ||
import Crypto.Random.Types | ||
( MonadRandom (..) | ||
) |
11 changes: 11 additions & 0 deletions
11
lib/crypto-primitives/src/Cryptography/ECC/Edwards25519.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Cryptography.ECC.Edwards25519 | ||
( pointEncode | ||
, scalarDecodeLong | ||
, toPoint | ||
) where | ||
|
||
import Crypto.ECC.Edwards25519 | ||
( pointEncode | ||
, scalarDecodeLong | ||
, toPoint | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module Cryptography.Hash.Core | ||
( HashAlgorithm | ||
, MD4 (..) | ||
, MD5 (..) | ||
, SHA1 (..) | ||
, SHA224 (..) | ||
, SHA256 (..) | ||
, SHA512 (..) | ||
, SHA3_256 (..) | ||
, hash | ||
|
||
, HMAC | ||
, hmac | ||
|
||
, Digest | ||
, digestFromByteString | ||
|
||
) where | ||
|
||
import Crypto.Hash | ||
( Digest | ||
, digestFromByteString | ||
, hash | ||
) | ||
import Crypto.Hash.Algorithms | ||
( HashAlgorithm | ||
, MD4 (..) | ||
, MD5 (..) | ||
, SHA1 (..) | ||
, SHA224 (..) | ||
, SHA256 (..) | ||
, SHA3_256 (..) | ||
, SHA512 (..) | ||
) | ||
import Crypto.MAC.HMAC | ||
( HMAC | ||
, hmac | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Cryptography.KDF.PBKDF2 | ||
( Parameters (..) | ||
, fastPBKDF2_SHA512 | ||
, generate | ||
, prfHMAC | ||
) where | ||
|
||
import Crypto.KDF.PBKDF2 | ||
( Parameters (..) | ||
, fastPBKDF2_SHA512 | ||
, generate | ||
, prfHMAC | ||
) |
Oops, something went wrong.