chore!: align to draft 16, update dependencies (#365)
* chore!: align to draft 16, update dependencies * chore: fix toml formatting
This commit is contained in:
@@ -236,7 +236,7 @@ jobs:
|
||||
- name: Install Taplo
|
||||
# Adding the --locked flag because of
|
||||
# https://github.com/tamasfe/taplo/issues/242
|
||||
run: cargo install taplo-cli --locked
|
||||
run: cargo install taplo-cli --locked
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@main
|
||||
@@ -249,4 +249,4 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: EmbarkStudios/cargo-deny-action@v1
|
||||
- uses: EmbarkStudios/cargo-deny-action@v2
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 3.0.0-pre.6 (TBD)
|
||||
* Synced implementation with draft-irtf-cfrg-opaque-16
|
||||
* **Breaking: protocol context string changed from `RFCXXXX` to `OPAQUEv1-`**
|
||||
* Dropped unmaintained json crate in favor of serde_json
|
||||
* Updated dependencies
|
||||
|
||||
## 3.0.0-pre.5 (September 18, 2024)
|
||||
* Increased MSRV to 1.74
|
||||
* Updated voprf dependency
|
||||
@@ -15,6 +21,7 @@
|
||||
|
||||
## 3.0.0-pre.2 (March 14, 2023)
|
||||
* Updated VOPRF to draft 19
|
||||
* **Breaking: backwards-incompatible changes introduced in OPRF protocol**
|
||||
* Added P384 testing support
|
||||
* Increased MSRV to 1.65
|
||||
* Updating dependencies
|
||||
|
||||
+3
-4
@@ -9,7 +9,7 @@ name = "opaque-ke"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/facebook/opaque-ke"
|
||||
rust-version = "1.74"
|
||||
version = "3.0.0-pre.5"
|
||||
version = "3.0.0-pre.6"
|
||||
|
||||
[features]
|
||||
argon2 = ["dep:argon2"]
|
||||
@@ -38,9 +38,9 @@ rand = { version = "0.8", default-features = false }
|
||||
serde = { version = "1", default-features = false, features = [
|
||||
"derive",
|
||||
], optional = true }
|
||||
subtle = { version = "2.3", default-features = false }
|
||||
subtle = { version = "2.6", default-features = false }
|
||||
voprf = { version = "0.5", default-features = false, features = ["danger"] }
|
||||
zeroize = { version = "1.5", features = ["zeroize_derive"] }
|
||||
zeroize = { version = "1.8", features = ["zeroize_derive"] }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
getrandom = { version = "0.2", features = ["js"], optional = true }
|
||||
@@ -50,7 +50,6 @@ bincode = "1"
|
||||
chacha20poly1305 = "0.10"
|
||||
criterion = "0.5"
|
||||
hex = "0.4"
|
||||
json = "0.12"
|
||||
p256 = { version = "0.13", default-features = false, features = [
|
||||
"hash2curve",
|
||||
"voprf",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## The OPAQUE key exchange protocol 
|
||||
|
||||
[OPAQUE](https://eprint.iacr.org/2018/163.pdf) is an asymmetric password-authenticated key exchange protocol. It allows a client to authenticate to a server using a password, without ever having to expose the plaintext password to the server.
|
||||
[OPAQUE](https://eprint.iacr.org/2018/163.pdf) is an augmented password-authenticated key exchange protocol. It allows a client to authenticate to a server using a password, without ever having to expose the plaintext password to the server.
|
||||
|
||||
This implementation is based on the [Internet Draft for OPAQUE](https://github.com/cfrg/draft-irtf-cfrg-opaque).
|
||||
|
||||
Background
|
||||
----------
|
||||
|
||||
Asymmetric Password Authenticated Key Exchange (aPAKE) protocols are designed to provide password authentication and mutually authenticated key exchange without relying on PKI (except during user/password registration) and without disclosing passwords to servers or other entities other than the client machine.
|
||||
Augmented Password Authenticated Key Exchange (aPAKE) protocols are designed to provide password authentication and mutually authenticated key exchange without relying on PKI (except during user/password registration) and without disclosing passwords to servers or other entities other than the client machine.
|
||||
|
||||
OPAQUE is a PKI-free aPAKE that is secure against pre-computation attacks and capable of using a secret salt.
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
# The values provided in this template are the default values that will be used
|
||||
# when any section or field is not specified in your own configuration
|
||||
|
||||
[graph]
|
||||
# If 1 or more target triples (and optionally, target_features) are specified,
|
||||
# only the specified targets will be checked when running `cargo deny check`.
|
||||
# This means, if a particular package is only ever used as a target specific
|
||||
@@ -17,6 +18,7 @@
|
||||
# this list would mean the nix crate, as well as any of its exclusive
|
||||
# dependencies not shared by any other crates, would be ignored, as the target
|
||||
# list here is effectively saying which targets you are building for.
|
||||
all-features = true
|
||||
targets = [
|
||||
# The triple can be any string, but only the target triples built in to
|
||||
# rustc (as of 1.40) can be checked against actual config expressions
|
||||
@@ -35,16 +37,8 @@ targets = [
|
||||
db-path = "~/.cargo/advisory-db"
|
||||
# The url of the advisory database to use
|
||||
db-urls = ["https://github.com/rustsec/advisory-db"]
|
||||
# The lint level for security vulnerabilities
|
||||
vulnerability = "deny"
|
||||
# The lint level for unmaintained crates
|
||||
unmaintained = "warn"
|
||||
# The lint level for crates that have been yanked from their source registry
|
||||
yanked = "warn"
|
||||
# The lint level for crates with security notices. Note that as of
|
||||
# 2019-12-17 there are no security notice advisories in
|
||||
# https://github.com/rustsec/advisory-db
|
||||
notice = "deny"
|
||||
# A list of advisory IDs to ignore. Note that ignored advisories will still
|
||||
# output a note when they are encountered.
|
||||
ignore = [
|
||||
@@ -64,47 +58,26 @@ ignore = [
|
||||
# More documentation for the licenses section can be found here:
|
||||
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
|
||||
[licenses]
|
||||
# The lint level for crates which do not have a detectable license
|
||||
unlicensed = "deny"
|
||||
# List of explictly allowed licenses
|
||||
# See https://spdx.org/licenses/ for list of possible licenses
|
||||
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
|
||||
allow = [
|
||||
#"MIT",
|
||||
#"Apache-2.0",
|
||||
"MIT",
|
||||
"BSD-3-Clause",
|
||||
"Apache-2.0",
|
||||
#"Apache-2.0 WITH LLVM-exception",
|
||||
]
|
||||
# List of explictly disallowed licenses
|
||||
# See https://spdx.org/licenses/ for list of possible licenses
|
||||
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
|
||||
deny = [
|
||||
#"Nokia",
|
||||
]
|
||||
# Lint level for licenses considered copyleft
|
||||
copyleft = "warn"
|
||||
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
|
||||
# * both - The license will be approved if it is both OSI-approved *AND* FSF
|
||||
# * either - The license will be approved if it is either OSI-approved *OR* FSF
|
||||
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
|
||||
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
|
||||
# * neither - This predicate is ignored and the default lint level is used
|
||||
allow-osi-fsf-free = "neither"
|
||||
# Lint level used when no other predicates are matched
|
||||
# 1. License isn't in the allow or deny lists
|
||||
# 2. License isn't copyleft
|
||||
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
|
||||
default = "allow"
|
||||
# The confidence threshold for detecting a license from license text.
|
||||
# The higher the value, the more closely the license text must be to the
|
||||
# canonical license text of a valid SPDX license file.
|
||||
# [possible values: any between 0.0 and 1.0].
|
||||
confidence-threshold = 0.8
|
||||
confidence-threshold = 0.95
|
||||
# Allow 1 or more licenses on a per-crate basis, so that particular licenses
|
||||
# aren't accepted for every possible crate as with the normal allow list
|
||||
exceptions = [
|
||||
# Each entry is the crate and version constraint, and its specific allow
|
||||
# list
|
||||
#{ allow = ["Zlib"], name = "adler32", version = "*" },
|
||||
{ allow = ["Unicode-DFS-2016"], name = "unicode-ident", version = "*" },
|
||||
]
|
||||
|
||||
# Some crates don't have (easily) machine readable licensing information,
|
||||
|
||||
@@ -38,7 +38,7 @@ use crate::serialization::{Input, UpdateExt};
|
||||
///////////////
|
||||
|
||||
pub(crate) type NonceLen = U32;
|
||||
static STR_RFC: &[u8] = b"RFCXXXX";
|
||||
static STR_CONTEXT: &[u8] = b"OPAQUEv1-";
|
||||
static STR_CLIENT_MAC: &[u8] = b"ClientMAC";
|
||||
static STR_HANDSHAKE_SECRET: &[u8] = b"HandshakeSecret";
|
||||
static STR_SERVER_MAC: &[u8] = b"ServerMAC";
|
||||
@@ -215,7 +215,7 @@ where
|
||||
let server_nonce = generate_nonce::<R>(rng);
|
||||
|
||||
let mut transcript_hasher = D::new()
|
||||
.chain(STR_RFC)
|
||||
.chain(STR_CONTEXT)
|
||||
.chain_iter(
|
||||
Input::<U2>::from(context)
|
||||
.map_err(ProtocolError::into_custom)?
|
||||
@@ -278,7 +278,7 @@ where
|
||||
context: &[u8],
|
||||
) -> Result<GenerateKe3Result<Self, D, KG>, ProtocolError> {
|
||||
let mut transcript_hasher = D::new()
|
||||
.chain(STR_RFC)
|
||||
.chain(STR_CONTEXT)
|
||||
.chain_iter(Input::<U2>::from(context)?.iter())
|
||||
.chain_iter(id_u)
|
||||
.chain_iter(serialized_credential_request)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// of this source tree. You may select, at your option, one of the above-listed
|
||||
// licenses.
|
||||
|
||||
//! An implementation of the OPAQUE asymmetric password authentication key
|
||||
//! An implementation of the OPAQUE augmented password authentication key
|
||||
//! exchange protocol
|
||||
//!
|
||||
//! Note: This implementation is in sync with [draft-irtf-cfrg-opaque-16](https://datatracker.ietf.org/doc/draft-irtf-cfrg-opaque/16/),
|
||||
|
||||
+540
-540
File diff suppressed because it is too large
Load Diff
+99
-99
@@ -7,7 +7,7 @@
|
||||
// licenses.
|
||||
|
||||
//! The OPAQUE test vectors taken from
|
||||
//! <https://github.com/cfrg/draft-irtf-cfrg-opaque/blob/727b9acb908dce296e15bc14a53a7d04ba9604d0/poc/vectors/formatted.txt>
|
||||
//! <https://github.com/cfrg/draft-irtf-cfrg-opaque/blob/0cd4251786b54c623bf1eceaff15892616e53ea6/poc/vectors/formatted.txt>
|
||||
|
||||
pub(crate) static VECTORS: &str = r#"
|
||||
## Real Test Vectors {#real-vectors}
|
||||
@@ -75,15 +75,15 @@ d329beb932e9adeea73d5d5c22a0ce1952f8aba6d66007615cd1698d4ac85ef1fcf15
|
||||
envelope: ac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a3
|
||||
8dfec634b0f5b96109c198a8027da51854c35bee90d1e1c781806d07d49b76de6a28b
|
||||
8d9e9b6c93b9f8b64d16dddd9c5bfb5fea48ee8fd2f75012a8b308605cdd8ba5
|
||||
handshake_secret: 7032215dfe771d18168271a8dd8c220098f6cfa6e63ccec7770
|
||||
61f6e6b74acee646d655454ee28e1a089c2bcdf0659999d2b60782290b2a5a067d663
|
||||
09ea1e46
|
||||
server_mac_key: 4d9c9d82092b7a932d8ab42a9acfc7e08ce84c94eaa309c32321d
|
||||
f90c5f93b093bdd8df15f573ec4d8952a1616d15127e270d97f9c638a6613187966e2
|
||||
fa031a
|
||||
client_mac_key: 7ee640a0a860b1751d67f5994a3db290a0afd928434d65c166f34
|
||||
c73a245a7ab75d8ba15683f0701034f87d5c047f5082e138880fb37bec387c4863ba9
|
||||
1c9750
|
||||
handshake_secret: 81263cb85a0cfa12450f0f388de4e92291ec4c7c7a0878b6245
|
||||
50ff528726332f1298fc6cc822a432c89504347c7a2ccd70316ae3da6a15e0399e6db
|
||||
3f7c1b12
|
||||
server_mac_key: 0d36b26cfe38f51f804f0a9361818f32ee1ce2a4e5578653b5271
|
||||
84af058d3b2d8075c296fd84d24677913d1baa109290cd81a13ed383f9091a3804e65
|
||||
298dfc
|
||||
client_mac_key: 91750adbac54a5e8e53b4c233cc8d369fe83b0de1b6a3cd85575e
|
||||
eb0bb01a6a90a086a2cf5fe75fff2a9379c30ba9049510a33b5b0b1444a88800fc3ee
|
||||
e2260d
|
||||
oprf_key: 5d4c6a8b7c7138182afb4345d1fae6a9f18a1744afbcc3854f8f5a2b4b4
|
||||
c6d05
|
||||
~~~
|
||||
@@ -112,17 +112,17 @@ KE2: 7e308140890bcde30cbcea28b01ea1ecfbd077cff62c4def8efa075aabcbb471
|
||||
52786e0382f95ad85c08f6afcd1ccfbff95e2bdeb015b166c6b20b92f832cc6df01e0
|
||||
b86a7efd92c1c804ff865781fa93f2f20b446c8371b671cd9960ecef2fe0d0f749498
|
||||
6fa3d8b2bb01963537e60efb13981e138e3d4a1c4f62198a9d6fa9170c42c3c71f197
|
||||
1b29eb1d5d0bd733e40816c91f7912cc4aa47faa9314446793501f622f63a84db1bf5
|
||||
b346d13f48d2f1a93902475e625fac1d0dea3ad473c0db2de94098b7142c5099758f8
|
||||
568c98495d409b5a601b3e59
|
||||
KE3: 2a5e2036d390f4c79e6d5a15ffa8ede52b8da7ff07b9a016a201f22f3420aaa3
|
||||
3326ba6fe19b947f23cfbb8a2534b488cca31e35a2521e1ab7a49e299c82a07b
|
||||
1b29eb1d5d0bd733e40816c91f7912cc4a660c48dae03e57aaa38f3d0cffcfc21852e
|
||||
bc8b405d15bd6744945ba1a93438a162b6111699d98a16bb55b7bdddfe0fc5608b23d
|
||||
a246e7bd73b47369169c5c90
|
||||
KE3: 4455df4f810ac31a6748835888564b536e6da5d9944dfea9e34defb9575fe5e2
|
||||
661ef61d2ae3929bcf57e53d464113d364365eb7d1a57b629707ca48da18e442
|
||||
export_key: 1ef15b4fa99e8a852412450ab78713aad30d21fa6966c9b8c9fb3262a
|
||||
970dc62950d4dd4ed62598229b1b72794fc0335199d9f7fcc6eaedde92cc04870e63f
|
||||
16
|
||||
session_key: db06b9d5d2c6034db948f58da84a6c5bdeaab7037adc338d7fada357
|
||||
3c5dbcfe649c4f172615f97f63da944bee601abb69121203f0bf56cb7742efdd1afbb
|
||||
21a
|
||||
session_key: 42afde6f5aca0cfa5c163763fbad55e73a41db6b41bc87b8e7b62214
|
||||
a8eedc6731fa3cb857d657ab9b3764b89a84e91ebcb4785166fbb02cedfcbdfda215b
|
||||
96f
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Real Test Vector 2
|
||||
@@ -190,15 +190,15 @@ d329beb932e9adeea73d5d5c22a0ce1952f8aba6d66007615cd1698d4ac85ef1fcf15
|
||||
envelope: ac13171b2f17bc2c74997f0fce1e1f35bec6b91fe2e12dbd323d23ba7a3
|
||||
8dfec1ac902dc5589e9a5f0de56ad685ea8486210ef41449cd4d8712828913c5d2b68
|
||||
0b2b3af4a26c765cff329bfb66d38ecf1d6cfa9e7a73c222c6efe0d9520f7d7c
|
||||
handshake_secret: ce0bce1d698443e07b85551d38654ddf2d9fa3791cab39c0ceb
|
||||
84a87408d3189da191d5f28d994178c794a363c8b2431d66de8e6d048bf1afc09588a
|
||||
1790017d
|
||||
server_mac_key: 87212e945d15bd1ff230240795a0b09e1e1d42d7ce8b78fbe4bf5
|
||||
6a60288ed64d8cd9e13a27537d3d06323fee990d994653809466a47b0786885f933c6
|
||||
9f1c68
|
||||
client_mac_key: c0f37b7c91f2d16b5466e55d27dbdf1f6727c2ee830b1bcd03cf4
|
||||
7c4fc3b5520a166a0a21e9f12a4880555272153c77b97b3e534c327aea1b60e8b5d18
|
||||
a14b9a
|
||||
handshake_secret: 5e723bed1e5276de2503419eba9da61ead573109c4012268323
|
||||
98c7e08155b885bfe7bc93451f9d887a0c1d0c19233e40a8e47b347a9ac3907f94032
|
||||
a4cff64f
|
||||
server_mac_key: dad66bb9251073d17a13f8e5500f36e5998e3cde520ca0738e708
|
||||
5af62fd97812eb79a745c94d0bf8a6ac17f980cf435504cf64041eeb6bb237796d2c7
|
||||
f81e9a
|
||||
client_mac_key: f816fe2914f7c5b29852385615d7c7f31ac122adf202d7ccd4976
|
||||
06d7aabd48930323d1d02b1cc9ecd456c4de6f46c7950becb18bffd921dd5876381b5
|
||||
486ffe
|
||||
oprf_key: 5d4c6a8b7c7138182afb4345d1fae6a9f18a1744afbcc3854f8f5a2b4b4
|
||||
c6d05
|
||||
~~~
|
||||
@@ -227,17 +227,17 @@ KE2: 7e308140890bcde30cbcea28b01ea1ecfbd077cff62c4def8efa075aabcbb471
|
||||
95dd8914f164e49f81c7688a38928372134b7dccd50e09f8fed9518b7b2f94835b3c4
|
||||
fe4c8475e7513f20eb97ff0568a39caee3fd6251876f71cd9960ecef2fe0d0f749498
|
||||
6fa3d8b2bb01963537e60efb13981e138e3d4a1c4f62198a9d6fa9170c42c3c71f197
|
||||
1b29eb1d5d0bd733e40816c91f7912cc4a376718206a20e4941b5423a1fb1603b8452
|
||||
d3a2071b37132c9f9324b1cf160e10d40469f54d5f1c4a25f1ed1bb74dd5b87b27ae3
|
||||
9a8b53e22382f2e45f156d74
|
||||
KE3: d015536b2ecafb1a87f6ed057982cf73e75ec56a774549f672d59c0c4b7e3762
|
||||
e0c6d8a2382ae855c8ef5240bbe1e404b8c455c03dc1a716d459f67828f0574f
|
||||
1b29eb1d5d0bd733e40816c91f7912cc4a292371e7809a9031743e943fb3b56f51de9
|
||||
03552fc91fba4e7419029951c3970b2e2f0a9dea218d22e9e4e0000855bb6421aa361
|
||||
0d6fc0f4033a6517030d4341
|
||||
KE3: 7a026de1d6126905736c3f6d92463a08d209833eb793e46d0f7f15b3e0f62c76
|
||||
43763c02bbc6b8d3d15b63250cae98171e9260f1ffa789750f534ac11a0176d5
|
||||
export_key: 1ef15b4fa99e8a852412450ab78713aad30d21fa6966c9b8c9fb3262a
|
||||
970dc62950d4dd4ed62598229b1b72794fc0335199d9f7fcc6eaedde92cc04870e63f
|
||||
16
|
||||
session_key: 494a13c9d02c5af791ce743e8c08abd0be287e4ddd32a1dcc93072a6
|
||||
3b4109d67ae53fa3ae2d1333501a40dfbab630235688f3b000828f7084e5f4a6b3a10
|
||||
48d
|
||||
session_key: ae7951123ab5befc27e62e63f52cf472d6236cb386c968cc47b7e34f
|
||||
866aa4bc7638356a73cfce92becf39d6a7d32a1861f12130e824241fe6cab34fbd471
|
||||
a57
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Real Test Vector 3
|
||||
@@ -303,15 +303,15 @@ f3963fbb2e1
|
||||
envelope: 40d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cca9bf44
|
||||
d6e0b20c1e81fef28e92e897ca8287d49a55075b47c3988ff0fff367d79a3e350ccac
|
||||
150b4a3ff48b4770c8e84e437b3d4e68d2b95833f7788f7eb93fa6a8afb85ecb
|
||||
handshake_secret: 6936d2b78f13d865997dd37c42c741dfe4c0297199e55d7f889
|
||||
1fa4771ed2357e990b44faec69733c607b7541442b5f27ea01513b4f0b84545e0ff75
|
||||
81ea7764
|
||||
server_mac_key: 62a11be878ecfcbd7c8875e86a0f479befcb4b1742480c9ac2d2a
|
||||
5fa8d9e96c3bf60edb953ba15e32dc3e2cba60029c0c61481fdc7a80946f596b77fff
|
||||
6b18ee
|
||||
client_mac_key: e646055bf0a395c6c7c61078dabe0f0026ec6ba079ddb70f11ec9
|
||||
ba41e5ff70e37a87d8fbeca11d7dc22e2aacf2828de6e1d776b451fa1bd4419b0a6b5
|
||||
9cc353
|
||||
handshake_secret: 178c8c15e025252380c3edb1c6ad8ac52573b38d536099e2f86
|
||||
5786f5e31c642608550c0c6f281c37ce259667dd72768af31630e0eb36f1096a2e642
|
||||
1c2aa163
|
||||
server_mac_key: f3c6a8e069c54bb0d8905139f723c9e22f5c662dc08848243a665
|
||||
4c8223800019b9823523d84da2ef67ca1c14277630aace464c113be8a0a658c39e181
|
||||
a8bb71
|
||||
client_mac_key: b1ee7ce52dbd0ab72872924ff11596cb196bbabfc319e74aca78a
|
||||
de54a0f74dd15dcf5621f6d2e79161b0c9b701381d494836dedbb86e584a65b34267a
|
||||
370e01
|
||||
oprf_key: 62ef7f7d9506a14600c34f642aaf6ef8019cc82a6755db4fded5248ea14
|
||||
6030a
|
||||
~~~
|
||||
@@ -340,17 +340,17 @@ eb5e8767d175248c62c017de94057398d28bf0ed00d1b50ee4f812fd9afddf98af8cd
|
||||
58067ca43b0633b6cadd0e9d987f89623fed4d3583bdf6910c425600e90dab3c6b351
|
||||
3188a465461a67f6bbc47aeba808f7f7e2c6d66f5c3271cd9960ecef2fe0d0f749498
|
||||
6fa3d8b2bb01963537e60efb13981e138e3d4a141f55f0bef355cfb34ccd468fdacad
|
||||
75865ee7efef95f4cb6c25d477f720502601bd116f3cb70f03d9cbc25d5606b8c5764
|
||||
a1b9b11b28f2cbbd5630a836f9dbb2e7e8914639bca0fb9c99d58d42dfe3057cfe881
|
||||
491b1d0812948aa4a7a7c7f7
|
||||
KE3: 93a3c0da12392ad5336962e340b7c44ed445a67d61dae7bc5e2ccf891f6e9fac
|
||||
6596f93350d3d559f7bbb182376a07ec7377e7966b7cc549fb8d0b6fb575f157
|
||||
75865ee7efef95f4cb6c25d477f720502676f06a3b806da262139bf3fa76a1090b94d
|
||||
ac78bc3bc6f8747d5b35acf94eff3ec2ebe7d49b8cf16be64120b279fe92664e47be5
|
||||
da7e60f08f12e91192652f79
|
||||
KE3: 550e923829a544496d8316c490da2b979b78c730dd75be3a17f237a26432c19f
|
||||
bba54b6a0467b1c22ecbd6794bc5fa5b04215ba1ef974c6b090baa42c5bb984f
|
||||
export_key: 9dec51d6d0f6ce7e4345f10961053713b07310cc2e45872f57bbd2fe5
|
||||
070fdf0fb5b77c7ddaa2f3dc5c35132df7417ad7fefe0f690ad266e5a54a21d045c9c
|
||||
38
|
||||
session_key: a30c5ad775d0bc9aeb47757cc68a9332cb3acb7fc332ca07ba96d707
|
||||
1847e492c8de3541997f97a605eb9b60cde6feb8dc57322e60ec42ae78c87a2e215e2
|
||||
77f
|
||||
session_key: fd2fdd07c1bcc88e81c1b1d1de5ad62dfdef1c0b8209ff9d671e1fac
|
||||
55ce9c34d381c1fb2703ff53a797f77daccbe33047ccc167b8105171e10ec962eea20
|
||||
3aa
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Real Test Vector 4
|
||||
@@ -418,15 +418,15 @@ f3963fbb2e1
|
||||
envelope: 40d6b67fdd7da7c49894750754514dbd2070a407166bd2a5237cca9bf44
|
||||
d6e0bb4c0eab6143959a650c5f6b32acf162b1fbe95bb36c5c4f99df53865c4d3537d
|
||||
69061d80522d772cd0efdbe91f817f6bf7259a56e20b4eb9cbe9443702f4b759
|
||||
handshake_secret: f5b8fa77a67e638114899eca80c3549aa2c8e277a3412bccbe0
|
||||
a7e3943a5798d1e5ede2a847144759b17eb253f2f65efcccf82fe7b5f26e17175713d
|
||||
be845786
|
||||
server_mac_key: a8cdc5647342743be8ae6fc51e7105651b16bcb5fe4913834e7c2
|
||||
139dbc06d84c75215e7e84e1785f431c925844eb8c9c0d14959239422368166f41485
|
||||
e7847a
|
||||
client_mac_key: b326230809ee373101e8b387aa33a865f7afa375f8c3e5a8fb592
|
||||
b2e89e3117ccae85b0440421c75eb38a4ca4bde9355a549179b84748e21a3e378a3eb
|
||||
538e37
|
||||
handshake_secret: 13e7dc6afa5334b9dfffe26bee3caf744ef4add176caee464cd
|
||||
eb3d37303b90de35a8bf095df84471ac77d705f12fe232f1571de1d6a001d3e808998
|
||||
73a142dc
|
||||
server_mac_key: a58135acfb2bde92d506cf59119729a6404ad94eba294e4b52a63
|
||||
baf58cfe03f21bcf735222c7f2c27a60bd958be7f6aed50dc03a78f64e7ae4ac1ff07
|
||||
1b95aa
|
||||
client_mac_key: 1e1a8ba156aadc4a302f707d2193c9dab477b355f430d450dd407
|
||||
ce40dc75613f76ec33dec494f8a6bfdcf951eb060dac33e6572c693954fe92e33730c
|
||||
9ab0a2
|
||||
oprf_key: 62ef7f7d9506a14600c34f642aaf6ef8019cc82a6755db4fded5248ea14
|
||||
6030a
|
||||
~~~
|
||||
@@ -455,17 +455,17 @@ eb5e8767d175248c62c017de94057398d28bf0ed00d1b50ee4f812699bff7663be3c5
|
||||
d59de94d8e7e58817c7da005b39c25d25555c929e1c5cf6c1b82837b1367c839aab56
|
||||
a422c0d97719426a79a16f9869cf852100597b23b5a071cd9960ecef2fe0d0f749498
|
||||
6fa3d8b2bb01963537e60efb13981e138e3d4a141f55f0bef355cfb34ccd468fdacad
|
||||
75865ee7efef95f4cb6c25d477f7205026816ce1eb529f8f3c6cec676d8c08f5ca760
|
||||
c4322016850f329c4a2fb07364768a11a5380564d4cbceae511c873627c22c9ee9f05
|
||||
488278de0fcf646f0825efdd
|
||||
KE3: f6325cf6a7bd808fca69d54546ef61f2b5ec62fe8b96ca3c9b3e054841ab35ae
|
||||
552bc5d8eea5ec840f56578be2cd2c30b52fa03266a2f4518cf764d9ced467ec
|
||||
75865ee7efef95f4cb6c25d477f72050267cc22c87edbf3ecaca64cb33bc60dc3bfc5
|
||||
51e365f0d46a7fed0e09d96f9afbb48868f5bb3c3e05a86ed8c9476fc22c58306c5a2
|
||||
91be34388e09548ba9d70f39
|
||||
KE3: d16344e791c3f18594d22ba068984fa18ec1e9bead662b75f66826ffd627932f
|
||||
cd1ec40cd01dcf5f63f4055ebe45c7717a57a833aad360256cf1e1c20c0eae1c
|
||||
export_key: 9dec51d6d0f6ce7e4345f10961053713b07310cc2e45872f57bbd2fe5
|
||||
070fdf0fb5b77c7ddaa2f3dc5c35132df7417ad7fefe0f690ad266e5a54a21d045c9c
|
||||
38
|
||||
session_key: 867930cba2b9988acfbe8289bffff728f7c799153be737c8a915ed98
|
||||
647a7bc7a7f5f9c03deb797d36eda54de6015683a60e08f34e746e37514c4714d0644
|
||||
99f
|
||||
session_key: f6116d3aa0e4089a179713bad4d98ed5cb57e5443cae8d36ef78996f
|
||||
a60f3dc6e9fcdd63c001596b06dbc1285d80211035cc0e485506b3f7a650cbf78c5bf
|
||||
fc9
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Real Test Vector 5
|
||||
@@ -528,12 +528,12 @@ randomized_password: 06be0a1a51d56557a3adad57ba29c5510565dcd8b5078fa3
|
||||
19151b9382258fb0
|
||||
envelope: a921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6567
|
||||
0e51fad30bbcfc1f8eda0211553ab9aaf26345ad59a128e80188f035fe4924fad67b8
|
||||
handshake_secret: 12f661f08a195208b2558d6c4c9fff5527a6af971087ce9eca8
|
||||
00a77ca9c277a
|
||||
server_mac_key: e07959284f64abd523651d0619d67cd5e026081671400af6282ff
|
||||
bff85949d93
|
||||
client_mac_key: d6672fd556c0811391bb48177255341979bfd0418c15169a62cb4
|
||||
f18a40a37d6
|
||||
handshake_secret: 83a932431a8f25bad042f008efa2b07c6cd0faa8285f335b636
|
||||
3546a9f9b235f
|
||||
server_mac_key: 13e928581febfad28855e3e7f03306d61bd69489686f621535d44
|
||||
a1365b73b0d
|
||||
client_mac_key: afdc53910c25183b08b930e6953c35b3466276736d9de2e9c5efa
|
||||
f150f4082c5
|
||||
oprf_key: 2dfb5cb9aa1476093be74ca0d43e5b02862a05f5d6972614d7433acdc66
|
||||
f7f31
|
||||
~~~
|
||||
@@ -560,13 +560,13 @@ c547f70deaeca54d878c14c1aa5e1ab405dec833777132eea905c2fbb12504a67dcbe
|
||||
0e66740c76b62c13b04a38a77926e19072953319ec65e41f9bfd2ae26837b6ce688bf
|
||||
9af2542f04eec9ab96a1b9328812dc2f5c89182ed47fead61f09f71cd9960ecef2fe0
|
||||
d0f7494986fa3d8b2bb01963537e60efb13981e138e3d4a103c1701353219b53acf33
|
||||
7bf6456a83cefed8f563f1040b65afbf3b65d3bc9a19b037d9b23fea94aa69aff597a
|
||||
63f2e8109064925589923667840390535d331279
|
||||
KE3: c1252b9a0af176f5878b8f9b55934c2463ee7226d2b7d97cadfb901ca4a55b8f
|
||||
7bf6456a83cefed8f563f1040b65afbf3b65d3bc9a19b50a73b145bc87a157e8c58c0
|
||||
342e2047ee22ae37b63db17e0a82a30fcc4ecf7b
|
||||
KE3: e97cab4433aa39d598e76f13e768bba61c682947bdcf9936035e8a3a3ebfb66e
|
||||
export_key: c3c9a1b0e33ac84dd83d0b7e8af6794e17e7a3caadff289fbd9dc769a
|
||||
853c64b
|
||||
session_key: 1fc4d7b0d75bb02c36a9b10b563671967e27283c9fe0082fa16cfa94
|
||||
a12151b2
|
||||
session_key: 484ad345715ccce138ca49e4ea362c6183f0949aaaa1125dc3bc3f80
|
||||
876e7cd1
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Real Test Vector 6
|
||||
@@ -631,12 +631,12 @@ randomized_password: 06be0a1a51d56557a3adad57ba29c5510565dcd8b5078fa3
|
||||
19151b9382258fb0
|
||||
envelope: a921f2a014513bd8a90e477a629794e89fec12d12206dde662ebdcf6567
|
||||
0e51f4d7773a36a208a866301dbb2858e40dc5638017527cf91aef32d3848eebe0971
|
||||
handshake_secret: 1546f3fb57232805f5d44afd97ade62d104f976261f631b5734
|
||||
04b80fcac744f
|
||||
server_mac_key: 04142fcb444d419a62fcdb5624dc3e31888146bcf4ab980f77445
|
||||
cf43d4e61ae
|
||||
client_mac_key: a93654bfe439ea07a85a944d650148cd0794d76341a74c8409f9c
|
||||
01e7a91c2d3
|
||||
handshake_secret: 80bdcc498f22de492e90ee8101fcc7c101e158dd49c77f7c283
|
||||
816ae329ed62f
|
||||
server_mac_key: 0f82432fbdb5b90daf27a91a3acc42299a9590dba1b77932c2207
|
||||
b4cb3d4a157
|
||||
client_mac_key: 7f629eb0b1b69979b07ca1f564b3e92ed22f07569fd1d11725d93
|
||||
e46731fbe71
|
||||
oprf_key: 2dfb5cb9aa1476093be74ca0d43e5b02862a05f5d6972614d7433acdc66
|
||||
f7f31
|
||||
~~~
|
||||
@@ -663,13 +663,13 @@ c547f70deaeca54d878c14c1aa5e1ab405dec833777132eea905c2fbb12504a67dcbe
|
||||
0e66740c76b62c13b04a38a77926e19072953319ec65e41f9bfd2ae268d7f10604202
|
||||
1c80300e4c6f585980cf39fc51a4a6bba41b0729f9b240c729e5671cd9960ecef2fe0
|
||||
d0f7494986fa3d8b2bb01963537e60efb13981e138e3d4a103c1701353219b53acf33
|
||||
7bf6456a83cefed8f563f1040b65afbf3b65d3bc9a19b606ebbf63c85a49acaa94b61
|
||||
b9c5ad3d1c8368f5e73635df42c386d9dcb77c77
|
||||
KE3: 690ab24fe2cb5889bc42426cce3445ee425fbd2f368c95aac23dfbee9729c788
|
||||
7bf6456a83cefed8f563f1040b65afbf3b65d3bc9a19b84922c7e5d074838a8f27859
|
||||
2c53f61fb59f031e85ad480c0c71086b871e1b24
|
||||
KE3: 46833578cee137775f6be3f01b80748daac5a694101ad0e9e7025480552da56a
|
||||
export_key: c3c9a1b0e33ac84dd83d0b7e8af6794e17e7a3caadff289fbd9dc769a
|
||||
853c64b
|
||||
session_key: a2f482abd58500c560d0f4dbd6c6e55d573cfb350ade0a016f079dfe
|
||||
e5f42657
|
||||
session_key: 27766fabd8dd88ff37fbd0ef1a491e601d10d9f016c2b28c4bd1b0fb
|
||||
7511a3c3
|
||||
~~~
|
||||
|
||||
## Fake Test Vectors {#fake-vectors}
|
||||
@@ -737,9 +737,9 @@ a510a5978e64dcdabecbd7ee1e4380ce270e58fea58e6462d92964a1aaef72698bca1
|
||||
c673baeb04cc2bf7de5f3c2f5553464552d3a0f7698a9ca7f9c5e70c6cb1f706b2f17
|
||||
5ab9d04bbd13926e816b6811a50b4aafa9799d5ed7971e10f6eeab2a7a420bf09da9b
|
||||
27a4639645622c46358de9cf7ae813055ae2d1298251c5ba55f6b0b2d58d9ff0c88fe
|
||||
4176484be62a96db6e2a8c4d431bd1bf27e077203e6dc290083d0769a2e8d3c8755c8
|
||||
5974c32294c6f9fa0adbb34b977472a794b9fb2bdacd6347c8f9d1e0a50b6e763f384
|
||||
f32b42c8bc40ad608ba6135e
|
||||
4176484be62a96db6e2a8c4d431bd1bf27fe6c1d0537603835217d42ebf7b25819827
|
||||
32e74892fd28211b31ed33863f0beaf75ba6f59474c0aaf9d78a60a9b2f4cd24d7ab5
|
||||
4131b3c8efa192df6b72db4c
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Fake Test Vector 2
|
||||
@@ -805,9 +805,9 @@ b0e83ecc249613116d605b8d77bb68bdf76994c2bc507e2dcae4176f00afed68ad25c
|
||||
f3040a0e991acece31ca532117f5c12816997372ff031ad04ebcdce06c501da24e7b4
|
||||
db95343456e2ed260895ec362694230a1fa20e24a9c71e10f6eeab2a7a420bf09da9b
|
||||
27a4639645622c46358de9cf7ae813055ae2d122d9055eb8f83e1b497370adad5cc2a
|
||||
417bf9be436a792def0c7b7ccb92b9e27513c6a0d5d96e939563ad168990ed0156b8d
|
||||
8fb82888ce111f217b1103b4c6d67ee9738777033dd0d85e39776993b5f1f7fa4252b
|
||||
13a9c37c0fdd06204ca315c6
|
||||
417bf9be436a792def0c7b7ccb92b9e275d7c663104ea4655bd70570d975c05351655
|
||||
d55fbfb392286edb55600a23b55ce18f8c60e0d1960c960412dd08eabc81ba7ca8ae2
|
||||
b04aad65462321f51c298010
|
||||
~~~
|
||||
|
||||
### OPAQUE-3DH Fake Test Vector 3
|
||||
@@ -870,7 +870,7 @@ da65ce0a97b9085e7af07f61fd3fdd046d257cbf2183ce8766090b8041a8bf28d79dd
|
||||
4c9031ddc75bb6ddb4c291e639937840e3d39fc0d5a3d6e7723c09f7945df485bcf9a
|
||||
efe3fe82d149e84049e259bb5b33d6a2ff3b25e4bfb7eff0962821e10f6eeab2a7a42
|
||||
0bf09da9b27a4639645622c46358de9cf7ae813055ae2d12023f82bbb24e75b8683fd
|
||||
13b843cd566efae996cd0016cffdcc24ee2bc937d026f459621ce1b4126bc75fb6114
|
||||
1194c77ea9dc92d11aa1993f35336ccdbbcf13fc
|
||||
13b843cd566efae996cd0016cffdcc24ee2bc937d026f80144878749a69565b433c10
|
||||
40aff67e94f79345de888a877422b9bbe21ec329
|
||||
~~~
|
||||
"#;
|
||||
|
||||
@@ -14,9 +14,9 @@ use digest::core_api::{BlockSizeUser, CoreProxy};
|
||||
use digest::OutputSizeUser;
|
||||
use generic_array::typenum::{IsLess, IsLessOrEqual, Le, NonZero, Sum, U256};
|
||||
use generic_array::{ArrayLength, GenericArray};
|
||||
use json::JsonValue;
|
||||
use rand::rngs::OsRng;
|
||||
use rand::RngCore;
|
||||
use serde_json::Value;
|
||||
use voprf::Group;
|
||||
|
||||
use crate::ciphersuite::{CipherSuite, OprfGroup, OprfHash};
|
||||
@@ -89,11 +89,11 @@ macro_rules! parse_default {
|
||||
};
|
||||
}
|
||||
|
||||
fn decode(values: &JsonValue, key: &str) -> Option<Vec<u8>> {
|
||||
fn decode(values: &Value, key: &str) -> Option<Vec<u8>> {
|
||||
values[key].as_str().and_then(|s| hex::decode(s).ok())
|
||||
}
|
||||
|
||||
fn populate_test_vectors<CS: CipherSuite>(values: &JsonValue) -> OpaqueTestVectorParameters
|
||||
fn populate_test_vectors<CS: CipherSuite>(values: &Value) -> OpaqueTestVectorParameters
|
||||
where
|
||||
<OprfHash<CS> as OutputSizeUser>::OutputSize:
|
||||
IsLess<U256> + IsLessOrEqual<<OprfHash<CS> as BlockSizeUser>::BlockSize>,
|
||||
@@ -184,10 +184,12 @@ where
|
||||
macro_rules! json_to_test_vectors {
|
||||
( $v:ident, $vector_type:expr, $cs:expr, $cs_ty:ty) => {
|
||||
$v[$vector_type]
|
||||
.members()
|
||||
.as_array()
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.filter_map(|x| {
|
||||
if x.has_key($cs) {
|
||||
Some(populate_test_vectors::<$cs_ty>(&x[$cs]))
|
||||
if let Some(val) = x.get($cs) {
|
||||
Some(populate_test_vectors::<$cs_ty>(val))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -198,8 +200,9 @@ macro_rules! json_to_test_vectors {
|
||||
|
||||
#[test]
|
||||
fn tests() -> Result<(), ProtocolError> {
|
||||
let rfc = json::parse(super::parser::rfc_to_json(super::opaque_vectors::VECTORS).as_str())
|
||||
.expect("Could not parse json");
|
||||
let rfc: Value =
|
||||
serde_json::from_str(super::parser::rfc_to_json(super::opaque_vectors::VECTORS).as_str())
|
||||
.expect("Could not parse json");
|
||||
|
||||
#[cfg(feature = "ristretto255")]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user