53 Commits

Author SHA1 Message Date
Sebastian Ramacher
3e38152a4a
ascon: replace implementation with ascon-core (#49)
Originally from https://github.com/sebastinas/ascon-aead/tree/main/ascon-core
2023-03-12 09:25:14 -06:00
dependabot[bot]
d8f8fbca7d
build(deps): bump subtle from 2.4.1 to 2.5.0 (#46)
Bumps [subtle](https://github.com/dalek-cryptography/subtle) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/dalek-cryptography/subtle/releases)
- [Changelog](https://github.com/dalek-cryptography/subtle/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dalek-cryptography/subtle/compare/2.4.1...2.5.0)

---
updated-dependencies:
- dependency-name: subtle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-11 14:36:52 -07:00
Artyom Pavlov
dc103866d4
ascon: use chunks_exact_mut for encoding permutation output (#48) 2023-03-01 10:37:39 +00:00
Tony Arcieri
17519f46c6
ascon: use chunks_exact for decoding permutation input (#47) 2023-02-28 14:09:08 -07:00
Tony Arcieri
a3906aab48
ascon v0.2.0 (#45) 2023-02-25 21:12:23 -07:00
Tony Arcieri
c8b07a46c8
ascon: use aead crate for AEAD API; MSRV 1.60 (#44)
Impls the standard AEAD API from the `aead` crate.

Eventually we can split this API out into a separate crate, e.g.
`ascon-aead`, but for now this just gets things working initially.

Uses weak/namespaced features which requires MSRV 1.60.
2023-02-25 20:48:50 -07:00
Tony Arcieri
11cb7366da
ascon: add Nonce type alias (#43)
Adds a type alias for Ascon nonces, set to `[u8; 16]`.

From the Ascon paper section 2.4:

https://link.springer.com/article/10.1007/s00145-021-09398-9

> The 320-bit initial state of Ascon is formed by the secret key K of
> k bits and nonce N of 128 bits
2023-02-25 19:23:59 -07:00
Tony Arcieri
37bc658306
ascon: Key type alias; cache key in Ascon state (#42)
- Adds a type alias for Ascon keys (16-byte)
- Stores key internally in `struct Ascon` so it doesn't need to be
  passed separately to `Ascon::finalize`.
2023-02-25 19:00:09 -07:00
Tony Arcieri
8773f6a963
CI: exclude keccak from toplevel workspace (#41)
The build is failing because `keccak` has a very old MSRV of 1.41, which
after merging #40 (which bumped the `ascon` edition to 2021) broke the
build because it can't handle the `edition` key.

As a workaround, this excludes `keccak` from the toplevel workspace so
it doesn't try to read the `ascon` edition key.

Separately, we should probably bump the `keccak` edition to 2021 as well
and release `keccak` v0.2.0, but that is left for future work.
2023-02-25 17:59:40 -07:00
Tony Arcieri
2a71bae6b2
ascon: 2021 edition (#40)
Since #39 bumped MSRV to 1.59, we can go ahead and do a 2021 edition
upgrade, including README.md in the toplevel rustdoc.
2023-02-25 17:36:18 -07:00
Tony Arcieri
8eb14719c0
ascon: extract Ascon permutation type; MSRV 1.59 (#39)
Adds a struct which wraps the permutation state, using const generics as
well as `feature(const_generics_defaults)` to express the `A`/`B`
parameters for `Ascon(a,b)`.
2023-02-25 17:08:19 -07:00
Tony Arcieri
d50fca63d2
ascon: eliminate util module (#38)
Factors the `u8` <-> `u64` conversions to be inline
2023-02-25 16:36:54 -07:00
Tony Arcieri
6de759ac15
ascon: remove byteorder dependency (#37)
We can use the support in `core` instead
2023-02-25 15:49:52 -07:00
Tony Arcieri
e4c0b56c7c
ascon: add no_std support (#36)
The permutation does not have any `std`/`alloc` dependency.

The current AEAD interface requires `alloc` (though we should migrate it
to use the `aead` crate anyway).
2023-02-11 12:28:02 -07:00
Tony Arcieri
ace9dd7723
ascon: expose permutation (#35)
Provides raw access to the Ascon permutation, allowing it to be used for
more things than just AEAD.
2023-02-11 12:12:58 -07:00
Tony Arcieri
2e113f5f96
ascon: 2018 edition upgrade, lints, docs (#34)
- Bumps the crate's edition to 2018, which is MSRV-compatible
- Adds a more expansive set of lints
- Adds the `missing_docs` lint, and adds docs where missing
2023-02-11 11:54:59 -07:00
Tony Arcieri
5831f8bd51
keccak: 2018 edition upgrade, lints, docs (#32)
- Bumps the crate's edition to 2018, which is MSRV-compatible.
- Adds a more expansive set of lints
- Adds the `missing_docs` lint, and adds docs where missing
- Fixes tests on ARMv8
2023-02-11 11:40:15 -07:00
Tony Arcieri
88c73ff02b
README.md: add ascon (#33) 2023-02-11 11:35:18 -07:00
Tony Arcieri
75b1918ee9
ascon: new README.md (#31)
Follows our standard README.md template
2023-02-11 11:05:08 -07:00
Tony Arcieri
dac6767968
ascon: import crate sources (#30)
Imports the source code of the `ascon` crate originally from:

https://github.com/quininer/ascon

Code is imported as of this commit:

    commit 997e51ff0cad48510ad31934f9c361d25bf5f938
    Author: quininer kel <quininer@live.com>
    Date:   Mon Feb 20 09:52:28 2017 +0800

        refactor: remove no_std

- Formatted code using rustfmt 1.5.1-stable (d5a82bbd 2023-02-07)
- Fixed clippy nits from clippy 0.1.67 (d5a82bbd 2023-02-07)

Dual licensed as Apache 2.0 + MIT

Permission given here:

https://github.com/RustCrypto/sponges/pull/30#discussion_r1103554334

Co-authored-by: quininer kel <quininer@live.com>
2023-02-11 10:34:01 -07:00
Tony Arcieri
2d2be3511a
keccak: delete original CC0 license
The previously CC0-licensed public domain code has been relicensed as Apache 2.0 + MIT

Closes #29
2022-12-10 12:50:13 -07:00
Tony Arcieri
6c98ff8396
keccak v0.1.3 (#28) 2022-11-14 12:30:19 -07:00
Tony Arcieri
d82151aa0d
keccak: remove f1600_armv8_sha3_asm re-export (#27)
As discussed in #24
2022-11-14 11:06:04 -07:00
Tony Arcieri
6bd1a6d0ab
keccak: rename f1600_armv8_sha3_asm (#26)
Include the target architecture and feature in the name of the function.
2022-11-13 20:56:27 -07:00
Tony Arcieri
4e36eefaa0
keccak: rename aarch64_sha3 module to armv8 (#25)
This is more consistent with the other crates we have which implement
ARMv8 intrinsics, such as the `aes` and `polyal` crates.
2022-11-13 15:32:07 -07:00
Tony Arcieri
a687839512
keccak: add asm feature; use cpufeatures on aarch64 (#24)
Gates `asm` support under a crate feature.

Uses the `cpufeatures` crate to detect the presence of the `sha3`
extension for ARMv8 CPUs, automatically falling back to a software
implementation if it isn't available.

When the `asm` feature is enabled on `aarch64` targets, exposes
`f1600_asm` that relies on ARMv8 `sha3` hardware intrinsics.
2022-11-13 15:15:26 -07:00
Remco Bloemen
b2d1e84abf
keccak: add aarch64 asm intrinsics implementation keccak_f1600 (#23) 2022-11-01 10:08:45 -06:00
Dirk Stolle
b68b313ee2
Update actions used in GitHub Actions workflows to newest version (#19) 2022-10-05 18:12:39 -06:00
Dirk Stolle
5cac553c05
Extend Dependabot configuration to keep GitHub Actions up to date (#20) 2022-10-05 18:12:22 -06:00
Tony Arcieri
b59a4d5aa9
keccak v0.1.2 (#18) 2022-05-24 17:53:43 -06:00
Artyom Pavlov
0901b5f420
Add description of features and remove the dependencies section (#17) 2022-05-24 23:22:02 +00:00
Alexander Wagner
f31b4b6eee
Use portable_simd instead of deprecate packed_simd (#16) 2022-05-24 17:07:32 -06:00
Tony Arcieri
5ec2be1538
keccak v0.1.1 (#15) 2022-05-24 16:35:18 -06:00
Tony Arcieri
79780c5df3
keccak: relicense as Apache 2.0 + MIT (#14)
Was previously CC0 (i.e. public domain)

Closes #5
2022-05-24 16:05:47 -06:00
Tony Arcieri
04b72bea35
keccak: add README.md (#12)
Adds a basic README to the crate
2022-05-24 15:42:59 -06:00
Tony Arcieri
e29a53e1d9
keccak: fix build (#13)
`packed_simd_2` no longer builds on nightly:

https://github.com/rust-lang/packed_simd/issues/343

This commit pins the nightly version for now, and disables the
`minimal-versions` check since it's not customizable and requires the
latest nightly.
2022-05-24 15:32:08 -06:00
Alexander Wagner
2736330d93
Add f1600x{2, 4, 8} (#8) 2022-05-12 08:49:34 -06:00
Tony Arcieri
95fbc0c28f
Add initial toplevel README.md 2022-05-11 11:47:45 -06:00
Alexander Wagner
a2ef49e5a6
Add generic keccak-p and keccak-f {200, 400, 800} (#7) 2022-05-11 11:36:17 -06:00
Alexander Wagner
0af08cbb1e
Add cargo-cache from RustCrypto/actions (#10) 2022-02-21 16:10:35 +00:00
Alexander Wagner
f9988e9e02
Add minimal-versions from RustCrypto/actions (#11) 2022-02-21 15:57:26 +00:00
Alexander Wagner
b7031fba6a
Use common CI patterns (#9)
* .github: Use cross-install action

* .github: Use set-msrv workflow
2022-02-15 07:04:05 -07:00
Alexander Wagner
71c7948b23
Revive CI with GH Workflows (#6) 2022-01-26 03:26:50 +00:00
newpavlov
35ac0f140f small code cleanup 2018-04-03 19:54:43 +03:00
newpavlov
fcb42fe8d1 do not unroll the rounds loop 2018-03-27 19:28:37 +03:00
newpavlov
a417e97a41 disable rustfmt 2018-03-21 17:21:11 +03:00
newpavlov
dd9f552e61 disable rustfmt 2018-03-21 17:10:26 +03:00
newpavlov
af282ce18f fixed formatting 2018-03-21 16:27:38 +03:00
newpavlov
3c70c34ac9 bumped min Rust version to 1.15.0 2018-03-21 16:24:04 +03:00
newpavlov
99c07f7885 added Travis CI 2018-03-21 16:19:00 +03:00