From 737f8d597176b9b1cdae18d1d37cf137ab97adae Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Tue, 13 May 2025 10:50:16 -0400 Subject: [PATCH] chore(rust): prepare rust 1.1.0 release --- AwsEncryptionSDK/runtimes/rust/Cargo.toml | 6 +- .../runtimes/rust/start_release.sh | 2 +- TestVectors/runtimes/rust/Cargo.toml | 4 +- releases/rust/esdk/Cargo.toml | 28 +- releases/rust/esdk/examples/README.md | 8 +- .../regional_role_client_supplier.rs | 2 +- .../rust/esdk/examples/example_utils/utils.rs | 16 +- releases/rust/esdk/src/aes_gcm.rs | 53 +- releases/rust/esdk/src/aes_kdf_ctr.rs | 8 +- releases/rust/esdk/src/dafny_libraries.rs | 13 + releases/rust/esdk/src/ddb.rs | 8 +- ...t_cryptographic_materials_manager_input.rs | 10 +- .../builders.rs | 6 +- ...e_required_encryption_context_cmm_input.rs | 20 +- .../builders.rs | 12 +- ...t_cryptographic_materials_manager_input.rs | 10 +- ...e_required_encryption_context_cmm_input.rs | 20 +- .../types/error.rs | 15 +- .../src/deps/com_amazonaws_dynamodb/client.rs | 4 + .../conversions/batch_statement_error.rs | 24 + .../conversions/batch_statement_request.rs | 12 + .../delete_item/_delete_item_request.rs | 12 + .../_execute_statement_request.rs | 12 + .../conversions/parameterized_statement.rs | 12 + .../conversions/put_item/_put_item_request.rs | 12 + .../update_item/_update_item_request.rs | 12 + releases/rust/esdk/src/digest.rs | 6 +- releases/rust/esdk/src/ecdh.rs | 44 +- releases/rust/esdk/src/ecdsa.rs | 24 +- releases/rust/esdk/src/hmac.rs | 22 +- .../esdk/src/implementation_from_dafny.rs | 5958 +++++++++-------- releases/rust/esdk/src/kms.rs | 8 +- releases/rust/esdk/src/random.rs | 2 +- releases/rust/esdk/src/rsa.rs | 27 +- releases/rust/esdk/src/sets.rs | 2 +- releases/rust/esdk/src/uuid.rs | 4 +- 36 files changed, 3429 insertions(+), 3009 deletions(-) diff --git a/AwsEncryptionSDK/runtimes/rust/Cargo.toml b/AwsEncryptionSDK/runtimes/rust/Cargo.toml index 0c5e02dbf..2ba9a4c69 100644 --- a/AwsEncryptionSDK/runtimes/rust/Cargo.toml +++ b/AwsEncryptionSDK/runtimes/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-esdk" -version = "1.0.0" +version = "1.1.0" edition = "2021" rust-version = "1.81.0" keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"] @@ -17,8 +17,8 @@ readme = "README.md" [dependencies] aws-config = "1.6.2" -aws-lc-rs = "=1.13.0" -aws-lc-sys = "=0.28.2" +aws-lc-rs = "=1.13.1" +aws-lc-sys = "=0.29.0" aws-sdk-dynamodb = "1.73.0" aws-sdk-kms = "1.67.0" aws-smithy-runtime-api = {version = "1.8.0", features = ["client"] } diff --git a/AwsEncryptionSDK/runtimes/rust/start_release.sh b/AwsEncryptionSDK/runtimes/rust/start_release.sh index aeda95525..3b5b2c4bf 100755 --- a/AwsEncryptionSDK/runtimes/rust/start_release.sh +++ b/AwsEncryptionSDK/runtimes/rust/start_release.sh @@ -65,7 +65,7 @@ cargo clippy --example main # replace local path with latest dafny-runtime from crates.io cargo rm dafny_runtime -cargo add dafny-runtime -F sync +cargo add dafny-runtime -F sync -F small-int # Run cargo test and example tests cargo test --release diff --git a/TestVectors/runtimes/rust/Cargo.toml b/TestVectors/runtimes/rust/Cargo.toml index df5d4aa01..f8925df0f 100644 --- a/TestVectors/runtimes/rust/Cargo.toml +++ b/TestVectors/runtimes/rust/Cargo.toml @@ -15,8 +15,8 @@ wrapped-client = [] [dependencies] aws-config = "1.6.2" -aws-lc-rs = "=1.13.0" -aws-lc-sys = "=0.28.2" +aws-lc-rs = "=1.13.1" +aws-lc-sys = "=0.29.0" aws-sdk-dynamodb = "1.73.0" aws-sdk-kms = "1.67.0" aws-smithy-runtime-api = {version = "1.8.0", features = ["client"] } diff --git a/releases/rust/esdk/Cargo.toml b/releases/rust/esdk/Cargo.toml index 73029ec9b..c41e16828 100644 --- a/releases/rust/esdk/Cargo.toml +++ b/releases/rust/esdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aws-esdk" -version = "1.0.0" +version = "1.1.0" edition = "2021" rust-version = "1.81.0" keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"] @@ -16,21 +16,21 @@ readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -aws-config = "1.5.15" -aws-lc-rs = "=1.12.2" -aws-lc-sys = "=0.25.1" -aws-sdk-dynamodb = "1.62.0" -aws-sdk-kms = "1.57.0" -aws-smithy-runtime-api = {version = "1.7.3", features = ["client"] } -aws-smithy-types = "1.2.12" -chrono = "0.4.39" +aws-config = "1.6.2" +aws-lc-rs = "=1.13.1" +aws-lc-sys = "=0.29.0" +aws-sdk-dynamodb = "1.73.0" +aws-sdk-kms = "1.67.0" +aws-smithy-runtime-api = {version = "1.8.0", features = ["client"] } +aws-smithy-types = "1.3.1" +chrono = "0.4.41" cpu-time = "1.0.0" -dafny-runtime = { version = "0.2.0", features = ["sync"] } +dafny-runtime = { version = "0.3.0", features = ["sync", "small-int"] } dashmap = "6.1.0" -pem = "3.0.4" -rand = "0.9.0" -tokio = {version = "1.43.0", features = ["full"] } -uuid = { version = "1.12.1", features = ["v4"] } +pem = "3.0.5" +rand = "0.9.1" +tokio = {version = "1.45.0", features = ["full"] } +uuid = { version = "1.16.0", features = ["v4"] } [[example]] name = "main" diff --git a/releases/rust/esdk/examples/README.md b/releases/rust/esdk/examples/README.md index 52c81baec..b0ab8e14e 100644 --- a/releases/rust/esdk/examples/README.md +++ b/releases/rust/esdk/examples/README.md @@ -7,9 +7,9 @@ and how to set up some common configuration patterns. ## APIs -The AWS Encryption SDK provides two high-level APIs: -one-step APIs that process the entire operation in memory -and streaming APIs. +The AWS Encryption SDK provides a high-level, +one-step API that processes encryption +and decryption operations entirely in memory. You can find examples that demonstrate these APIs in the [`examples/`](./) directory. @@ -48,6 +48,7 @@ We start with AWS KMS examples, then show how to use other wrapping keys. Keyrings are the most common way for you to configure the AWS Encryption SDK. They determine how the AWS Encryption SDK protects your data. +For more information about keyrings, see the [AWS Developer Guide on using Keyrings](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/choose-keyring.html). You can find these examples in [`examples/keyring`](./keyring). ### Cryptographic Materials Managers @@ -61,6 +62,7 @@ This can include things like enforcing the use of certain algorithm suites or encryption context settings, reusing data keys across messages, or changing how you interact with keyrings. +For more information about cryptographic materials managers, see the [AWS Developer Guide on cryptographic materials managers](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#crypt-materials-manager). You can find these examples in [`examples/cryptographic_materials_manager`](./cryptographic_materials_manager). diff --git a/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs b/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs index b1c3f7876..df314f190 100644 --- a/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs +++ b/releases/rust/esdk/examples/client_supplier/regional_role_client_supplier.rs @@ -45,7 +45,7 @@ impl ClientSupplier for RegionalRoleClientSupplier { let sdk_config = tokio::task::block_in_place(|| { tokio::runtime::Handle::current().block_on(async { - aws_config::load_defaults(aws_config::BehaviorVersion::v2024_03_28()).await + aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await }) }); let kms_config = aws_sdk_kms::config::Builder::from(&sdk_config) diff --git a/releases/rust/esdk/examples/example_utils/utils.rs b/releases/rust/esdk/examples/example_utils/utils.rs index fdde8f5f4..9d47152de 100644 --- a/releases/rust/esdk/examples/example_utils/utils.rs +++ b/releases/rust/esdk/examples/example_utils/utils.rs @@ -128,19 +128,19 @@ pub(crate) fn x962_to_x509(public_key: &[u8], nid: i32) -> Result, Strin fn get_nid(x: EcdhCurveSpec) -> i32 { match x { - EcdhCurveSpec::EccNistP256 {} => aws_lc_sys::NID_X9_62_prime256v1, - EcdhCurveSpec::EccNistP384 {} => aws_lc_sys::NID_secp384r1, - EcdhCurveSpec::EccNistP521 {} => aws_lc_sys::NID_secp521r1, - EcdhCurveSpec::Sm2 {} => panic!("No SM2 in Rust"), + EcdhCurveSpec::EccNistP256 => aws_lc_sys::NID_X9_62_prime256v1, + EcdhCurveSpec::EccNistP384 => aws_lc_sys::NID_secp384r1, + EcdhCurveSpec::EccNistP521 => aws_lc_sys::NID_secp521r1, + EcdhCurveSpec::Sm2 => panic!("No SM2 in Rust"), } } fn get_alg(x: EcdhCurveSpec) -> &'static aws_lc_rs::agreement::Algorithm { match x { - EcdhCurveSpec::EccNistP256 {} => &aws_lc_rs::agreement::ECDH_P256, - EcdhCurveSpec::EccNistP384 {} => &aws_lc_rs::agreement::ECDH_P384, - EcdhCurveSpec::EccNistP521 {} => &aws_lc_rs::agreement::ECDH_P521, - EcdhCurveSpec::Sm2 {} => panic!("No SM2 in Rust"), + EcdhCurveSpec::EccNistP256 => &aws_lc_rs::agreement::ECDH_P256, + EcdhCurveSpec::EccNistP384 => &aws_lc_rs::agreement::ECDH_P384, + EcdhCurveSpec::EccNistP521 => &aws_lc_rs::agreement::ECDH_P521, + EcdhCurveSpec::Sm2 => panic!("No SM2 in Rust"), } } diff --git a/releases/rust/esdk/src/aes_gcm.rs b/releases/rust/esdk/src/aes_gcm.rs index b5f12b997..0f5b0aba4 100644 --- a/releases/rust/esdk/src/aes_gcm.rs +++ b/releases/rust/esdk/src/aes_gcm.rs @@ -113,10 +113,10 @@ impl AES_GCM { msg: &::dafny_runtime::Sequence, aad: &::dafny_runtime::Sequence, ) -> Rc<_Wrappers_Compile::Result, Rc>> { - let iv: Vec = iv.iter().collect(); - let key: Vec = key.iter().collect(); - let msg: Vec = msg.iter().collect(); - let aad: Vec = aad.iter().collect(); + let iv = &iv.to_array(); + let key = &key.to_array(); + let msg = &msg.to_array(); + let aad = &aad.to_array(); if *self.keyLength() as usize != key.len() { let msg = format!( @@ -135,11 +135,11 @@ impl AES_GCM { return enc_result(&msg); } - match self.do_aes_encrypt(&iv, &key, &msg, &aad) { + match self.do_aes_encrypt(iv, key, msg, aad) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { value: Rc::new(AESEncryptOutput::AESEncryptOutput { - cipherText: x.cipher_text.iter().cloned().collect(), - authTag: x.auth_tag.iter().cloned().collect(), + cipherText: dafny_runtime::Sequence::from_array_owned(x.cipher_text), + authTag: dafny_runtime::Sequence::from_array_owned(x.auth_tag), }), }), Err(e) => { @@ -158,11 +158,11 @@ impl AES_GCM { iv: &::dafny_runtime::Sequence, aad: &::dafny_runtime::Sequence, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let key: Vec = key.iter().collect(); - let cipher_text: Vec = cipher_text.iter().collect(); - let auth_tag: Vec = auth_tag.iter().collect(); - let iv: Vec = iv.iter().collect(); - let aad: Vec = aad.iter().collect(); + let key = &key.to_array(); + let cipher_text = &cipher_text.to_array(); + let auth_tag = &auth_tag.to_array(); + let iv = &iv.to_array(); + let aad = &aad.to_array(); if *self.keyLength() as usize != key.len() { let msg = format!( @@ -191,9 +191,9 @@ impl AES_GCM { return dec_result(&msg); } - match self.do_aes_decrypt(&key, &cipher_text, &auth_tag, &iv, &aad) { + match self.do_aes_decrypt(key, cipher_text, auth_tag, iv, aad) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { - value: x.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(x), }), Err(e) => { let msg = format!("AES Decrypt : {}", e); @@ -208,23 +208,18 @@ mod tests { use super::*; #[test] fn test_generate() { - let iv: ::dafny_runtime::Sequence = [1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] - .iter() - .cloned() - .collect(); - let key: ::dafny_runtime::Sequence = [ + let iv: ::dafny_runtime::Sequence = dafny_runtime::Sequence::from_array_owned(vec![ + 1u8, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + ]); + let key: ::dafny_runtime::Sequence = dafny_runtime::Sequence::from_array_owned(vec![ 2u8, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - ] - .iter() - .cloned() - .collect(); - let msg: ::dafny_runtime::Sequence = [2u8, 4, 6, 8, 10, 12].iter().cloned().collect(); - let aad: ::dafny_runtime::Sequence = - [3u8, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] - .iter() - .cloned() - .collect(); + ]); + let msg: ::dafny_runtime::Sequence = + dafny_runtime::Sequence::from_array_owned(vec![2u8, 4, 6, 8, 10, 12]); + let aad: ::dafny_runtime::Sequence = dafny_runtime::Sequence::from_array_owned(vec![ + 3u8, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + ]); let alg = AES_GCM::AES_GCM { keyLength: 32, diff --git a/releases/rust/esdk/src/aes_kdf_ctr.rs b/releases/rust/esdk/src/aes_kdf_ctr.rs index 8d945da82..cb940bbbc 100644 --- a/releases/rust/esdk/src/aes_kdf_ctr.rs +++ b/releases/rust/esdk/src/aes_kdf_ctr.rs @@ -58,11 +58,11 @@ pub mod AesKdfCtr { Rc, >, > { - let nonce: Vec = nonce.iter().collect(); - let key: Vec = key.iter().collect(); - match ctr_stream(&nonce, &key, length) { + let nonce = &nonce.to_array(); + let key = &key.to_array(); + match ctr_stream(nonce, key, length) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { - value: x.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(x), }), Err(e) => { let msg = format!("Aes Kdf Ctr : {}", e); diff --git a/releases/rust/esdk/src/dafny_libraries.rs b/releases/rust/esdk/src/dafny_libraries.rs index 7781dc322..75cefe7b8 100644 --- a/releases/rust/esdk/src/dafny_libraries.rs +++ b/releases/rust/esdk/src/dafny_libraries.rs @@ -180,6 +180,19 @@ pub mod DafnyLibraries { let file_name = dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(path); let path = Path::new(&file_name); + if let Some(parent) = path.parent() { + if let Err(why) = std::fs::create_dir_all(parent) { + let err_msg = format!( + "couldn't create directory {} from {}: {}", + path.display(), + curr_dir(), + why + ); + let err_msg = dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&err_msg); + return (true, err_msg); + } + } + let maybe_file = std::fs::OpenOptions::new() .append(append) .write(true) diff --git a/releases/rust/esdk/src/ddb.rs b/releases/rust/esdk/src/ddb.rs index fe250f86d..c5f65adaf 100644 --- a/releases/rust/esdk/src/ddb.rs +++ b/releases/rust/esdk/src/ddb.rs @@ -30,11 +30,11 @@ impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny: let shared_config = match tokio::runtime::Handle::try_current() { Ok(curr) => tokio::task::block_in_place(|| { curr.block_on(async { - aws_config::load_defaults(aws_config::BehaviorVersion::v2024_03_28()).await + aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await }) }), Err(_) => DAFNY_TOKIO_RUNTIME.block_on(aws_config::load_defaults( - aws_config::BehaviorVersion::v2024_03_28(), + aws_config::BehaviorVersion::latest(), )), }; let shared_config = shared_config @@ -58,11 +58,11 @@ impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny: let shared_config = match tokio::runtime::Handle::try_current() { Ok(curr) => tokio::task::block_in_place(|| { curr.block_on(async { - aws_config::load_defaults(aws_config::BehaviorVersion::v2024_03_28()).await + aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await }) }), Err(_) => DAFNY_TOKIO_RUNTIME.block_on(aws_config::load_defaults( - aws_config::BehaviorVersion::v2024_03_28(), + aws_config::BehaviorVersion::latest(), )), }; let inner = aws_sdk_dynamodb::Client::new(&shared_config); diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/_create_default_cryptographic_materials_manager_input.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/_create_default_cryptographic_materials_manager_input.rs index f0ed27cf7..5ec14556c 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/_create_default_cryptographic_materials_manager_input.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/_create_default_cryptographic_materials_manager_input.rs @@ -5,13 +5,13 @@ #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] /// Inputs for creating a Default Cryptographic Materials Manager. pub struct CreateDefaultCryptographicMaterialsManagerInput { - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub keyring: ::std::option::Option< crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, >, } impl CreateDefaultCryptographicMaterialsManagerInput { - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn keyring( &self, ) -> &::std::option::Option< @@ -38,7 +38,7 @@ pub struct CreateDefaultCryptographicMaterialsManagerInputBuilder { >, } impl CreateDefaultCryptographicMaterialsManagerInputBuilder { - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn keyring( mut self, input: impl ::std::convert::Into< @@ -48,7 +48,7 @@ impl CreateDefaultCryptographicMaterialsManagerInputBuilder { self.keyring = ::std::option::Option::Some(input.into()); self } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn set_keyring( mut self, input: ::std::option::Option< @@ -58,7 +58,7 @@ impl CreateDefaultCryptographicMaterialsManagerInputBuilder { self.keyring = input; self } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn get_keyring( &self, ) -> &::std::option::Option< diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/builders.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/builders.rs index 2259eeb2e..f862e2643 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/builders.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_default_cryptographic_materials_manager/builders.rs @@ -64,7 +64,7 @@ impl CreateDefaultCryptographicMaterialsManagerFluentBuilder { crate::deps::aws_cryptography_materialProviders::operation::create_default_cryptographic_materials_manager::CreateDefaultCryptographicMaterialsManager::send(&self.client, input).await } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn keyring( mut self, input: impl ::std::convert::Into< @@ -74,7 +74,7 @@ impl CreateDefaultCryptographicMaterialsManagerFluentBuilder { self.inner = self.inner.keyring(input.into()); self } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn set_keyring( mut self, input: ::std::option::Option< @@ -84,7 +84,7 @@ impl CreateDefaultCryptographicMaterialsManagerFluentBuilder { self.inner = self.inner.set_keyring(input); self } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn get_keyring( &self, ) -> &::std::option::Option< diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/_create_required_encryption_context_cmm_input.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/_create_required_encryption_context_cmm_input.rs index 5528ebdf0..7a416cec6 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/_create_required_encryption_context_cmm_input.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/_create_required_encryption_context_cmm_input.rs @@ -5,15 +5,15 @@ #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] /// Inputs for creating an Required Encryption Context Cryptographic Materials Manager. pub struct CreateRequiredEncryptionContextCmmInput { - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub keyring: ::std::option::Option, /// A list of Encryption Context keys which are required to be supplied during encryption and decryption, and correspond to Encryption Context key-value pairs which are not stored on the resulting message. pub required_encryption_context_keys: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -/// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. +/// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub underlying_cmm: ::std::option::Option, } impl CreateRequiredEncryptionContextCmmInput { - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn keyring( &self, ) -> &::std::option::Option< @@ -27,7 +27,7 @@ impl CreateRequiredEncryptionContextCmmInput { ) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.required_encryption_context_keys } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn underlying_cmm(&self) -> &::std::option::Option{ &self.underlying_cmm } @@ -50,7 +50,7 @@ pub(crate) required_encryption_context_keys: ::std::option::Option<::std::vec::V pub(crate) underlying_cmm: ::std::option::Option, } impl CreateRequiredEncryptionContextCmmInputBuilder { - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn keyring( mut self, input: impl ::std::convert::Into< @@ -60,7 +60,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.keyring = ::std::option::Option::Some(input.into()); self } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn set_keyring( mut self, input: ::std::option::Option< @@ -70,7 +70,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.keyring = input; self } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn get_keyring( &self, ) -> &::std::option::Option< @@ -100,7 +100,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { ) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.required_encryption_context_keys } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn underlying_cmm( mut self, input: impl ::std::convert::Into, @@ -108,7 +108,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.underlying_cmm = ::std::option::Option::Some(input.into()); self } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn set_underlying_cmm( mut self, input: ::std::option::Option, @@ -116,7 +116,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.underlying_cmm = input; self } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn get_underlying_cmm(&self) -> &::std::option::Option{ &self.underlying_cmm } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/builders.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/builders.rs index ac3eca555..e1500a543 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/builders.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/operation/create_required_encryption_context_cmm/builders.rs @@ -64,7 +64,7 @@ impl CreateRequiredEncryptionContextCmmFluentBuilder { crate::deps::aws_cryptography_materialProviders::operation::create_required_encryption_context_cmm::CreateRequiredEncryptionContextCmm::send(&self.client, input).await } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn keyring( mut self, input: impl ::std::convert::Into< @@ -74,7 +74,7 @@ impl CreateRequiredEncryptionContextCmmFluentBuilder { self.inner = self.inner.keyring(input.into()); self } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn set_keyring( mut self, input: ::std::option::Option< @@ -84,7 +84,7 @@ impl CreateRequiredEncryptionContextCmmFluentBuilder { self.inner = self.inner.set_keyring(input); self } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn get_keyring( &self, ) -> &::std::option::Option< @@ -114,7 +114,7 @@ impl CreateRequiredEncryptionContextCmmFluentBuilder { ) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { self.inner.get_required_encryption_context_keys() } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn underlying_cmm( mut self, input: impl ::std::convert::Into, @@ -122,7 +122,7 @@ impl CreateRequiredEncryptionContextCmmFluentBuilder { self.inner = self.inner.underlying_cmm(input.into()); self } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn set_underlying_cmm( mut self, input: ::std::option::Option, @@ -130,7 +130,7 @@ impl CreateRequiredEncryptionContextCmmFluentBuilder { self.inner = self.inner.set_underlying_cmm(input); self } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn get_underlying_cmm(&self) -> &::std::option::Option{ self.inner.get_underlying_cmm() } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_default_cryptographic_materials_manager_input.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_default_cryptographic_materials_manager_input.rs index fa11f3fe8..5f89405bd 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_default_cryptographic_materials_manager_input.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_default_cryptographic_materials_manager_input.rs @@ -5,13 +5,13 @@ #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] /// Inputs for creating a Default Cryptographic Materials Manager. pub struct CreateDefaultCryptographicMaterialsManagerInput { - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub keyring: ::std::option::Option< crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef, >, } impl CreateDefaultCryptographicMaterialsManagerInput { - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn keyring( &self, ) -> &::std::option::Option< @@ -38,7 +38,7 @@ pub struct CreateDefaultCryptographicMaterialsManagerInputBuilder { >, } impl CreateDefaultCryptographicMaterialsManagerInputBuilder { - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn keyring( mut self, input: impl ::std::convert::Into< @@ -48,7 +48,7 @@ impl CreateDefaultCryptographicMaterialsManagerInputBuilder { self.keyring = ::std::option::Option::Some(input.into()); self } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn set_keyring( mut self, input: ::std::option::Option< @@ -58,7 +58,7 @@ impl CreateDefaultCryptographicMaterialsManagerInputBuilder { self.keyring = input; self } - /// The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys. + /// The Keyring that the created Default Cryptographic Materials Manager will use to wrap data keys. pub fn get_keyring( &self, ) -> &::std::option::Option< diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_required_encryption_context_cmm_input.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_required_encryption_context_cmm_input.rs index d78d84673..0c001378b 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_required_encryption_context_cmm_input.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/_create_required_encryption_context_cmm_input.rs @@ -5,15 +5,15 @@ #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] /// Inputs for creating an Required Encryption Context Cryptographic Materials Manager. pub struct CreateRequiredEncryptionContextCmmInput { - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub keyring: ::std::option::Option, /// A list of Encryption Context keys which are required to be supplied during encryption and decryption, and correspond to Encryption Context key-value pairs which are not stored on the resulting message. pub required_encryption_context_keys: ::std::option::Option<::std::vec::Vec<::std::string::String>>, -/// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. +/// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub underlying_cmm: ::std::option::Option, } impl CreateRequiredEncryptionContextCmmInput { - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn keyring( &self, ) -> &::std::option::Option< @@ -27,7 +27,7 @@ impl CreateRequiredEncryptionContextCmmInput { ) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.required_encryption_context_keys } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn underlying_cmm(&self) -> &::std::option::Option{ &self.underlying_cmm } @@ -50,7 +50,7 @@ pub(crate) required_encryption_context_keys: ::std::option::Option<::std::vec::V pub(crate) underlying_cmm: ::std::option::Option, } impl CreateRequiredEncryptionContextCmmInputBuilder { - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn keyring( mut self, input: impl ::std::convert::Into< @@ -60,7 +60,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.keyring = ::std::option::Option::Some(input.into()); self } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn set_keyring( mut self, input: ::std::option::Option< @@ -70,7 +70,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.keyring = input; self } - /// The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input. + /// The Keyring that the created Cryptographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryptographic Materials Manager must be specified as input. pub fn get_keyring( &self, ) -> &::std::option::Option< @@ -100,7 +100,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { ) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.required_encryption_context_keys } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn underlying_cmm( mut self, input: impl ::std::convert::Into, @@ -108,7 +108,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.underlying_cmm = ::std::option::Option::Some(input.into()); self } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn set_underlying_cmm( mut self, input: ::std::option::Option, @@ -116,7 +116,7 @@ impl CreateRequiredEncryptionContextCmmInputBuilder { self.underlying_cmm = input; self } - /// The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified. + /// The Cryptographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryptographic Materials Manager must be specified. pub fn get_underlying_cmm(&self) -> &::std::option::Option{ &self.underlying_cmm } diff --git a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/error.rs b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/error.rs index 6be7d1055..e1fae419f 100644 --- a/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/error.rs +++ b/releases/rust/esdk/src/deps/aws_cryptography_materialProviders/types/error.rs @@ -13,12 +13,23 @@ pub enum Error { message: ::std::string::String, }, - #[allow(missing_docs)] + /// The requested element is not in the cache; AWS Crypto Tools intends to deprecate this for a non-error control scheme. EntryDoesNotExist { message: ::std::string::String, }, - #[allow(missing_docs)] + /// Thrown if a request is waiting for longer than `inflightTTL`. + /// The Storm Tracking Cache protects against unbounded parallelism. + /// The Storm Tracking Cache will only work `fanOut` number of concurrent requests. + /// As requests are completed, + /// queued requests are worked. + /// If a request is not worked in less than `inflightTTL`, + /// this exception is thrown. + /// + /// Note that this exception does NOT imply that the material requested + /// is invalid or unreachable; + /// it only implies that the cache had more requests to handle than it could + /// with the given `fanOut` and `inflightTTL` constraints. InFlightTtlExceeded { message: ::std::string::String, }, diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/client.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/client.rs index 4c7527731..21eaf8fc6 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/client.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/client.rs @@ -212,6 +212,7 @@ impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny: .set_condition_expression(inner_input.r#condition_expression) .set_expression_attribute_names(inner_input.r#expression_attribute_names) .set_expression_attribute_values(inner_input.r#expression_attribute_values) +.set_return_values_on_condition_check_failure(inner_input.r#return_values_on_condition_check_failure) .send() .await }) @@ -565,6 +566,7 @@ impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny: .set_next_token(inner_input.r#next_token) .set_return_consumed_capacity(inner_input.r#return_consumed_capacity) .set_limit(inner_input.r#limit) +.set_return_values_on_condition_check_failure(inner_input.r#return_values_on_condition_check_failure) .send() .await }) @@ -859,6 +861,7 @@ impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny: .set_condition_expression(inner_input.r#condition_expression) .set_expression_attribute_names(inner_input.r#expression_attribute_names) .set_expression_attribute_values(inner_input.r#expression_attribute_values) +.set_return_values_on_condition_check_failure(inner_input.r#return_values_on_condition_check_failure) .send() .await }) @@ -1202,6 +1205,7 @@ impl crate::r#software::amazon::cryptography::services::dynamodb::internaldafny: .set_condition_expression(inner_input.r#condition_expression) .set_expression_attribute_names(inner_input.r#expression_attribute_names) .set_expression_attribute_values(inner_input.r#expression_attribute_values) +.set_return_values_on_condition_check_failure(inner_input.r#return_values_on_condition_check_failure) .send() .await }) diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_error.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_error.rs index 5cfdcb5e5..22d9ca58f 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_error.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_error.rs @@ -13,6 +13,18 @@ pub fn to_dafny( }) , Message: crate::standard_library_conversions::ostring_to_dafny(&value.message), + Item: +::dafny_runtime::Rc::new(match &value.item { + Some(x) => crate::r#_Wrappers_Compile::Option::Some { value : + ::dafny_runtime::dafny_runtime_conversions::hashmap_to_dafny_map(x, + |k| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(&k), + |v| crate::deps::com_amazonaws_dynamodb::conversions::attribute_value::to_dafny(v) +, + ) + }, + None => crate::r#_Wrappers_Compile::Option::None {} +}) +, } ) } @@ -31,5 +43,17 @@ pub fn from_dafny( } ) .set_message(crate::standard_library_conversions::ostring_from_dafny(dafny_value.Message().clone())) + .set_item(match (*dafny_value.Item()).as_ref() { + crate::r#_Wrappers_Compile::Option::Some { value } => + Some( + ::dafny_runtime::dafny_runtime_conversions::dafny_map_to_hashmap(value, + |k: &::dafny_runtime::dafny_runtime_conversions::DafnySequence<::dafny_runtime::dafny_runtime_conversions::DafnyCharUTF16>| dafny_runtime::dafny_runtime_conversions::unicode_chars_false::dafny_string_to_string(k), + |v: &::dafny_runtime::Rc| crate::deps::com_amazonaws_dynamodb::conversions::attribute_value::from_dafny(v.clone()) +, + ) + ), + _ => None +} +) .build() } diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_request.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_request.rs index 45e33585e..64e9810e1 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_request.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/batch_statement_request.rs @@ -19,6 +19,11 @@ pub fn to_dafny( }) , ConsistentRead: crate::standard_library_conversions::obool_to_dafny(&value.consistent_read), + ReturnValuesOnConditionCheckFailure: ::dafny_runtime::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, } ) } @@ -42,6 +47,13 @@ pub fn from_dafny( } ) .set_consistent_read(crate::standard_library_conversions::obool_from_dafny(dafny_value.ConsistentRead().clone())) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} +) .build() .unwrap() } diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/delete_item/_delete_item_request.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/delete_item/_delete_item_request.rs index 464b1a0a3..2f4e7e2a1 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/delete_item/_delete_item_request.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/delete_item/_delete_item_request.rs @@ -70,6 +70,11 @@ pub fn to_dafny( }, None => crate::r#_Wrappers_Compile::Option::None {} }) +, + ReturnValuesOnConditionCheckFailure: ::dafny_runtime::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) , }) } @@ -150,6 +155,13 @@ pub fn from_dafny( ), _ => None } +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} ) .build() .unwrap() diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/execute_statement/_execute_statement_request.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/execute_statement/_execute_statement_request.rs index d6fbaa8b8..b659022c2 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/execute_statement/_execute_statement_request.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/execute_statement/_execute_statement_request.rs @@ -27,6 +27,11 @@ pub fn to_dafny( }) , Limit: crate::standard_library_conversions::oint_to_dafny(value.limit), + ReturnValuesOnConditionCheckFailure: ::dafny_runtime::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) +, }) } #[allow(dead_code)] @@ -58,6 +63,13 @@ pub fn from_dafny( } ) .set_limit(crate::standard_library_conversions::oint_from_dafny(dafny_value.Limit().clone())) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} +) .build() .unwrap() } diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/parameterized_statement.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/parameterized_statement.rs index be3b426c9..46ad37eae 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/parameterized_statement.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/parameterized_statement.rs @@ -17,6 +17,11 @@ pub fn to_dafny( }, None => crate::r#_Wrappers_Compile::Option::None {} }) +, + ReturnValuesOnConditionCheckFailure: ::dafny_runtime::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) , } ) @@ -39,6 +44,13 @@ pub fn from_dafny( ), _ => None } +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} ) .build() .unwrap() diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/put_item/_put_item_request.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/put_item/_put_item_request.rs index a8e69e620..b62f82434 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/put_item/_put_item_request.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/put_item/_put_item_request.rs @@ -70,6 +70,11 @@ pub fn to_dafny( }, None => crate::r#_Wrappers_Compile::Option::None {} }) +, + ReturnValuesOnConditionCheckFailure: ::dafny_runtime::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) , }) } @@ -150,6 +155,13 @@ pub fn from_dafny( ), _ => None } +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} ) .build() .unwrap() diff --git a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/update_item/_update_item_request.rs b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/update_item/_update_item_request.rs index 5596b3cb9..4f6d4c49d 100644 --- a/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/update_item/_update_item_request.rs +++ b/releases/rust/esdk/src/deps/com_amazonaws_dynamodb/conversions/update_item/_update_item_request.rs @@ -83,6 +83,11 @@ pub fn to_dafny( }, None => crate::r#_Wrappers_Compile::Option::None {} }) +, + ReturnValuesOnConditionCheckFailure: ::dafny_runtime::Rc::new(match &value.return_values_on_condition_check_failure { + Some(x) => crate::_Wrappers_Compile::Option::Some { value: crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::to_dafny(x.clone()) }, + None => crate::_Wrappers_Compile::Option::None { } +}) , }) } @@ -176,6 +181,13 @@ pub fn from_dafny( ), _ => None } +) + .set_return_values_on_condition_check_failure(match &**dafny_value.ReturnValuesOnConditionCheckFailure() { + crate::r#_Wrappers_Compile::Option::Some { value } => Some( + crate::deps::com_amazonaws_dynamodb::conversions::return_values_on_condition_check_failure::from_dafny(value) + ), + _ => None, +} ) .build() .unwrap() diff --git a/releases/rust/esdk/src/digest.rs b/releases/rust/esdk/src/digest.rs index 10dffd979..fda68da34 100644 --- a/releases/rust/esdk/src/digest.rs +++ b/releases/rust/esdk/src/digest.rs @@ -27,10 +27,10 @@ impl crate::ExternDigest::_default { DigestAlgorithm::SHA_384 {} => &digest::SHA384, DigestAlgorithm::SHA_256 {} => &digest::SHA256, }; - let message_vec: Vec = message.iter().collect(); - let result = digest::digest(algorithm, &message_vec); + let message_vec = &message.to_array(); + let result = digest::digest(algorithm, message_vec); ::dafny_runtime::Rc::new(_Wrappers_Compile::Result::Success { - value: result.as_ref().iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(result.as_ref().to_vec()), }) } } diff --git a/releases/rust/esdk/src/ecdh.rs b/releases/rust/esdk/src/ecdh.rs index 5067dcf28..111542371 100644 --- a/releases/rust/esdk/src/ecdh.rs +++ b/releases/rust/esdk/src/ecdh.rs @@ -71,7 +71,7 @@ pub mod ECDH { use std::ptr::null_mut; const ELEM_MAX_BITS: usize = 521; - const ELEM_MAX_BYTES: usize = (ELEM_MAX_BITS + 7) / 8; + const ELEM_MAX_BYTES: usize = ELEM_MAX_BITS.div_ceil(8); const PUBLIC_KEY_MAX_LEN: usize = 1 + (2 * ELEM_MAX_BYTES); // This is the value checked in the Dafny test @@ -279,7 +279,7 @@ pub mod ECDH { ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { let result = get_out_of_bounds(curve_algorithm); Rc::new(_Wrappers_Compile::Result::Success { - value: result.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(result), }) } @@ -306,17 +306,17 @@ pub mod ECDH { ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { let result = get_infinity(curve_algorithm); Rc::new(_Wrappers_Compile::Result::Success { - value: result.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(result), }) } pub fn GetPublicKey( curve_algorithm: &Rc, private_key: &Rc, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let private_key: Vec = private_key.pem().iter().collect(); - match get_public_key(curve_algorithm, &private_key) { + let private_key = &private_key.pem().to_array(); + match get_public_key(curve_algorithm, private_key) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { - value: x.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(x), }), Err(e) => { let msg = format!("ECDH Get Public Key : {}", e); @@ -359,8 +359,8 @@ pub mod ECDH { curve_algorithm: &Rc, public_key: &::dafny_runtime::Sequence, ) -> Rc<_Wrappers_Compile::Result>> { - let public_key: Vec = public_key.iter().collect(); - match valid_public_key(curve_algorithm, &public_key) { + let public_key = &public_key.to_array(); + match valid_public_key(curve_algorithm, public_key) { Ok(_) => Rc::new(_Wrappers_Compile::Result::Success { value: true }), Err(e) => Rc::new(_Wrappers_Compile::Result::Failure { error: super::error(&e), @@ -372,10 +372,10 @@ pub mod ECDH { public_key: &::dafny_runtime::Sequence, _curve_algorithm: &Rc, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let public_key: Vec = public_key.iter().collect(); - match X509_to_X962(&public_key, true, None) { + let public_key = &public_key.to_array(); + match X509_to_X962(public_key, true, None) { Ok(v) => Rc::new(_Wrappers_Compile::Result::Success { - value: v.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(v), }), Err(e) => { let msg = format!("ECDH Compress Public Key {}", e); @@ -390,10 +390,10 @@ pub mod ECDH { public_key: &::dafny_runtime::Sequence, curve_algorithm: &Rc, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let public_key: Vec = public_key.iter().collect(); - match X962_to_X509(&public_key, curve_algorithm) { + let public_key = &public_key.to_array(); + match X962_to_X509(public_key, curve_algorithm) { Ok(v) => Rc::new(_Wrappers_Compile::Result::Success { - value: v.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(v), }), Err(e) => { let msg = format!("ECDH Decompress Public Key {}", e); @@ -407,8 +407,8 @@ pub mod ECDH { pub fn ParsePublicKey( publicKey: &::dafny_runtime::Sequence, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let public_key: Vec = publicKey.iter().collect(); - match X509_to_X962(&public_key, false, None) { + let public_key = &publicKey.to_array(); + match X509_to_X962(public_key, false, None) { Ok(_) => Rc::new(_Wrappers_Compile::Result::Success { value: publicKey.clone(), }), @@ -451,11 +451,11 @@ pub mod ECDH { private_key: &Rc, public_key: &Rc, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let private_key: Vec = private_key.pem().iter().collect(); - let public_key: Vec = public_key.der().iter().collect(); - match agree(curve_algorithm, &private_key, &public_key) { + let private_key = &private_key.pem().to_array(); + let public_key = &public_key.der().to_array(); + match agree(curve_algorithm, private_key, public_key) { Ok(v) => Rc::new(_Wrappers_Compile::Result::Success { - value: v.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(v), }), Err(e) => { let msg = format!("ECDH Calculate Shared Secret : {}", e); @@ -500,8 +500,8 @@ pub mod ECDH { match ecdsa_key_gen(s) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { value: Rc::new(crate::ECDH::EccKeyPair::EccKeyPair { - publicKey: x.0.iter().cloned().collect(), - privateKey: x.1.iter().cloned().collect(), + publicKey: dafny_runtime::Sequence::from_array_owned(x.0), + privateKey: dafny_runtime::Sequence::from_array_owned(x.1), }), }), Err(e) => { diff --git a/releases/rust/esdk/src/ecdsa.rs b/releases/rust/esdk/src/ecdsa.rs index b31307f09..f7b992333 100644 --- a/releases/rust/esdk/src/ecdsa.rs +++ b/releases/rust/esdk/src/ecdsa.rs @@ -61,7 +61,7 @@ pub mod Signature { } const ELEM_MAX_BITS: usize = 521; - const ELEM_MAX_BYTES: usize = (ELEM_MAX_BITS + 7) / 8; + const ELEM_MAX_BYTES: usize = ELEM_MAX_BITS.div_ceil(8); const PUBLIC_KEY_MAX_LEN: usize = 1 + (2 * ELEM_MAX_BYTES); pub(crate) fn sec1_compress( @@ -134,8 +134,8 @@ pub mod Signature { match ecdsa_key_gen(alg) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { value: Rc::new(Signature::SignatureKeyPair::SignatureKeyPair { - verificationKey: x.0.iter().cloned().collect(), - signingKey: x.1.iter().cloned().collect(), + verificationKey: dafny_runtime::Sequence::from_array_owned(x.0), + signingKey: dafny_runtime::Sequence::from_array_owned(x.1), }), }), Err(e) => { @@ -182,11 +182,11 @@ pub mod Signature { key: &::dafny_runtime::Sequence, msg: &::dafny_runtime::Sequence, ) -> Rc<_Wrappers_Compile::Result<::dafny_runtime::Sequence, Rc>> { - let key: Vec = key.iter().collect(); - let msg: Vec = msg.iter().collect(); - match ecdsa_sign(alg, &key, &msg) { + let key = &key.to_array(); + let msg = &msg.to_array(); + match ecdsa_sign(alg, key, msg) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { - value: x.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(x), }), Err(e) => { let msg = format!("ECDSA Sign : {}", e); @@ -214,10 +214,10 @@ pub mod Signature { msg: &::dafny_runtime::Sequence, sig: &::dafny_runtime::Sequence, ) -> Rc<_Wrappers_Compile::Result>> { - let key: Vec = key.iter().collect(); - let msg: Vec = msg.iter().collect(); - let sig: Vec = sig.iter().collect(); - match ecdsa_verify(alg, &key, &msg, &sig) { + let key = &key.to_array(); + let msg = &msg.to_array(); + let sig = &sig.to_array(); + match ecdsa_verify(alg, key, msg, sig) { Ok(x) => Rc::new(_Wrappers_Compile::Result::Success { value: x }), Err(e) => { let msg = format!("ECDSA Verify : {}", e); @@ -248,7 +248,7 @@ pub mod Signature { }; let message: ::dafny_runtime::Sequence = - [1u8, 2, 3, 4, 5].iter().cloned().collect(); + dafny_runtime::Sequence::from_array_owned(vec![1u8, 2, 3, 4, 5]); let sig = match &*Sign(&alg, &s_key, &message) { _Wrappers_Compile::Result::Success { value } => value.clone(), diff --git a/releases/rust/esdk/src/hmac.rs b/releases/rust/esdk/src/hmac.rs index 3e33c9afb..fdbe43ec0 100644 --- a/releases/rust/esdk/src/hmac.rs +++ b/releases/rust/esdk/src/hmac.rs @@ -32,12 +32,12 @@ impl crate::HMAC::_default { >, >, > { - let key_vec: Vec = input.key().iter().collect(); - let the_key = hmac::Key::new(convert_algorithm(input.digestAlgorithm()), &key_vec); - let message_vec: Vec = input.message().iter().collect(); - let result = hmac::sign(&the_key, &message_vec); + let key_vec = &input.key().to_array(); + let the_key = hmac::Key::new(convert_algorithm(input.digestAlgorithm()), key_vec); + let message_vec = &input.message().to_array(); + let result = hmac::sign(&the_key, message_vec); ::dafny_runtime::Rc::new(_Wrappers_Compile::Result::Success { - value: result.as_ref().iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(result.as_ref().to_vec()), }) } } @@ -66,8 +66,8 @@ pub mod HMAC { impl HMac { pub fn Init(&self, salt: &::dafny_runtime::Sequence) { - let salt: Vec = salt.iter().collect(); - self.inner.lock().unwrap().key = Some(hmac::Key::new(self.algorithm, &salt)); + let salt = &salt.to_array(); + self.inner.lock().unwrap().key = Some(hmac::Key::new(self.algorithm, salt)); let context = Some(hmac::Context::with_key( self.inner.lock().unwrap().key.as_ref().unwrap(), )); @@ -102,25 +102,25 @@ pub mod HMAC { ::dafny_runtime::Rc::new(_Wrappers_Compile::Result::Success { value: inner }) } pub fn BlockUpdate(&self, block: &::dafny_runtime::Sequence) { - let part: Vec = block.iter().collect(); + let part = &block.to_array(); self.inner .lock() .unwrap() .context .as_mut() .unwrap() - .update(&part); + .update(part); } pub fn GetResult(&self) -> ::dafny_runtime::Sequence { let is_empty = self.inner.lock().unwrap().context.is_none(); if is_empty { - return [].iter().cloned().collect(); + return dafny_runtime::Sequence::from_array_owned(vec![]); } let tag = self.inner.lock().unwrap().context.take().unwrap().sign(); // other languages allow you to call BlockUpdate after GetResult // so we re-initialize to mimic that behavior self.re_init(); - tag.as_ref().iter().cloned().collect() + dafny_runtime::Sequence::from_array_owned(tag.as_ref().to_vec()) } } } diff --git a/releases/rust/esdk/src/implementation_from_dafny.rs b/releases/rust/esdk/src/implementation_from_dafny.rs index 060d1b493..68bc2a9f1 100644 --- a/releases/rust/esdk/src/implementation_from_dafny.rs +++ b/releases/rust/esdk/src/implementation_from_dafny.rs @@ -32,6 +32,7 @@ pub mod AESEncryption { pub use ::dafny_runtime::Sequence; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; @@ -45,19 +46,20 @@ pub mod AESEncryption { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(20,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(21,3) pub fn EncryptionOutputFromByteSeq(s: &Sequence, encAlg: &Arc) -> Arc { - let mut cipherText: Sequence = s.take(&(s.cardinality() - int!(encAlg.tagLength().clone()))); - let mut authTag: Sequence = s.drop(&(s.cardinality() - int!(encAlg.tagLength().clone()))); + let mut pivot_point: u64 = truncate!(s.cardinality(), u64) - encAlg.tagLength().clone() as u64; + let mut cipherText: Sequence = s.take(&int!((&pivot_point).clone())); + let mut authTag: Sequence = s.drop(&int!((&pivot_point).clone())); Arc::new(AESEncryptOutput::AESEncryptOutput { cipherText: cipherText.clone(), authTag: authTag.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(48,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(51,3) pub fn AESEncrypt(input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.iv().cardinality() == int!(input.encAlg().ivLength().clone()) && input.key().cardinality() == int!(input.encAlg().keyLength().clone()), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(input.iv().cardinality(), u64) == input.encAlg().ivLength().clone() as u64 && truncate!(input.key().cardinality(), u64) == input.encAlg().keyLength().clone() as u64, &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Request does not match algorithm.") })); if valueOrError0.IsFailure() { @@ -78,14 +80,14 @@ pub mod AESEncryption { return res.read(); }; let mut value: Arc = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(value.cipherText().cardinality() == msg.cardinality(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(value.cipherText().cardinality(), u64) == truncate!(msg.cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("AESEncrypt did not return cipherText of expected length") })); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return res.read(); }; - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(value.authTag().cardinality() == int!(encAlg.tagLength().clone()), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(value.authTag().cardinality(), u64) == encAlg.tagLength().clone() as u64, &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("AESEncryption did not return valid tag") })); if valueOrError3.IsFailure() { @@ -97,10 +99,10 @@ pub mod AESEncryption { })); return res.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(98,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(105,3) pub fn AESDecrypt(input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.key().cardinality() == int!(input.encAlg().keyLength().clone()) && input.iv().cardinality() == int!(input.encAlg().ivLength().clone()) && input.authTag().cardinality() == int!(input.encAlg().tagLength().clone()), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(input.key().cardinality(), u64) == input.encAlg().keyLength().clone() as u64 && truncate!(input.iv().cardinality(), u64) == input.encAlg().ivLength().clone() as u64 && truncate!(input.authTag().cardinality(), u64) == input.encAlg().tagLength().clone() as u64, &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Request does not match algorithm.") })); if valueOrError0.IsFailure() { @@ -122,7 +124,7 @@ pub mod AESEncryption { return res.read(); }; let mut value: Sequence = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(cipherTxt.cardinality() == value.cardinality(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(cipherTxt.cardinality(), u64) == truncate!(value.cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("AESDecrypt did not return plaintext of expected length") })); if valueOrError2.IsFailure() { @@ -134,25 +136,25 @@ pub mod AESEncryption { })); return res.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(130,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(142,3) pub fn CreateAESEncryptExternSuccess(output: &Arc) -> Arc, OpaqueError>> { Arc::new(Result::, OpaqueError>::Success { value: output.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(134,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(146,3) pub fn CreateAESEncryptExternFailure(error: &OpaqueError) -> Arc, OpaqueError>> { Arc::new(Result::, OpaqueError>::Failure { error: error.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(138,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(150,3) pub fn CreateAESDecryptExternSuccess(bytes: &Sequence) -> Arc, OpaqueError>> { Arc::new(Result::, OpaqueError>::Success { value: bytes.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(142,3) + /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(154,3) pub fn CreateAESDecryptExternFailure(error: &OpaqueError) -> Arc, OpaqueError>> { Arc::new(Result::, OpaqueError>::Failure { error: error.clone() @@ -167,10 +169,11 @@ pub mod _Actions_Compile { pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::MaybePlacebo; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::integer_range; - pub use ::dafny_runtime::int; + pub use ::std::convert::Into; pub use ::dafny_runtime::rd; + pub use ::dafny_runtime::int; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; pub use ::std::marker::Sync; @@ -189,28 +192,28 @@ pub mod _Actions_Compile { pub struct _default {} impl _default { - /// ../mpl/StandardLibrary/src/Actions.dfy(104,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(110,3) pub fn DeterministicMap<_A: DafnyType, _R: DafnyType>(action: &Object>, s: &Sequence<_A>) -> Sequence<_R> { let mut res = MaybePlacebo::>::new(); let mut rs: Sequence<_R> = seq![] as Sequence<_R>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut r: _R; - let mut _out0: _R = DeterministicAction::<_A, _R>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: _R = DeterministicAction::<_A, _R>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); r = _out0.clone(); rs = rs.concat(&seq![r.clone()]); } res = MaybePlacebo::from(rs.clone()); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(133,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(140,3) pub fn DeterministicMapWithResult<_A: DafnyType, _R: DafnyType, _E: DafnyType>(action: &Object>, s: &Sequence<_A>) -> Arc, _E>> { let mut res = MaybePlacebo::, _E>>>::new(); let mut rs: Sequence<_R> = seq![] as Sequence<_R>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut valueOrError0: Arc>; - let mut _out0: Arc> = DeterministicAction::<_A, Arc>>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: Arc> = DeterministicAction::<_A, Arc>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); @@ -224,28 +227,28 @@ pub mod _Actions_Compile { })); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(170,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(178,3) pub fn DeterministicFlatMap<_A: DafnyType, _R: DafnyType>(action: &Object>>, s: &Sequence<_A>) -> Sequence<_R> { let mut res = MaybePlacebo::>::new(); let mut rs: Sequence<_R> = seq![] as Sequence<_R>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut r: Sequence<_R>; - let mut _out0: Sequence<_R> = DeterministicAction::<_A, Sequence<_R>>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: Sequence<_R> = DeterministicAction::<_A, Sequence<_R>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); r = _out0.clone(); rs = rs.concat(&r); } res = MaybePlacebo::from(rs.clone()); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(206,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(215,3) pub fn DeterministicFlatMapWithResult<_A: DafnyType, _R: DafnyType, _E: DafnyType>(action: &Object, _E>>, s: &Sequence<_A>) -> Arc, _E>> { let mut res = MaybePlacebo::, _E>>>::new(); let mut rs: Sequence<_R> = seq![] as Sequence<_R>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut valueOrError0: Arc, _E>>; - let mut _out0: Arc, _E>> = DeterministicAction::<_A, Arc, _E>>>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: Arc, _E>> = DeterministicAction::<_A, Arc, _E>>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); @@ -260,30 +263,30 @@ pub mod _Actions_Compile { res = MaybePlacebo::from(_rhs0.clone()); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(246,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(256,3) pub fn Filter<_A: DafnyType>(action: &Object>, s: &Sequence<_A>) -> Sequence<_A> { let mut res = MaybePlacebo::>::new(); let mut rs: Sequence<_A> = seq![] as Sequence<_A>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut r: bool; - let mut _out0: bool = DeterministicAction::<_A, bool>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: bool = DeterministicAction::<_A, bool>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); r = _out0; if r { - rs = rs.concat(&seq![s.get(&i)]); + rs = rs.concat(&seq![s.get(&int!((&i).clone()))]); } } res = MaybePlacebo::from(rs.clone()); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(279,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(290,3) pub fn FilterWithResult<_A: DafnyType, _E: DafnyType>(action: &Object>, s: &Sequence<_A>) -> Arc, _E>> { let mut res = MaybePlacebo::, _E>>>::new(); let mut rs: Sequence<_A> = seq![] as Sequence<_A>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut valueOrError0: Arc>; - let mut _out0: Arc> = DeterministicAction::<_A, Arc>>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: Arc> = DeterministicAction::<_A, Arc>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); @@ -291,7 +294,7 @@ pub mod _Actions_Compile { }; let mut r: bool = valueOrError0.Extract(); if r { - rs = rs.concat(&seq![s.get(&i)]); + rs = rs.concat(&seq![s.get(&int!((&i).clone()))]); } } res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, _E>::Success { @@ -299,14 +302,14 @@ pub mod _Actions_Compile { })); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(318,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(330,3) pub fn ReduceToSuccess<_A: DafnyType, _B: DafnyType, _E: DafnyType>(action: &Object>, s: &Sequence<_A>) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut attemptedResults: Sequence>> = seq![] as Sequence>>; - let mut _hi0: DafnyInt = s.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut attempt: Arc>; - let mut _out0: Arc> = Action::<_A, Arc>>::Invoke(rd!(action.clone()), &s.get(&i)); + let mut _out0: Arc> = Action::<_A, Arc>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone()))); attempt = _out0.clone(); attemptedResults = attemptedResults.concat(&seq![attempt.clone()]); if matches!((&attempt).as_ref(), Success{ .. }) { @@ -322,13 +325,13 @@ pub mod _Actions_Compile { })); return res.read(); } - /// ../mpl/StandardLibrary/src/Actions.dfy(380,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(394,3) pub fn pluckErrors<_B: DafnyType, _E: DafnyType>(r: &Arc>) -> _E { r.error().clone() } } - /// ../mpl/StandardLibrary/src/Actions.dfy(12,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(14,3) #[derive(PartialEq, Clone)] pub enum ActionInvoke { ActionInvoke { @@ -407,32 +410,32 @@ pub mod _Actions_Compile { } } - /// ../mpl/StandardLibrary/src/Actions.dfy(17,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(19,3) pub trait Action: Any + Sync + Send + UpcastObject where A: DafnyType, R: DafnyType { - /// ../mpl/StandardLibrary/src/Actions.dfy(22,5) + /// ../mpl/StandardLibrary/src/Actions.dfy(24,5) fn Invoke(&self, a: &A) -> R; } - /// ../mpl/StandardLibrary/src/Actions.dfy(56,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(61,3) pub trait ActionWithResult: Any + Sync + Send + UpcastObject + Action>> + UpcastObject>>> where A: DafnyType, R: DafnyType, E: DafnyType {} - /// ../mpl/StandardLibrary/src/Actions.dfy(68,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(74,3) pub trait DeterministicAction: Any + Sync + Send + UpcastObject where A: DafnyType, R: DafnyType { - /// ../mpl/StandardLibrary/src/Actions.dfy(73,5) + /// ../mpl/StandardLibrary/src/Actions.dfy(79,5) fn Invoke(&self, a: &A) -> R; } - /// ../mpl/StandardLibrary/src/Actions.dfy(89,3) + /// ../mpl/StandardLibrary/src/Actions.dfy(95,3) pub trait DeterministicActionWithResult: Any + Sync + Send + UpcastObject + DeterministicAction>> + UpcastObject>>> where A: DafnyType, @@ -17529,13 +17532,13 @@ pub mod software { pub fn DefaultDynamoDBClientConfigType() -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::DynamoDBClientConfigType::DynamoDBClientConfigType {}) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2933,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2940,3) pub fn CreateSuccessOfClient(client: &Object) -> Arc, Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: client.clone() }) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2936,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2943,3) pub fn CreateFailureOfError(error: &Arc) -> Arc, Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Failure { error: error.clone() @@ -17543,7 +17546,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2923,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2930,3) #[derive(PartialEq, Clone)] pub enum DynamoDBClientConfigType { DynamoDBClientConfigType {} @@ -17674,247 +17677,247 @@ pub mod software { pub fn IsValid_BatchGetRequestMap(x: &Map, Arc>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(218,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(220,3) pub fn IsValid_BatchWriteItemRequestMap(x: &Map, crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::WriteRequests>) -> bool { !(x.cardinality() < int!(1)) && !(int!(25) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(222,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(224,3) pub fn IsValid_BilledSizeBytes(x: i64) -> bool { !(x < truncate!(int!(0), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(242,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(244,3) pub fn IsValid_CancellationReasonList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(251,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(253,3) pub fn IsValid_ClientRequestToken(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(36) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(256,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(258,3) pub fn IsValid_CloudWatchLogGroupArn(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(303,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(305,3) pub fn IsValid_ConsumedCapacityUnits(x: &Sequence) -> bool { !(x.cardinality() < int!(8)) && !(int!(8) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(382,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(384,3) pub fn IsValid_CsvDelimiter(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(1) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(386,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(388,3) pub fn IsValid_CsvHeader(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(b"65536") < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(390,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(392,3) pub fn IsValid_CsvHeaderList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(562,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(565,3) pub fn IsValid_DoubleObject(x: &Sequence) -> bool { !(x.cardinality() < int!(8)) && !(int!(8) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1586,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1589,3) pub fn IsValid_ErrorCount(x: i64) -> bool { !(x < truncate!(int!(0), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1623,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1627,3) pub fn IsValid_ExportArn(x: &Sequence) -> bool { !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1735,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1739,3) pub fn IsValid_GlobalSecondaryIndexAutoScalingUpdateList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1784,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1788,3) pub fn IsValid_GlobalTableGlobalSecondaryIndexSettingsUpdateList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(20) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1794,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1798,3) pub fn IsValid_ImportArn(x: &Sequence) -> bool { !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1798,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1802,3) pub fn IsValid_ImportedItemCount(x: i64) -> bool { !(x < truncate!(int!(0), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1802,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1806,3) pub fn IsValid_ImportNextToken(x: &Sequence) -> bool { !(x.cardinality() < int!(112)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1860,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1864,3) pub fn IsValid_IndexName(x: &Sequence) -> bool { !(x.cardinality() < int!(3)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1889,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1893,3) pub fn IsValid_ItemCollectionSizeEstimateBound(x: &Sequence) -> bool { !(x.cardinality() < int!(8)) && !(int!(8) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1894,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1898,3) pub fn IsValid_ItemCount(x: i64) -> bool { !(x < truncate!(int!(0), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1902,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1906,3) pub fn IsValid_ItemResponseList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1909,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1913,3) pub fn IsValid_KeyList(x: &Sequence, Arc>>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1920,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1924,3) pub fn IsValid_KeySchema(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(2) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1924,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1928,3) pub fn IsValid_KeySchemaAttributeName(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1973,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1977,3) pub fn IsValid_ListContributorInsightsLimit(x: i32) -> bool { !(truncate!(int!(100), i32) < x) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1986,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1990,3) pub fn IsValid_ListExportsMaxLimit(x: i32) -> bool { !(x < truncate!(int!(1), i32)) && !(truncate!(int!(25), i32) < x) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2008,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2012,3) pub fn IsValid_ListImportsMaxLimit(x: i32) -> bool { !(x < truncate!(int!(1), i32)) && !(truncate!(int!(25), i32) < x) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2020,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2024,3) pub fn IsValid_ListTablesInputLimit(x: i32) -> bool { !(x < truncate!(int!(1), i32)) && !(truncate!(int!(100), i32) < x) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2061,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2065,3) pub fn IsValid_NonKeyAttributeName(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2065,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2069,3) pub fn IsValid_NonKeyAttributeNameList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(20) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2069,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2073,3) pub fn IsValid_NonNegativeLongObject(x: i64) -> bool { !(x < truncate!(int!(0), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2087,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2092,3) pub fn IsValid_ParameterizedStatements(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2091,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2096,3) pub fn IsValid_PartiQLBatchRequest(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(25) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2096,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2101,3) pub fn IsValid_PartiQLNextToken(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(b"32768") < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2100,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2105,3) pub fn IsValid_PartiQLStatement(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(8192) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2115,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2120,3) pub fn IsValid_PolicyRevisionId(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2119,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2124,3) pub fn IsValid_PositiveIntegerObject(x: i32) -> bool { !(x < truncate!(int!(1), i32)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2123,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2128,3) pub fn IsValid_PositiveLongObject(x: i64) -> bool { !(x < truncate!(int!(1), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2127,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2132,3) pub fn IsValid_PreparedStatementParameters(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2131,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2136,3) pub fn IsValid_ProcessedItemCount(x: i64) -> bool { !(x < truncate!(int!(0), i64)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2239,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2245,3) pub fn IsValid_ReplicaAutoScalingUpdateList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2279,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2285,3) pub fn IsValid_ReplicaGlobalSecondaryIndexList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2297,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2303,3) pub fn IsValid_ReplicaGlobalSecondaryIndexSettingsUpdateList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(20) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2321,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2327,3) pub fn IsValid_ReplicaSettingsUpdateList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(50) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2340,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2346,3) pub fn IsValid_ReplicationGroupUpdateList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2349,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2355,3) pub fn IsValid_ResourceArnString(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(1283) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2406,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2412,3) pub fn IsValid_S3Bucket(x: &Sequence) -> bool { !(x.cardinality() < int!(0)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2416,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2422,3) pub fn IsValid_S3Prefix(x: &Sequence) -> bool { !(x.cardinality() < int!(0)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2423,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2429,3) pub fn IsValid_S3SseKmsKeyId(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(2048) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2456,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2462,3) pub fn IsValid_ScanSegment(x: i32) -> bool { !(x < truncate!(int!(0), i32)) && !(truncate!(int!(b"999999"), i32) < x) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2460,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2466,3) pub fn IsValid_ScanTotalSegments(x: i32) -> bool { !(x < truncate!(int!(1), i32)) && !(truncate!(int!(b"1000000"), i32) < x) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2510,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2516,3) pub fn IsValid_StreamArn(x: &Sequence) -> bool { !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2527,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2533,3) pub fn IsValid_TableArn(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(1024) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2580,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2586,3) pub fn IsValid_TableName(x: &Sequence) -> bool { !(x.cardinality() < int!(3)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2598,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2604,3) pub fn IsValid_TagKeyString(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(128) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2607,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2613,3) pub fn IsValid_TagValueString(x: &Sequence) -> bool { !(x.cardinality() < int!(0)) && !(int!(256) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2611,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2617,3) pub fn IsValid_TimeToLiveAttributeName(x: &Sequence) -> bool { !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2632,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2638,3) pub fn IsValid_TransactGetItemList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2650,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2656,3) pub fn IsValid_TransactWriteItemList(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2796,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2803,3) pub fn IsValid_WriteRequests(x: &Sequence>) -> bool { !(x.cardinality() < int!(1)) && !(int!(25) < x.cardinality()) } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2913,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2920,3) pub fn IsDummySubsetType(x: &DafnyInt) -> bool { int!(0) < x.clone() } @@ -20291,7 +20294,8 @@ pub mod software { pub enum BatchStatementError { BatchStatementError { Code: Arc>>, - Message: Arc>> + Message: Arc>>, + Item: Arc, Arc>>> } } @@ -20299,13 +20303,19 @@ pub mod software { /// Returns a borrow of the field Code pub fn Code(&self) -> &Arc>> { match self { - BatchStatementError::BatchStatementError{Code, Message, } => Code, + BatchStatementError::BatchStatementError{Code, Message, Item, } => Code, } } /// Returns a borrow of the field Message pub fn Message(&self) -> &Arc>> { match self { - BatchStatementError::BatchStatementError{Code, Message, } => Message, + BatchStatementError::BatchStatementError{Code, Message, Item, } => Message, + } + } + /// Returns a borrow of the field Item + pub fn Item(&self) -> &Arc, Arc>>> { + match self { + BatchStatementError::BatchStatementError{Code, Message, Item, } => Item, } } } @@ -20321,11 +20331,13 @@ pub mod software { for BatchStatementError { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - BatchStatementError::BatchStatementError{Code, Message, } => { + BatchStatementError::BatchStatementError{Code, Message, Item, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementError.BatchStatementError(")?; DafnyPrint::fmt_print(Code, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(Message, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(Item, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -20340,9 +20352,10 @@ pub mod software { for BatchStatementError { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - BatchStatementError::BatchStatementError{Code, Message, } => { + BatchStatementError::BatchStatementError{Code, Message, Item, } => { Hash::hash(Code, _state); - Hash::hash(Message, _state) + Hash::hash(Message, _state); + Hash::hash(Item, _state) }, } } @@ -20353,7 +20366,8 @@ pub mod software { fn default() -> BatchStatementError { BatchStatementError::BatchStatementError { Code: Default::default(), - Message: Default::default() + Message: Default::default(), + Item: Default::default() } } } @@ -20365,7 +20379,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(185,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(186,3) #[derive(PartialEq, Clone)] pub enum BatchStatementErrorCodeEnum { ConditionalCheckFailed {}, @@ -20507,13 +20521,14 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(197,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(198,3) #[derive(PartialEq, Clone)] pub enum BatchStatementRequest { BatchStatementRequest { Statement: Sequence, Parameters: Arc>, - ConsistentRead: Arc> + ConsistentRead: Arc>, + ReturnValuesOnConditionCheckFailure: Arc>> } } @@ -20521,19 +20536,25 @@ pub mod software { /// Returns a borrow of the field Statement pub fn Statement(&self) -> &Sequence { match self { - BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, } => Statement, + BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => Statement, } } /// Returns a borrow of the field Parameters pub fn Parameters(&self) -> &Arc> { match self { - BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, } => Parameters, + BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => Parameters, } } /// Returns a borrow of the field ConsistentRead pub fn ConsistentRead(&self) -> &Arc> { match self { - BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, } => ConsistentRead, + BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => ConsistentRead, + } + } + /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc>> { + match self { + BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure, } } } @@ -20549,13 +20570,15 @@ pub mod software { for BatchStatementRequest { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, } => { + BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementRequest.BatchStatementRequest(")?; DafnyPrint::fmt_print(Statement, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(Parameters, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -20570,10 +20593,11 @@ pub mod software { for BatchStatementRequest { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, } => { + BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => { Hash::hash(Statement, _state); Hash::hash(Parameters, _state); - Hash::hash(ConsistentRead, _state) + Hash::hash(ConsistentRead, _state); + Hash::hash(ReturnValuesOnConditionCheckFailure, _state) }, } } @@ -20585,7 +20609,8 @@ pub mod software { BatchStatementRequest::BatchStatementRequest { Statement: Default::default(), Parameters: Default::default(), - ConsistentRead: Default::default() + ConsistentRead: Default::default(), + ReturnValuesOnConditionCheckFailure: Default::default() } } } @@ -20597,7 +20622,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(202,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(204,3) #[derive(PartialEq, Clone)] pub enum BatchStatementResponse { BatchStatementResponse { @@ -20687,7 +20712,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(207,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(209,3) #[derive(PartialEq, Clone)] pub enum BatchWriteItemInput { BatchWriteItemInput { @@ -20777,7 +20802,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(212,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(214,3) #[derive(PartialEq, Clone)] pub enum BatchWriteItemOutput { BatchWriteItemOutput { @@ -20867,13 +20892,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(217,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(219,3) pub type BatchWriteItemRequestMap = Map, crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::WriteRequests>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(221,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(223,3) pub type BilledSizeBytes = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(225,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(227,3) #[derive(PartialEq, Clone)] pub enum BillingMode { PROVISIONED {}, @@ -20943,7 +20968,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(228,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(230,3) #[derive(PartialEq, Clone)] pub enum BillingModeSummary { BillingModeSummary { @@ -21022,7 +21047,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(236,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(238,3) #[derive(PartialEq, Clone)] pub enum CancellationReason { CancellationReason { @@ -21112,10 +21137,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(241,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(243,3) pub type CancellationReasonList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(245,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(247,3) #[derive(PartialEq, Clone)] pub enum Capacity { Capacity { @@ -21205,13 +21230,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(250,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(252,3) pub type ClientRequestToken = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(255,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(257,3) pub type CloudWatchLogGroupArn = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(260,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(262,3) #[derive(PartialEq, Clone)] pub enum ComparisonOperator { EQ {}, @@ -21369,7 +21394,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(274,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(276,3) #[derive(PartialEq, Clone)] pub enum Condition { Condition { @@ -21448,7 +21473,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(278,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(280,3) #[derive(PartialEq, Clone)] pub enum ConditionalOperator { AND {}, @@ -21518,7 +21543,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(281,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(283,3) #[derive(PartialEq, Clone)] pub enum ConditionCheck { ConditionCheck { @@ -21641,7 +21666,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(292,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(294,3) #[derive(PartialEq, Clone)] pub enum ConsumedCapacity { ConsumedCapacity { @@ -21775,10 +21800,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(302,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(304,3) pub type ConsumedCapacityUnits = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(306,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(308,3) #[derive(PartialEq, Clone)] pub enum ContinuousBackupsDescription { ContinuousBackupsDescription { @@ -21857,7 +21882,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(310,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(312,3) #[derive(PartialEq, Clone)] pub enum ContinuousBackupsStatus { ENABLED {}, @@ -21927,7 +21952,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(313,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(315,3) #[derive(PartialEq, Clone)] pub enum ContributorInsightsAction { ENABLE {}, @@ -21997,7 +22022,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(318,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(320,3) #[derive(PartialEq, Clone)] pub enum ContributorInsightsStatus { ENABLING {}, @@ -22091,7 +22116,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(325,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(327,3) #[derive(PartialEq, Clone)] pub enum ContributorInsightsSummary { ContributorInsightsSummary { @@ -22181,7 +22206,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(330,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(332,3) #[derive(PartialEq, Clone)] pub enum CreateBackupInput { CreateBackupInput { @@ -22260,7 +22285,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(334,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(336,3) #[derive(PartialEq, Clone)] pub enum CreateBackupOutput { CreateBackupOutput { @@ -22328,7 +22353,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(337,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(339,3) #[derive(PartialEq, Clone)] pub enum CreateGlobalSecondaryIndexAction { CreateGlobalSecondaryIndexAction { @@ -22440,7 +22465,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(344,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(346,3) #[derive(PartialEq, Clone)] pub enum CreateGlobalTableInput { CreateGlobalTableInput { @@ -22519,7 +22544,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(348,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(350,3) #[derive(PartialEq, Clone)] pub enum CreateGlobalTableOutput { CreateGlobalTableOutput { @@ -22587,7 +22612,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(351,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(353,3) #[derive(PartialEq, Clone)] pub enum CreateReplicaAction { CreateReplicaAction { @@ -22655,7 +22680,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(354,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(356,3) #[derive(PartialEq, Clone)] pub enum CreateReplicationGroupMemberAction { CreateReplicationGroupMemberAction { @@ -22778,7 +22803,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(362,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(364,3) #[derive(PartialEq, Clone)] pub enum CreateTableInput { CreateTableInput { @@ -22989,7 +23014,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(378,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(380,3) #[derive(PartialEq, Clone)] pub enum CreateTableOutput { CreateTableOutput { @@ -23057,16 +23082,16 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(381,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(383,3) pub type CsvDelimiter = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(385,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(387,3) pub type CsvHeader = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(389,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(391,3) pub type CsvHeaderList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(393,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(395,3) #[derive(PartialEq, Clone)] pub enum CsvOptions { CsvOptions { @@ -23145,7 +23170,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(397,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(399,3) #[derive(PartialEq, Clone)] pub enum Delete { Delete { @@ -23268,7 +23293,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(405,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(407,3) #[derive(PartialEq, Clone)] pub enum DeleteBackupInput { DeleteBackupInput { @@ -23336,7 +23361,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(408,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(410,3) #[derive(PartialEq, Clone)] pub enum DeleteBackupOutput { DeleteBackupOutput { @@ -23404,7 +23429,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(411,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(413,3) #[derive(PartialEq, Clone)] pub enum DeleteGlobalSecondaryIndexAction { DeleteGlobalSecondaryIndexAction { @@ -23472,7 +23497,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(414,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(416,3) #[derive(PartialEq, Clone)] pub enum DeleteItemInput { DeleteItemInput { @@ -23485,7 +23510,8 @@ pub mod software { ReturnItemCollectionMetrics: Arc>>, ConditionExpression: Arc>>, ExpressionAttributeNames: Arc, Sequence>>>, - ExpressionAttributeValues: Arc, Arc>>> + ExpressionAttributeValues: Arc, Arc>>>, + ReturnValuesOnConditionCheckFailure: Arc>> } } @@ -23493,61 +23519,67 @@ pub mod software { /// Returns a borrow of the field TableName pub fn TableName(&self) -> &Sequence { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => TableName, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName, } } /// Returns a borrow of the field Key pub fn Key(&self) -> &Map, Arc> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Key, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key, } } /// Returns a borrow of the field Expected pub fn Expected(&self) -> &Arc, Arc>>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Expected, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Expected, } } /// Returns a borrow of the field ConditionalOperator pub fn ConditionalOperator(&self) -> &Arc>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionalOperator, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionalOperator, } } /// Returns a borrow of the field ReturnValues pub fn ReturnValues(&self) -> &Arc>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnValues, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValues, } } /// Returns a borrow of the field ReturnConsumedCapacity pub fn ReturnConsumedCapacity(&self) -> &Arc>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnConsumedCapacity, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity, } } /// Returns a borrow of the field ReturnItemCollectionMetrics pub fn ReturnItemCollectionMetrics(&self) -> &Arc>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnItemCollectionMetrics, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnItemCollectionMetrics, } } /// Returns a borrow of the field ConditionExpression pub fn ConditionExpression(&self) -> &Arc>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionExpression, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression, } } /// Returns a borrow of the field ExpressionAttributeNames pub fn ExpressionAttributeNames(&self) -> &Arc, Sequence>>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeNames, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames, } } /// Returns a borrow of the field ExpressionAttributeValues pub fn ExpressionAttributeValues(&self) -> &Arc, Arc>>> { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeValues, + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues, + } + } + /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc>> { + match self { + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure, } } } @@ -23563,7 +23595,7 @@ pub mod software { for DeleteItemInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => { + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput.DeleteItemInput(")?; DafnyPrint::fmt_print(TableName, _formatter, false)?; write!(_formatter, ", ")?; @@ -23584,6 +23616,8 @@ pub mod software { DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -23598,7 +23632,7 @@ pub mod software { for DeleteItemInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => { + DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => { Hash::hash(TableName, _state); Hash::hash(Key, _state); Hash::hash(Expected, _state); @@ -23608,7 +23642,8 @@ pub mod software { Hash::hash(ReturnItemCollectionMetrics, _state); Hash::hash(ConditionExpression, _state); Hash::hash(ExpressionAttributeNames, _state); - Hash::hash(ExpressionAttributeValues, _state) + Hash::hash(ExpressionAttributeValues, _state); + Hash::hash(ReturnValuesOnConditionCheckFailure, _state) }, } } @@ -23627,7 +23662,8 @@ pub mod software { ReturnItemCollectionMetrics: Default::default(), ConditionExpression: Default::default(), ExpressionAttributeNames: Default::default(), - ExpressionAttributeValues: Default::default() + ExpressionAttributeValues: Default::default(), + ReturnValuesOnConditionCheckFailure: Default::default() } } } @@ -23639,7 +23675,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(426,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(429,3) #[derive(PartialEq, Clone)] pub enum DeleteItemOutput { DeleteItemOutput { @@ -23729,7 +23765,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(431,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(434,3) #[derive(PartialEq, Clone)] pub enum DeleteReplicaAction { DeleteReplicaAction { @@ -23797,7 +23833,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(434,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(437,3) #[derive(PartialEq, Clone)] pub enum DeleteReplicationGroupMemberAction { DeleteReplicationGroupMemberAction { @@ -23865,7 +23901,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(437,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(440,3) #[derive(PartialEq, Clone)] pub enum DeleteRequest { DeleteRequest { @@ -23933,7 +23969,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(440,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(443,3) #[derive(PartialEq, Clone)] pub enum DeleteResourcePolicyInput { DeleteResourcePolicyInput { @@ -24012,7 +24048,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(444,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(447,3) #[derive(PartialEq, Clone)] pub enum DeleteResourcePolicyOutput { DeleteResourcePolicyOutput { @@ -24080,7 +24116,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(447,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(450,3) #[derive(PartialEq, Clone)] pub enum DeleteTableInput { DeleteTableInput { @@ -24148,7 +24184,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(450,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(453,3) #[derive(PartialEq, Clone)] pub enum DeleteTableOutput { DeleteTableOutput { @@ -24216,7 +24252,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(454,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(457,3) #[derive(PartialEq, Clone)] pub enum DescribeBackupInput { DescribeBackupInput { @@ -24284,7 +24320,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(457,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(460,3) #[derive(PartialEq, Clone)] pub enum DescribeBackupOutput { DescribeBackupOutput { @@ -24352,7 +24388,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(460,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(463,3) #[derive(PartialEq, Clone)] pub enum DescribeContinuousBackupsInput { DescribeContinuousBackupsInput { @@ -24420,7 +24456,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(463,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(466,3) #[derive(PartialEq, Clone)] pub enum DescribeContinuousBackupsOutput { DescribeContinuousBackupsOutput { @@ -24488,7 +24524,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(466,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(469,3) #[derive(PartialEq, Clone)] pub enum DescribeContributorInsightsInput { DescribeContributorInsightsInput { @@ -24567,7 +24603,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(470,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(473,3) #[derive(PartialEq, Clone)] pub enum DescribeContributorInsightsOutput { DescribeContributorInsightsOutput { @@ -24690,7 +24726,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(478,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(481,3) #[derive(PartialEq, Clone)] pub enum DescribeEndpointsRequest { DescribeEndpointsRequest {} @@ -24752,7 +24788,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(481,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(484,3) #[derive(PartialEq, Clone)] pub enum DescribeEndpointsResponse { DescribeEndpointsResponse { @@ -24820,7 +24856,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(484,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(487,3) #[derive(PartialEq, Clone)] pub enum DescribeExportInput { DescribeExportInput { @@ -24888,7 +24924,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(487,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(490,3) #[derive(PartialEq, Clone)] pub enum DescribeExportOutput { DescribeExportOutput { @@ -24956,7 +24992,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(490,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(493,3) #[derive(PartialEq, Clone)] pub enum DescribeGlobalTableInput { DescribeGlobalTableInput { @@ -25024,7 +25060,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(493,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(496,3) #[derive(PartialEq, Clone)] pub enum DescribeGlobalTableOutput { DescribeGlobalTableOutput { @@ -25092,7 +25128,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(496,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(499,3) #[derive(PartialEq, Clone)] pub enum DescribeGlobalTableSettingsInput { DescribeGlobalTableSettingsInput { @@ -25160,7 +25196,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(499,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(502,3) #[derive(PartialEq, Clone)] pub enum DescribeGlobalTableSettingsOutput { DescribeGlobalTableSettingsOutput { @@ -25239,7 +25275,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(503,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(506,3) #[derive(PartialEq, Clone)] pub enum DescribeImportInput { DescribeImportInput { @@ -25307,7 +25343,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(506,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(509,3) #[derive(PartialEq, Clone)] pub enum DescribeImportOutput { DescribeImportOutput { @@ -25375,7 +25411,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(509,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(512,3) #[derive(PartialEq, Clone)] pub enum DescribeKinesisStreamingDestinationInput { DescribeKinesisStreamingDestinationInput { @@ -25443,7 +25479,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(512,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(515,3) #[derive(PartialEq, Clone)] pub enum DescribeKinesisStreamingDestinationOutput { DescribeKinesisStreamingDestinationOutput { @@ -25522,7 +25558,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(516,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(519,3) #[derive(PartialEq, Clone)] pub enum DescribeLimitsInput { DescribeLimitsInput {} @@ -25584,7 +25620,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(519,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(522,3) #[derive(PartialEq, Clone)] pub enum DescribeLimitsOutput { DescribeLimitsOutput { @@ -25685,7 +25721,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(525,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(528,3) #[derive(PartialEq, Clone)] pub enum DescribeTableInput { DescribeTableInput { @@ -25753,7 +25789,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(528,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(531,3) #[derive(PartialEq, Clone)] pub enum DescribeTableOutput { DescribeTableOutput { @@ -25821,7 +25857,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(531,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(534,3) #[derive(PartialEq, Clone)] pub enum DescribeTableReplicaAutoScalingInput { DescribeTableReplicaAutoScalingInput { @@ -25889,7 +25925,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(534,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(537,3) #[derive(PartialEq, Clone)] pub enum DescribeTableReplicaAutoScalingOutput { DescribeTableReplicaAutoScalingOutput { @@ -25957,7 +25993,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(537,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(540,3) #[derive(PartialEq, Clone)] pub enum DescribeTimeToLiveInput { DescribeTimeToLiveInput { @@ -26025,7 +26061,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(540,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(543,3) #[derive(PartialEq, Clone)] pub enum DescribeTimeToLiveOutput { DescribeTimeToLiveOutput { @@ -26093,7 +26129,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(543,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(546,3) #[derive(PartialEq, Clone)] pub enum DestinationStatus { ENABLING {}, @@ -26195,7 +26231,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(550,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(553,3) #[derive(PartialEq, Clone)] pub enum DisableKinesisStreamingDestinationInput { DisableKinesisStreamingDestinationInput { @@ -26285,7 +26321,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(555,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(558,3) #[derive(PartialEq, Clone)] pub enum DisableKinesisStreamingDestinationOutput { DisableKinesisStreamingDestinationOutput { @@ -26386,10 +26422,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(561,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(564,3) pub type DoubleObject = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(565,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(568,3) pub struct IDynamoDBClientCallHistory {} impl IDynamoDBClientCallHistory { @@ -26404,125 +26440,125 @@ pub mod software { UpcastObjectFn!(DynAny); } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(683,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(686,3) pub trait IDynamoDBClient: Any + Sync + Send + UpcastObject { - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(712,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(715,5) fn BatchExecuteStatement(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(727,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(730,5) fn BatchGetItem(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(742,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(745,5) fn BatchWriteItem(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(757,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(760,5) fn CreateBackup(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(772,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(775,5) fn CreateGlobalTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(787,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(790,5) fn CreateTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(802,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(805,5) fn DeleteBackup(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(817,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(820,5) fn DeleteItem(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(832,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(835,5) fn DeleteResourcePolicy(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(847,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(850,5) fn DeleteTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(862,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(865,5) fn DescribeBackup(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(877,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(880,5) fn DescribeContinuousBackups(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(892,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(895,5) fn DescribeContributorInsights(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(907,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(910,5) fn DescribeEndpoints(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(922,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(925,5) fn DescribeExport(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(937,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(940,5) fn DescribeGlobalTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(952,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(955,5) fn DescribeGlobalTableSettings(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(967,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(970,5) fn DescribeImport(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(982,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(985,5) fn DescribeKinesisStreamingDestination(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(997,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1000,5) fn DescribeLimits(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1012,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1015,5) fn DescribeTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1027,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1030,5) fn DescribeTableReplicaAutoScaling(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1042,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1045,5) fn DescribeTimeToLive(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1057,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1060,5) fn DisableKinesisStreamingDestination(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1072,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1075,5) fn EnableKinesisStreamingDestination(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1087,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1090,5) fn ExecuteStatement(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1102,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1105,5) fn ExecuteTransaction(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1117,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1120,5) fn ExportTableToPointInTime(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1132,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1135,5) fn GetItem(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1147,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1150,5) fn GetResourcePolicy(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1162,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1165,5) fn ImportTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1177,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1180,5) fn ListBackups(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1192,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1195,5) fn ListContributorInsights(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1207,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1210,5) fn ListExports(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1222,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1225,5) fn ListGlobalTables(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1237,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1240,5) fn ListImports(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1252,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1255,5) fn ListTables(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1267,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1270,5) fn ListTagsOfResource(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1282,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1285,5) fn PutItem(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1297,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1300,5) fn PutResourcePolicy(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1312,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1315,5) fn Query(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1327,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1330,5) fn RestoreTableFromBackup(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1342,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1345,5) fn RestoreTableToPointInTime(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1357,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1360,5) fn Scan(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1372,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1375,5) fn TagResource(&self, input: &Arc) -> Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1387,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1390,5) fn TransactGetItems(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1402,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1405,5) fn TransactWriteItems(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1417,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1420,5) fn UntagResource(&self, input: &Arc) -> Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1432,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1435,5) fn UpdateContinuousBackups(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1447,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1450,5) fn UpdateContributorInsights(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1462,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1465,5) fn UpdateGlobalTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1477,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1480,5) fn UpdateGlobalTableSettings(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1492,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1495,5) fn UpdateItem(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1507,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1510,5) fn UpdateKinesisStreamingDestination(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1522,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1525,5) fn UpdateTable(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1537,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1540,5) fn UpdateTableReplicaAutoScaling(&self, input: &Arc) -> Arc, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1552,5) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1555,5) fn UpdateTimeToLive(&self, input: &Arc) -> Arc, Arc>>; } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1566,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1569,3) #[derive(PartialEq, Clone)] pub enum EnableKinesisStreamingConfiguration { EnableKinesisStreamingConfiguration { @@ -26590,7 +26626,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1569,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1572,3) #[derive(PartialEq, Clone)] pub enum EnableKinesisStreamingDestinationInput { EnableKinesisStreamingDestinationInput { @@ -26680,7 +26716,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1574,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1577,3) #[derive(PartialEq, Clone)] pub enum EnableKinesisStreamingDestinationOutput { EnableKinesisStreamingDestinationOutput { @@ -26781,7 +26817,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1580,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1583,3) #[derive(PartialEq, Clone)] pub enum Endpoint { Endpoint { @@ -26860,10 +26896,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1585,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1588,3) pub type ErrorCount = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1592,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1595,3) #[derive(PartialEq, Clone)] pub enum ExecuteStatementInput { ExecuteStatementInput { @@ -26872,7 +26908,8 @@ pub mod software { ConsistentRead: Arc>, NextToken: Arc>>, ReturnConsumedCapacity: Arc>>, - Limit: Arc> + Limit: Arc>, + ReturnValuesOnConditionCheckFailure: Arc>> } } @@ -26880,37 +26917,43 @@ pub mod software { /// Returns a borrow of the field Statement pub fn Statement(&self) -> &Sequence { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => Statement, + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => Statement, } } /// Returns a borrow of the field Parameters pub fn Parameters(&self) -> &Arc> { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => Parameters, + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => Parameters, } } /// Returns a borrow of the field ConsistentRead pub fn ConsistentRead(&self) -> &Arc> { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => ConsistentRead, + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => ConsistentRead, } } /// Returns a borrow of the field NextToken pub fn NextToken(&self) -> &Arc>> { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => NextToken, + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => NextToken, } } /// Returns a borrow of the field ReturnConsumedCapacity pub fn ReturnConsumedCapacity(&self) -> &Arc>> { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => ReturnConsumedCapacity, + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity, } } /// Returns a borrow of the field Limit pub fn Limit(&self) -> &Arc> { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => Limit, + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => Limit, + } + } + /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc>> { + match self { + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure, } } } @@ -26926,7 +26969,7 @@ pub mod software { for ExecuteStatementInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => { + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementInput.ExecuteStatementInput(")?; DafnyPrint::fmt_print(Statement, _formatter, false)?; write!(_formatter, ", ")?; @@ -26939,6 +26982,8 @@ pub mod software { DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(Limit, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -26953,13 +26998,14 @@ pub mod software { for ExecuteStatementInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, } => { + ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => { Hash::hash(Statement, _state); Hash::hash(Parameters, _state); Hash::hash(ConsistentRead, _state); Hash::hash(NextToken, _state); Hash::hash(ReturnConsumedCapacity, _state); - Hash::hash(Limit, _state) + Hash::hash(Limit, _state); + Hash::hash(ReturnValuesOnConditionCheckFailure, _state) }, } } @@ -26974,7 +27020,8 @@ pub mod software { ConsistentRead: Default::default(), NextToken: Default::default(), ReturnConsumedCapacity: Default::default(), - Limit: Default::default() + Limit: Default::default(), + ReturnValuesOnConditionCheckFailure: Default::default() } } } @@ -26986,7 +27033,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1600,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1604,3) #[derive(PartialEq, Clone)] pub enum ExecuteStatementOutput { ExecuteStatementOutput { @@ -27087,7 +27134,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1606,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1610,3) #[derive(PartialEq, Clone)] pub enum ExecuteTransactionInput { ExecuteTransactionInput { @@ -27177,7 +27224,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1611,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1615,3) #[derive(PartialEq, Clone)] pub enum ExecuteTransactionOutput { ExecuteTransactionOutput { @@ -27256,7 +27303,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1616,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1620,3) #[derive(PartialEq, Clone)] pub enum ExpectedAttributeValue { ExpectedAttributeValue { @@ -27357,10 +27404,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1622,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1626,3) pub type ExportArn = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1626,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1630,3) #[derive(PartialEq, Clone)] pub enum ExportDescription { ExportDescription { @@ -27648,7 +27695,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1649,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1653,3) #[derive(PartialEq, Clone)] pub enum ExportFormat { DYNAMODB_JSON {}, @@ -27718,7 +27765,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1654,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1658,3) #[derive(PartialEq, Clone)] pub enum ExportStatus { IN_PROGRESS {}, @@ -27796,7 +27843,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1659,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1663,3) #[derive(PartialEq, Clone)] pub enum ExportSummary { ExportSummary { @@ -27886,7 +27933,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1664,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1668,3) #[derive(PartialEq, Clone)] pub enum ExportTableToPointInTimeInput { ExportTableToPointInTimeInput { @@ -28064,7 +28111,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1677,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1681,3) #[derive(PartialEq, Clone)] pub enum ExportTableToPointInTimeOutput { ExportTableToPointInTimeOutput { @@ -28132,7 +28179,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1680,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1684,3) #[derive(PartialEq, Clone)] pub enum ExportType { FULL_EXPORT {}, @@ -28202,7 +28249,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1683,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1687,3) #[derive(PartialEq, Clone)] pub enum ExportViewType { NEW_IMAGE {}, @@ -28272,7 +28319,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1691,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1695,3) #[derive(PartialEq, Clone)] pub enum FailureException { FailureException { @@ -28351,7 +28398,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1697,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1701,3) #[derive(PartialEq, Clone)] pub enum Get { Get { @@ -28452,7 +28499,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1703,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1707,3) #[derive(PartialEq, Clone)] pub enum GetItemInput { GetItemInput { @@ -28586,7 +28633,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1712,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1716,3) #[derive(PartialEq, Clone)] pub enum GetItemOutput { GetItemOutput { @@ -28665,7 +28712,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1716,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1720,3) #[derive(PartialEq, Clone)] pub enum GetResourcePolicyInput { GetResourcePolicyInput { @@ -28733,7 +28780,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1719,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1723,3) #[derive(PartialEq, Clone)] pub enum GetResourcePolicyOutput { GetResourcePolicyOutput { @@ -28812,7 +28859,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1723,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1727,3) #[derive(PartialEq, Clone)] pub enum GlobalSecondaryIndex { GlobalSecondaryIndex { @@ -28924,7 +28971,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1730,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1734,3) #[derive(PartialEq, Clone)] pub enum GlobalSecondaryIndexAutoScalingUpdate { GlobalSecondaryIndexAutoScalingUpdate { @@ -29003,10 +29050,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1734,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1738,3) pub type GlobalSecondaryIndexAutoScalingUpdateList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1738,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1742,3) #[derive(PartialEq, Clone)] pub enum GlobalSecondaryIndexDescription { GlobalSecondaryIndexDescription { @@ -29173,7 +29220,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1752,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1756,3) #[derive(PartialEq, Clone)] pub enum GlobalSecondaryIndexInfo { GlobalSecondaryIndexInfo { @@ -29285,7 +29332,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1760,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1764,3) #[derive(PartialEq, Clone)] pub enum GlobalSecondaryIndexUpdate { GlobalSecondaryIndexUpdate { @@ -29375,7 +29422,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1766,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1770,3) #[derive(PartialEq, Clone)] pub enum GlobalTable { GlobalTable { @@ -29454,7 +29501,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1771,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1775,3) #[derive(PartialEq, Clone)] pub enum GlobalTableDescription { GlobalTableDescription { @@ -29566,7 +29613,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1778,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1782,3) #[derive(PartialEq, Clone)] pub enum GlobalTableGlobalSecondaryIndexSettingsUpdate { GlobalTableGlobalSecondaryIndexSettingsUpdate { @@ -29656,10 +29703,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1783,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1787,3) pub type GlobalTableGlobalSecondaryIndexSettingsUpdateList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1788,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1792,3) #[derive(PartialEq, Clone)] pub enum GlobalTableStatus { CREATING {}, @@ -29745,16 +29792,16 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1793,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1797,3) pub type ImportArn = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1797,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1801,3) pub type ImportedItemCount = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1801,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1805,3) pub type ImportNextToken = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1805,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1809,3) #[derive(PartialEq, Clone)] pub enum ImportStatus { IN_PROGRESS {}, @@ -29848,7 +29895,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1811,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1815,3) #[derive(PartialEq, Clone)] pub enum ImportSummary { ImportSummary { @@ -29993,7 +30040,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1822,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1826,3) #[derive(PartialEq, Clone)] pub enum ImportTableDescription { ImportTableDescription { @@ -30259,7 +30306,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1843,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1847,3) #[derive(PartialEq, Clone)] pub enum ImportTableInput { ImportTableInput { @@ -30382,7 +30429,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1851,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1855,3) #[derive(PartialEq, Clone)] pub enum ImportTableOutput { ImportTableOutput { @@ -30450,7 +30497,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1854,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1858,3) #[derive(PartialEq, Clone)] pub enum IncrementalExportSpecification { IncrementalExportSpecification { @@ -30540,10 +30587,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1859,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1863,3) pub type IndexName = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1863,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1867,3) #[derive(PartialEq, Clone)] pub enum IndexStatus { CREATING {}, @@ -30629,7 +30676,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1868,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1872,3) #[derive(PartialEq, Clone)] pub enum InputCompressionType { GZIP {}, @@ -30707,7 +30754,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1872,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1876,3) #[derive(PartialEq, Clone)] pub enum InputFormat { DYNAMODB_JSON {}, @@ -30785,7 +30832,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1876,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1880,3) #[derive(PartialEq, Clone)] pub enum InputFormatOptions { InputFormatOptions { @@ -30853,7 +30900,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1882,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1886,3) #[derive(PartialEq, Clone)] pub enum ItemCollectionMetrics { ItemCollectionMetrics { @@ -30932,13 +30979,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1888,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1892,3) pub type ItemCollectionSizeEstimateBound = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1893,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1897,3) pub type ItemCount = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1898,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1902,3) #[derive(PartialEq, Clone)] pub enum ItemResponse { ItemResponse { @@ -31006,13 +31053,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1901,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1905,3) pub type ItemResponseList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1908,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1912,3) pub type KeyList = Sequence, Arc>>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1912,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1916,3) #[derive(PartialEq, Clone)] pub enum KeysAndAttributes { KeysAndAttributes { @@ -31124,13 +31171,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1919,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1923,3) pub type KeySchema = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1923,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1927,3) pub type KeySchemaAttributeName = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1927,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1931,3) #[derive(PartialEq, Clone)] pub enum KeySchemaElement { KeySchemaElement { @@ -31209,7 +31256,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1931,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1935,3) #[derive(PartialEq, Clone)] pub enum KeyType { HASH {}, @@ -31279,7 +31326,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1934,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1938,3) #[derive(PartialEq, Clone)] pub enum KinesisDataStreamDestination { KinesisDataStreamDestination { @@ -31380,7 +31427,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1941,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1945,3) #[derive(PartialEq, Clone)] pub enum KinesisStreamingDestinationInput { KinesisStreamingDestinationInput { @@ -31470,7 +31517,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1946,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1950,3) #[derive(PartialEq, Clone)] pub enum KinesisStreamingDestinationOutput { KinesisStreamingDestinationOutput { @@ -31571,7 +31618,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1955,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1959,3) #[derive(PartialEq, Clone)] pub enum ListBackupsInput { ListBackupsInput { @@ -31694,7 +31741,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1963,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1967,3) #[derive(PartialEq, Clone)] pub enum ListBackupsOutput { ListBackupsOutput { @@ -31773,7 +31820,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1967,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1971,3) #[derive(PartialEq, Clone)] pub enum ListContributorInsightsInput { ListContributorInsightsInput { @@ -31863,10 +31910,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1972,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1976,3) pub type ListContributorInsightsLimit = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1976,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1980,3) #[derive(PartialEq, Clone)] pub enum ListContributorInsightsOutput { ListContributorInsightsOutput { @@ -31945,7 +31992,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1980,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1984,3) #[derive(PartialEq, Clone)] pub enum ListExportsInput { ListExportsInput { @@ -32035,10 +32082,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1985,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1989,3) pub type ListExportsMaxLimit = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1989,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1993,3) #[derive(PartialEq, Clone)] pub enum ListExportsOutput { ListExportsOutput { @@ -32117,7 +32164,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1993,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1997,3) #[derive(PartialEq, Clone)] pub enum ListGlobalTablesInput { ListGlobalTablesInput { @@ -32207,7 +32254,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1998,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2002,3) #[derive(PartialEq, Clone)] pub enum ListGlobalTablesOutput { ListGlobalTablesOutput { @@ -32286,7 +32333,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2002,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2006,3) #[derive(PartialEq, Clone)] pub enum ListImportsInput { ListImportsInput { @@ -32376,10 +32423,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2007,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2011,3) pub type ListImportsMaxLimit = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2011,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2015,3) #[derive(PartialEq, Clone)] pub enum ListImportsOutput { ListImportsOutput { @@ -32458,7 +32505,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2015,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2019,3) #[derive(PartialEq, Clone)] pub enum ListTablesInput { ListTablesInput { @@ -32537,10 +32584,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2019,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2023,3) pub type ListTablesInputLimit = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2023,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2027,3) #[derive(PartialEq, Clone)] pub enum ListTablesOutput { ListTablesOutput { @@ -32619,7 +32666,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2027,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2031,3) #[derive(PartialEq, Clone)] pub enum ListTagsOfResourceInput { ListTagsOfResourceInput { @@ -32698,7 +32745,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2031,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2035,3) #[derive(PartialEq, Clone)] pub enum ListTagsOfResourceOutput { ListTagsOfResourceOutput { @@ -32777,7 +32824,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2035,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2039,3) #[derive(PartialEq, Clone)] pub enum LocalSecondaryIndex { LocalSecondaryIndex { @@ -32867,7 +32914,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2040,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2044,3) #[derive(PartialEq, Clone)] pub enum LocalSecondaryIndexDescription { LocalSecondaryIndexDescription { @@ -32990,7 +33037,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2050,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2054,3) #[derive(PartialEq, Clone)] pub enum LocalSecondaryIndexInfo { LocalSecondaryIndexInfo { @@ -33080,16 +33127,16 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2060,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2064,3) pub type NonKeyAttributeName = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2064,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2068,3) pub type NonKeyAttributeNameList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2068,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2072,3) pub type NonNegativeLongObject = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2075,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2079,3) #[derive(PartialEq, Clone)] pub enum OnDemandThroughput { OnDemandThroughput { @@ -33168,7 +33215,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2079,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2083,3) #[derive(PartialEq, Clone)] pub enum OnDemandThroughputOverride { OnDemandThroughputOverride { @@ -33236,12 +33283,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2082,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2086,3) #[derive(PartialEq, Clone)] pub enum ParameterizedStatement { ParameterizedStatement { Statement: Sequence, - Parameters: Arc> + Parameters: Arc>, + ReturnValuesOnConditionCheckFailure: Arc>> } } @@ -33249,13 +33297,19 @@ pub mod software { /// Returns a borrow of the field Statement pub fn Statement(&self) -> &Sequence { match self { - ParameterizedStatement::ParameterizedStatement{Statement, Parameters, } => Statement, + ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => Statement, } } /// Returns a borrow of the field Parameters pub fn Parameters(&self) -> &Arc> { match self { - ParameterizedStatement::ParameterizedStatement{Statement, Parameters, } => Parameters, + ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => Parameters, + } + } + /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc>> { + match self { + ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure, } } } @@ -33271,11 +33325,13 @@ pub mod software { for ParameterizedStatement { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - ParameterizedStatement::ParameterizedStatement{Statement, Parameters, } => { + ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ParameterizedStatement.ParameterizedStatement(")?; DafnyPrint::fmt_print(Statement, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(Parameters, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -33290,9 +33346,10 @@ pub mod software { for ParameterizedStatement { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - ParameterizedStatement::ParameterizedStatement{Statement, Parameters, } => { + ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => { Hash::hash(Statement, _state); - Hash::hash(Parameters, _state) + Hash::hash(Parameters, _state); + Hash::hash(ReturnValuesOnConditionCheckFailure, _state) }, } } @@ -33303,7 +33360,8 @@ pub mod software { fn default() -> ParameterizedStatement { ParameterizedStatement::ParameterizedStatement { Statement: Default::default(), - Parameters: Default::default() + Parameters: Default::default(), + ReturnValuesOnConditionCheckFailure: Default::default() } } } @@ -33315,19 +33373,19 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2086,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2091,3) pub type ParameterizedStatements = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2090,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2095,3) pub type PartiQLBatchRequest = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2095,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2100,3) pub type PartiQLNextToken = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2099,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2104,3) pub type PartiQLStatement = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2103,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2108,3) #[derive(PartialEq, Clone)] pub enum PointInTimeRecoveryDescription { PointInTimeRecoveryDescription { @@ -33417,7 +33475,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2108,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2113,3) #[derive(PartialEq, Clone)] pub enum PointInTimeRecoverySpecification { PointInTimeRecoverySpecification { @@ -33485,7 +33543,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2111,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2116,3) #[derive(PartialEq, Clone)] pub enum PointInTimeRecoveryStatus { ENABLED {}, @@ -33555,22 +33613,22 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2114,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2119,3) pub type PolicyRevisionId = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2118,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2123,3) pub type PositiveIntegerObject = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2122,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2127,3) pub type PositiveLongObject = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2126,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2131,3) pub type PreparedStatementParameters = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2130,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2135,3) pub type ProcessedItemCount = i64; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2134,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2139,3) #[derive(PartialEq, Clone)] pub enum Projection { Projection { @@ -33649,7 +33707,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2139,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2144,3) #[derive(PartialEq, Clone)] pub enum ProjectionType { ALL {}, @@ -33727,7 +33785,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2143,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2148,3) #[derive(PartialEq, Clone)] pub enum ProvisionedThroughput { ProvisionedThroughput { @@ -33806,7 +33864,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2147,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2152,3) #[derive(PartialEq, Clone)] pub enum ProvisionedThroughputDescription { ProvisionedThroughputDescription { @@ -33918,7 +33976,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2154,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2159,3) #[derive(PartialEq, Clone)] pub enum ProvisionedThroughputOverride { ProvisionedThroughputOverride { @@ -33986,7 +34044,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2157,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2162,3) #[derive(PartialEq, Clone)] pub enum Put { Put { @@ -34109,7 +34167,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2165,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2170,3) #[derive(PartialEq, Clone)] pub enum PutItemInput { PutItemInput { @@ -34122,7 +34180,8 @@ pub mod software { ConditionalOperator: Arc>>, ConditionExpression: Arc>>, ExpressionAttributeNames: Arc, Sequence>>>, - ExpressionAttributeValues: Arc, Arc>>> + ExpressionAttributeValues: Arc, Arc>>>, + ReturnValuesOnConditionCheckFailure: Arc>> } } @@ -34130,61 +34189,67 @@ pub mod software { /// Returns a borrow of the field TableName pub fn TableName(&self) -> &Sequence { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => TableName, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName, } } /// Returns a borrow of the field Item pub fn Item(&self) -> &Map, Arc> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Item, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Item, } } /// Returns a borrow of the field Expected pub fn Expected(&self) -> &Arc, Arc>>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Expected, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Expected, } } /// Returns a borrow of the field ReturnValues pub fn ReturnValues(&self) -> &Arc>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnValues, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValues, } } /// Returns a borrow of the field ReturnConsumedCapacity pub fn ReturnConsumedCapacity(&self) -> &Arc>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnConsumedCapacity, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity, } } /// Returns a borrow of the field ReturnItemCollectionMetrics pub fn ReturnItemCollectionMetrics(&self) -> &Arc>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnItemCollectionMetrics, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnItemCollectionMetrics, } } /// Returns a borrow of the field ConditionalOperator pub fn ConditionalOperator(&self) -> &Arc>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionalOperator, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionalOperator, } } /// Returns a borrow of the field ConditionExpression pub fn ConditionExpression(&self) -> &Arc>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionExpression, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression, } } /// Returns a borrow of the field ExpressionAttributeNames pub fn ExpressionAttributeNames(&self) -> &Arc, Sequence>>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeNames, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames, } } /// Returns a borrow of the field ExpressionAttributeValues pub fn ExpressionAttributeValues(&self) -> &Arc, Arc>>> { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeValues, + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues, + } + } + /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc>> { + match self { + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure, } } } @@ -34200,7 +34265,7 @@ pub mod software { for PutItemInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => { + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput.PutItemInput(")?; DafnyPrint::fmt_print(TableName, _formatter, false)?; write!(_formatter, ", ")?; @@ -34221,6 +34286,8 @@ pub mod software { DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -34235,7 +34302,7 @@ pub mod software { for PutItemInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => { + PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => { Hash::hash(TableName, _state); Hash::hash(Item, _state); Hash::hash(Expected, _state); @@ -34245,7 +34312,8 @@ pub mod software { Hash::hash(ConditionalOperator, _state); Hash::hash(ConditionExpression, _state); Hash::hash(ExpressionAttributeNames, _state); - Hash::hash(ExpressionAttributeValues, _state) + Hash::hash(ExpressionAttributeValues, _state); + Hash::hash(ReturnValuesOnConditionCheckFailure, _state) }, } } @@ -34264,7 +34332,8 @@ pub mod software { ConditionalOperator: Default::default(), ConditionExpression: Default::default(), ExpressionAttributeNames: Default::default(), - ExpressionAttributeValues: Default::default() + ExpressionAttributeValues: Default::default(), + ReturnValuesOnConditionCheckFailure: Default::default() } } } @@ -34276,7 +34345,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2178,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2184,3) #[derive(PartialEq, Clone)] pub enum PutItemOutput { PutItemOutput { @@ -34366,7 +34435,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2183,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2189,3) #[derive(PartialEq, Clone)] pub enum PutRequest { PutRequest { @@ -34434,7 +34503,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2186,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2192,3) #[derive(PartialEq, Clone)] pub enum PutResourcePolicyInput { PutResourcePolicyInput { @@ -34535,7 +34604,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2192,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2198,3) #[derive(PartialEq, Clone)] pub enum PutResourcePolicyOutput { PutResourcePolicyOutput { @@ -34603,7 +34672,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2195,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2201,3) #[derive(PartialEq, Clone)] pub enum QueryInput { QueryInput { @@ -34847,7 +34916,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2214,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2220,3) #[derive(PartialEq, Clone)] pub enum QueryOutput { QueryOutput { @@ -34959,7 +35028,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2222,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2228,3) #[derive(PartialEq, Clone)] pub enum Replica { Replica { @@ -35027,7 +35096,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2225,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2231,3) #[derive(PartialEq, Clone)] pub enum ReplicaAutoScalingDescription { ReplicaAutoScalingDescription { @@ -35139,7 +35208,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2233,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2239,3) #[derive(PartialEq, Clone)] pub enum ReplicaAutoScalingUpdate { ReplicaAutoScalingUpdate { @@ -35229,10 +35298,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2238,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2244,3) pub type ReplicaAutoScalingUpdateList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2242,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2248,3) #[derive(PartialEq, Clone)] pub enum ReplicaDescription { ReplicaDescription { @@ -35399,7 +35468,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2255,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2261,3) #[derive(PartialEq, Clone)] pub enum ReplicaGlobalSecondaryIndex { ReplicaGlobalSecondaryIndex { @@ -35489,7 +35558,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2260,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2266,3) #[derive(PartialEq, Clone)] pub enum ReplicaGlobalSecondaryIndexAutoScalingDescription { ReplicaGlobalSecondaryIndexAutoScalingDescription { @@ -35590,7 +35659,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2267,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2273,3) #[derive(PartialEq, Clone)] pub enum ReplicaGlobalSecondaryIndexAutoScalingUpdate { ReplicaGlobalSecondaryIndexAutoScalingUpdate { @@ -35669,7 +35738,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2272,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2278,3) #[derive(PartialEq, Clone)] pub enum ReplicaGlobalSecondaryIndexDescription { ReplicaGlobalSecondaryIndexDescription { @@ -35759,10 +35828,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2278,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2284,3) pub type ReplicaGlobalSecondaryIndexList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2282,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2288,3) #[derive(PartialEq, Clone)] pub enum ReplicaGlobalSecondaryIndexSettingsDescription { ReplicaGlobalSecondaryIndexSettingsDescription { @@ -35885,7 +35954,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2291,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2297,3) #[derive(PartialEq, Clone)] pub enum ReplicaGlobalSecondaryIndexSettingsUpdate { ReplicaGlobalSecondaryIndexSettingsUpdate { @@ -35975,10 +36044,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2296,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2302,3) pub type ReplicaGlobalSecondaryIndexSettingsUpdateList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2301,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2307,3) #[derive(PartialEq, Clone)] pub enum ReplicaSettingsDescription { ReplicaSettingsDescription { @@ -36134,7 +36203,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2313,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2319,3) #[derive(PartialEq, Clone)] pub enum ReplicaSettingsUpdate { ReplicaSettingsUpdate { @@ -36246,10 +36315,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2320,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2326,3) pub type ReplicaSettingsUpdateList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2324,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2330,3) #[derive(PartialEq, Clone)] pub enum ReplicaStatus { CREATING {}, @@ -36359,7 +36428,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2334,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2340,3) #[derive(PartialEq, Clone)] pub enum ReplicationGroupUpdate { ReplicationGroupUpdate { @@ -36449,10 +36518,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2339,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2345,3) pub type ReplicationGroupUpdateList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2343,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2349,3) #[derive(PartialEq, Clone)] pub enum ReplicaUpdate { ReplicaUpdate { @@ -36531,10 +36600,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2348,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2354,3) pub type ResourceArnString = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2354,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2360,3) #[derive(PartialEq, Clone)] pub enum RestoreSummary { RestoreSummary { @@ -36635,7 +36704,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2360,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2366,3) #[derive(PartialEq, Clone)] pub enum RestoreTableFromBackupInput { RestoreTableFromBackupInput { @@ -36780,7 +36849,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2370,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2376,3) #[derive(PartialEq, Clone)] pub enum RestoreTableFromBackupOutput { RestoreTableFromBackupOutput { @@ -36848,7 +36917,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2373,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2379,3) #[derive(PartialEq, Clone)] pub enum RestoreTableToPointInTimeInput { RestoreTableToPointInTimeInput { @@ -37026,7 +37095,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2386,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2392,3) #[derive(PartialEq, Clone)] pub enum RestoreTableToPointInTimeOutput { RestoreTableToPointInTimeOutput { @@ -37094,7 +37163,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2389,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2395,3) #[derive(PartialEq, Clone)] pub enum ReturnConsumedCapacity { INDEXES {}, @@ -37172,7 +37241,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2393,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2399,3) #[derive(PartialEq, Clone)] pub enum ReturnItemCollectionMetrics { SIZE {}, @@ -37242,7 +37311,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2396,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2402,3) #[derive(PartialEq, Clone)] pub enum ReturnValue { NONE {}, @@ -37336,7 +37405,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2402,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2408,3) #[derive(PartialEq, Clone)] pub enum ReturnValuesOnConditionCheckFailure { ALL_OLD {}, @@ -37406,10 +37475,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2405,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2411,3) pub type S3Bucket = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2410,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2416,3) #[derive(PartialEq, Clone)] pub enum S3BucketSource { S3BucketSource { @@ -37499,10 +37568,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2415,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2421,3) pub type S3Prefix = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2419,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2425,3) #[derive(PartialEq, Clone)] pub enum S3SseAlgorithm { AES256 {}, @@ -37572,10 +37641,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2422,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2428,3) pub type S3SseKmsKeyId = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2426,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2432,3) #[derive(PartialEq, Clone)] pub enum ScalarAttributeType { S {}, @@ -37653,7 +37722,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2430,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2436,3) #[derive(PartialEq, Clone)] pub enum ScanInput { ScanInput { @@ -37886,7 +37955,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2448,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2454,3) #[derive(PartialEq, Clone)] pub enum ScanOutput { ScanOutput { @@ -37998,13 +38067,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2455,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2461,3) pub type ScanSegment = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2459,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2465,3) pub type ScanTotalSegments = i32; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2464,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2470,3) #[derive(PartialEq, Clone)] pub enum Select { ALL_ATTRIBUTES {}, @@ -38090,7 +38159,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2469,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2475,3) #[derive(PartialEq, Clone)] pub enum SourceTableDetails { SourceTableDetails { @@ -38257,7 +38326,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2481,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2487,3) #[derive(PartialEq, Clone)] pub enum SourceTableFeatureDetails { SourceTableFeatureDetails { @@ -38369,7 +38438,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2488,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2494,3) #[derive(PartialEq, Clone)] pub enum SSEDescription { SSEDescription { @@ -38470,7 +38539,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2495,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2501,3) #[derive(PartialEq, Clone)] pub enum SSESpecification { SSESpecification { @@ -38560,7 +38629,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2500,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2506,3) #[derive(PartialEq, Clone)] pub enum SSEStatus { ENABLING {}, @@ -38654,7 +38723,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2506,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2512,3) #[derive(PartialEq, Clone)] pub enum SSEType { AES256 {}, @@ -38724,10 +38793,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2509,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2515,3) pub type StreamArn = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2514,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2520,3) #[derive(PartialEq, Clone)] pub enum StreamSpecification { StreamSpecification { @@ -38806,7 +38875,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2518,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2524,3) #[derive(PartialEq, Clone)] pub enum StreamViewType { NEW_IMAGE {}, @@ -38892,10 +38961,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2526,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2532,3) pub type TableArn = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2530,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2536,3) #[derive(PartialEq, Clone)] pub enum TableAutoScalingDescription { TableAutoScalingDescription { @@ -38985,7 +39054,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2535,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2541,3) #[derive(PartialEq, Clone)] pub enum TableClass { STANDARD {}, @@ -39055,7 +39124,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2538,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2544,3) #[derive(PartialEq, Clone)] pub enum TableClassSummary { TableClassSummary { @@ -39134,7 +39203,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2542,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2548,3) #[derive(PartialEq, Clone)] pub enum TableCreationParameters { TableCreationParameters { @@ -39279,7 +39348,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2552,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2558,3) #[derive(PartialEq, Clone)] pub enum TableDescription { TableDescription { @@ -39600,10 +39669,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2579,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2585,3) pub type TableName = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2584,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2590,3) #[derive(PartialEq, Clone)] pub enum TableStatus { CREATING {}, @@ -39713,7 +39782,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2592,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2598,3) #[derive(PartialEq, Clone)] pub enum Tag { Tag { @@ -39792,10 +39861,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2597,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2603,3) pub type TagKeyString = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2602,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2608,3) #[derive(PartialEq, Clone)] pub enum TagResourceInput { TagResourceInput { @@ -39874,13 +39943,13 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2606,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2612,3) pub type TagValueString = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2610,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2616,3) pub type TimeToLiveAttributeName = Sequence; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2614,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2620,3) #[derive(PartialEq, Clone)] pub enum TimeToLiveDescription { TimeToLiveDescription { @@ -39959,7 +40028,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2619,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2625,3) #[derive(PartialEq, Clone)] pub enum TimeToLiveSpecification { TimeToLiveSpecification { @@ -40038,7 +40107,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2623,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2629,3) #[derive(PartialEq, Clone)] pub enum TimeToLiveStatus { ENABLING {}, @@ -40124,7 +40193,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2628,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2634,3) #[derive(PartialEq, Clone)] pub enum TransactGetItem { TransactGetItem { @@ -40192,10 +40261,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2631,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2637,3) pub type TransactGetItemList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2635,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2641,3) #[derive(PartialEq, Clone)] pub enum TransactGetItemsInput { TransactGetItemsInput { @@ -40274,7 +40343,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2639,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2645,3) #[derive(PartialEq, Clone)] pub enum TransactGetItemsOutput { TransactGetItemsOutput { @@ -40353,7 +40422,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2643,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2649,3) #[derive(PartialEq, Clone)] pub enum TransactWriteItem { TransactWriteItem { @@ -40454,10 +40523,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2649,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2655,3) pub type TransactWriteItemList = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2653,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2659,3) #[derive(PartialEq, Clone)] pub enum TransactWriteItemsInput { TransactWriteItemsInput { @@ -40558,7 +40627,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2659,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2665,3) #[derive(PartialEq, Clone)] pub enum TransactWriteItemsOutput { TransactWriteItemsOutput { @@ -40637,7 +40706,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2663,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2669,3) #[derive(PartialEq, Clone)] pub enum UntagResourceInput { UntagResourceInput { @@ -40716,7 +40785,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2667,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2673,3) #[derive(PartialEq, Clone)] pub enum Update { Update { @@ -40850,7 +40919,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2676,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2682,3) #[derive(PartialEq, Clone)] pub enum UpdateContinuousBackupsInput { UpdateContinuousBackupsInput { @@ -40929,7 +40998,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2680,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2686,3) #[derive(PartialEq, Clone)] pub enum UpdateContinuousBackupsOutput { UpdateContinuousBackupsOutput { @@ -40997,7 +41066,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2683,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2689,3) #[derive(PartialEq, Clone)] pub enum UpdateContributorInsightsInput { UpdateContributorInsightsInput { @@ -41087,7 +41156,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2688,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2694,3) #[derive(PartialEq, Clone)] pub enum UpdateContributorInsightsOutput { UpdateContributorInsightsOutput { @@ -41177,7 +41246,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2694,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2700,3) #[derive(PartialEq, Clone)] pub enum UpdateGlobalSecondaryIndexAction { UpdateGlobalSecondaryIndexAction { @@ -41267,7 +41336,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2699,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2705,3) #[derive(PartialEq, Clone)] pub enum UpdateGlobalTableInput { UpdateGlobalTableInput { @@ -41346,7 +41415,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2703,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2709,3) #[derive(PartialEq, Clone)] pub enum UpdateGlobalTableOutput { UpdateGlobalTableOutput { @@ -41414,7 +41483,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2706,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2712,3) #[derive(PartialEq, Clone)] pub enum UpdateGlobalTableSettingsInput { UpdateGlobalTableSettingsInput { @@ -41537,7 +41606,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2714,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2720,3) #[derive(PartialEq, Clone)] pub enum UpdateGlobalTableSettingsOutput { UpdateGlobalTableSettingsOutput { @@ -41616,7 +41685,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2718,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2724,3) #[derive(PartialEq, Clone)] pub enum UpdateItemInput { UpdateItemInput { @@ -41631,7 +41700,8 @@ pub mod software { UpdateExpression: Arc>>, ConditionExpression: Arc>>, ExpressionAttributeNames: Arc, Sequence>>>, - ExpressionAttributeValues: Arc, Arc>>> + ExpressionAttributeValues: Arc, Arc>>>, + ReturnValuesOnConditionCheckFailure: Arc>> } } @@ -41639,73 +41709,79 @@ pub mod software { /// Returns a borrow of the field TableName pub fn TableName(&self) -> &Sequence { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => TableName, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName, } } /// Returns a borrow of the field Key pub fn Key(&self) -> &Map, Arc> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Key, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key, } } /// Returns a borrow of the field AttributeUpdates pub fn AttributeUpdates(&self) -> &Arc, Arc>>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => AttributeUpdates, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => AttributeUpdates, } } /// Returns a borrow of the field Expected pub fn Expected(&self) -> &Arc, Arc>>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Expected, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Expected, } } /// Returns a borrow of the field ConditionalOperator pub fn ConditionalOperator(&self) -> &Arc>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionalOperator, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionalOperator, } } /// Returns a borrow of the field ReturnValues pub fn ReturnValues(&self) -> &Arc>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnValues, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValues, } } /// Returns a borrow of the field ReturnConsumedCapacity pub fn ReturnConsumedCapacity(&self) -> &Arc>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnConsumedCapacity, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity, } } /// Returns a borrow of the field ReturnItemCollectionMetrics pub fn ReturnItemCollectionMetrics(&self) -> &Arc>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnItemCollectionMetrics, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnItemCollectionMetrics, } } /// Returns a borrow of the field UpdateExpression pub fn UpdateExpression(&self) -> &Arc>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => UpdateExpression, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => UpdateExpression, } } /// Returns a borrow of the field ConditionExpression pub fn ConditionExpression(&self) -> &Arc>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionExpression, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression, } } /// Returns a borrow of the field ExpressionAttributeNames pub fn ExpressionAttributeNames(&self) -> &Arc, Sequence>>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeNames, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames, } } /// Returns a borrow of the field ExpressionAttributeValues pub fn ExpressionAttributeValues(&self) -> &Arc, Arc>>> { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeValues, + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues, + } + } + /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure + pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc>> { + match self { + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure, } } } @@ -41721,7 +41797,7 @@ pub mod software { for UpdateItemInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => { + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => { write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemInput.UpdateItemInput(")?; DafnyPrint::fmt_print(TableName, _formatter, false)?; write!(_formatter, ", ")?; @@ -41746,6 +41822,8 @@ pub mod software { DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -41760,7 +41838,7 @@ pub mod software { for UpdateItemInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => { + UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => { Hash::hash(TableName, _state); Hash::hash(Key, _state); Hash::hash(AttributeUpdates, _state); @@ -41772,7 +41850,8 @@ pub mod software { Hash::hash(UpdateExpression, _state); Hash::hash(ConditionExpression, _state); Hash::hash(ExpressionAttributeNames, _state); - Hash::hash(ExpressionAttributeValues, _state) + Hash::hash(ExpressionAttributeValues, _state); + Hash::hash(ReturnValuesOnConditionCheckFailure, _state) }, } } @@ -41793,7 +41872,8 @@ pub mod software { UpdateExpression: Default::default(), ConditionExpression: Default::default(), ExpressionAttributeNames: Default::default(), - ExpressionAttributeValues: Default::default() + ExpressionAttributeValues: Default::default(), + ReturnValuesOnConditionCheckFailure: Default::default() } } } @@ -41805,7 +41885,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2732,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2739,3) #[derive(PartialEq, Clone)] pub enum UpdateItemOutput { UpdateItemOutput { @@ -41895,7 +41975,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2737,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2744,3) #[derive(PartialEq, Clone)] pub enum UpdateKinesisStreamingConfiguration { UpdateKinesisStreamingConfiguration { @@ -41963,7 +42043,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2740,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2747,3) #[derive(PartialEq, Clone)] pub enum UpdateKinesisStreamingDestinationInput { UpdateKinesisStreamingDestinationInput { @@ -42053,7 +42133,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2745,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2752,3) #[derive(PartialEq, Clone)] pub enum UpdateKinesisStreamingDestinationOutput { UpdateKinesisStreamingDestinationOutput { @@ -42154,7 +42234,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2751,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2758,3) #[derive(PartialEq, Clone)] pub enum UpdateReplicationGroupMemberAction { UpdateReplicationGroupMemberAction { @@ -42277,7 +42357,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2759,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2766,3) #[derive(PartialEq, Clone)] pub enum UpdateTableInput { UpdateTableInput { @@ -42455,7 +42535,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2772,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2779,3) #[derive(PartialEq, Clone)] pub enum UpdateTableOutput { UpdateTableOutput { @@ -42523,7 +42603,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2775,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2782,3) #[derive(PartialEq, Clone)] pub enum UpdateTableReplicaAutoScalingInput { UpdateTableReplicaAutoScalingInput { @@ -42624,7 +42704,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2781,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2788,3) #[derive(PartialEq, Clone)] pub enum UpdateTableReplicaAutoScalingOutput { UpdateTableReplicaAutoScalingOutput { @@ -42692,7 +42772,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2784,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2791,3) #[derive(PartialEq, Clone)] pub enum UpdateTimeToLiveInput { UpdateTimeToLiveInput { @@ -42771,7 +42851,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2788,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2795,3) #[derive(PartialEq, Clone)] pub enum UpdateTimeToLiveOutput { UpdateTimeToLiveOutput { @@ -42839,7 +42919,7 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2791,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2798,3) #[derive(PartialEq, Clone)] pub enum WriteRequest { WriteRequest { @@ -42918,10 +42998,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2795,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2802,3) pub type WriteRequests = Sequence>; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2799,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2806,3) #[derive(PartialEq, Clone)] pub enum Error { BackupInUseException { @@ -43643,10 +43723,10 @@ pub mod software { } } - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2909,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2916,3) pub type OpaqueError = Arc; - /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2912,3) + /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2919,3) pub type DummySubsetType = DafnyInt; /// An element of DummySubsetType @@ -57475,13 +57555,13 @@ pub mod _AwsArnParsing_Compile { pub use ::dafny_runtime::DafnyCharUTF16; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier::AwsKmsArnIdentifier; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; pub use ::std::marker::Sync; pub use ::std::marker::Send; - pub use ::dafny_runtime::DafnyInt; pub use ::std::fmt::Debug; pub use ::std::fmt::Formatter; pub use ::dafny_runtime::DafnyPrint; @@ -57496,37 +57576,37 @@ pub mod _AwsArnParsing_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(80,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(86,3) pub fn ValidAwsKmsResource(resource: &Arc) -> bool { resource.Valid() && (resource.resourceType().clone() == string_utf16_of("key") || resource.resourceType().clone() == string_utf16_of("alias")) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(89,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(95,3) pub fn ValidAwsKmsArn(arn: &Arc) -> bool { arn.Valid() && arn.service().clone() == string_utf16_of("kms") && _default::ValidAwsKmsResource(arn.resource()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(115,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(121,3) pub fn ParseAwsKmsRawResources(identifier: &Sequence) -> Arc>> { let mut info: Sequence> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::(identifier, &DafnyCharUTF16(47 as u16)); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(info.get(&int!(0)) != string_utf16_of("key"), &string_utf16_of("Malformed raw key id: ").concat(identifier)); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(info.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) != string_utf16_of("key"), &string_utf16_of("Malformed raw key id: ").concat(identifier)); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::() } else { - if info.cardinality() == int!(1) { + if truncate!(info.cardinality(), u64) == 1 { _default::ParseAwsKmsResources(&string_utf16_of("key/").concat(identifier)) } else { _default::ParseAwsKmsResources(identifier) } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(127,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(134,3) pub fn ParseAwsKmsResources(identifier: &Sequence) -> Arc>> { let mut info: Sequence> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::(identifier, &DafnyCharUTF16(47 as u16)); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(1) < info.cardinality(), &string_utf16_of("Malformed resource: ").concat(identifier)); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(1 < truncate!(info.cardinality(), u64), &string_utf16_of("Malformed resource: ").concat(identifier)); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() } else { - let mut resourceType: Sequence = info.get(&int!(0)); - let mut value: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Join::(&info.drop(&int!(1)), &string_utf16_of("/")); + let mut resourceType: Sequence = info.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())); + let mut value: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Join::(&info.drop(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), &string_utf16_of("/")); let mut resource: Arc = Arc::new(AwsResource::AwsResource { resourceType: resourceType.clone(), value: value.clone() @@ -57541,15 +57621,15 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(143,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(151,3) pub fn ValidAmazonDynamodbResource(resource: &Arc) -> bool { resource.Valid() && resource.resourceType().clone() == string_utf16_of("table") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(152,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(160,3) pub fn ValidAmazonDynamodbArn(arn: &Arc) -> bool { arn.Valid() && arn.service().clone() == string_utf16_of("dynamodb") && _default::ValidAmazonDynamodbResource(arn.resource()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(175,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(183,3) pub fn ParseAmazonDynamodbResources(identifier: &Sequence) -> Arc>> { let mut info: Arc, Sequence)>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::_SplitOnce_q::(identifier, &DafnyCharUTF16(47 as u16)); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&info).as_ref(), Some{ .. }), &string_utf16_of("Malformed resource: ").concat(identifier)); @@ -57577,24 +57657,24 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(232,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(240,3) pub fn ParseAwsKmsArn(identifier: &Sequence) -> Arc>> { let mut components: Sequence> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::(identifier, &DafnyCharUTF16(58 as u16)); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(6) == components.cardinality(), &string_utf16_of("Malformed arn: ").concat(identifier)); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(6 == truncate!(components.cardinality(), u64), &string_utf16_of("Malformed arn: ").concat(identifier)); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() } else { - let mut valueOrError1: Arc>> = _default::ParseAwsKmsResources(&components.get(&int!(5))); + let mut valueOrError1: Arc>> = _default::ParseAwsKmsResources(&components.get(&int!((&truncate!((&int!(5)).clone(), u32)).clone()))); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>() } else { let mut resource: AwsKmsResource = valueOrError1.Extract(); let mut arn: Arc = Arc::new(AwsArn::AwsArn { - arnLiteral: components.get(&int!(0)), - partition: components.get(&int!(1)), - service: components.get(&int!(2)), - region: components.get(&int!(3)), - account: components.get(&int!(4)), + arnLiteral: components.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), + partition: components.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), + service: components.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())), + region: components.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())), + account: components.get(&int!((&truncate!((&int!(4)).clone(), u32)).clone())), resource: resource.clone() }); let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(_default::ValidAwsKmsArn(&arn), &string_utf16_of("Malformed Arn:").concat(identifier)); @@ -57608,24 +57688,24 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(261,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(271,3) pub fn ParseAmazonDynamodbTableArn(identifier: &Sequence) -> Arc>> { let mut components: Sequence> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::(identifier, &DafnyCharUTF16(58 as u16)); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(6) == components.cardinality(), &string_utf16_of("Malformed arn: ").concat(identifier)); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(6 == truncate!(components.cardinality(), u64), &string_utf16_of("Malformed arn: ").concat(identifier)); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() } else { - let mut valueOrError1: Arc>> = _default::ParseAmazonDynamodbResources(&components.get(&int!(5))); + let mut valueOrError1: Arc>> = _default::ParseAmazonDynamodbResources(&components.get(&int!((&truncate!((&int!(5)).clone(), u32)).clone()))); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>() } else { let mut resource: AmazonDynamodbResource = valueOrError1.Extract(); let mut arn: Arc = Arc::new(AwsArn::AwsArn { - arnLiteral: components.get(&int!(0)), - partition: components.get(&int!(1)), - service: components.get(&int!(2)), - region: components.get(&int!(3)), - account: components.get(&int!(4)), + arnLiteral: components.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), + partition: components.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), + service: components.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())), + region: components.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())), + account: components.get(&int!((&truncate!((&int!(4)).clone(), u32)).clone())), resource: resource.clone() }); let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(_default::ValidAmazonDynamodbArn(&arn), &string_utf16_of("Malformed Arn:").concat(identifier)); @@ -57639,7 +57719,7 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(328,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(339,3) pub fn ParseAwsKmsIdentifier(identifier: &Sequence) -> Arc, Sequence>> { if string_utf16_of("arn:") <= identifier.clone() { let mut valueOrError0: Arc>> = _default::ParseAwsKmsArn(identifier); @@ -57667,7 +57747,7 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(338,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(349,3) pub fn ParseAmazonDynamodbTableName(identifier: &Sequence) -> Arc, Sequence>> { let mut valueOrError0: Arc>> = _default::ParseAmazonDynamodbTableArn(identifier); if valueOrError0.IsFailure() { @@ -57683,11 +57763,11 @@ pub mod _AwsArnParsing_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(350,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(361,3) pub fn IsMultiRegionAwsKmsArn(arn: &AwsKmsArn) -> bool { _default::IsMultiRegionAwsKmsResource(arn.resource()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(381,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(392,3) pub fn IsMultiRegionAwsKmsIdentifier(identifier: &Arc) -> bool { let mut _source0: Arc = identifier.clone(); if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) { @@ -57700,11 +57780,11 @@ pub mod _AwsArnParsing_Compile { _default::IsMultiRegionAwsKmsResource(&r) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(437,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(448,3) pub fn IsMultiRegionAwsKmsResource(resource: &AwsKmsResource) -> bool { resource.resourceType().clone() == string_utf16_of("key") && string_utf16_of("mrk-") <= resource.value().clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(442,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(453,3) pub fn GetRegion(identifier: &Arc) -> Arc>> { let mut _source0: Arc = identifier.clone(); if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) { @@ -57718,13 +57798,13 @@ pub mod _AwsArnParsing_Compile { Arc::new(Option::>::None {}) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(452,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(463,3) pub fn IsAwsKmsIdentifierString(s: &Sequence) -> Arc, Sequence>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::UTF8::_default::IsASCIIString(s), &string_utf16_of("Not a valid ASCII string.")); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() } else { - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < s.cardinality() && s.cardinality() <= _default::MAX_AWS_KMS_IDENTIFIER_LENGTH(), &string_utf16_of("Identifier exceeds maximum length.")); + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(s.cardinality(), u64) && truncate!(s.cardinality(), u64) <= _default::MAX_AWS_KMS_IDENTIFIER_LENGTH(), &string_utf16_of("Identifier exceeds maximum length.")); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>() } else { @@ -57732,13 +57812,13 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(465,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(477,3) pub fn Error(s: &Sequence) -> Arc { Arc::new(Error::AwsCryptographicMaterialProvidersException { message: s.clone() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(469,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(481,3) pub fn ValidateDdbTableArn(tableArn: &Sequence) -> Arc>> { let mut valueOrError0: Arc, Arc>> = _default::ParseAmazonDynamodbTableName(tableArn).MapFailure::>(&(Arc::new(move |x0: &Sequence| _default::Error(x0)) as Arc _ + Sync + Send>)); if valueOrError0.IsFailure() { @@ -57764,13 +57844,13 @@ pub mod _AwsArnParsing_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(16,3) - pub fn MAX_AWS_KMS_IDENTIFIER_LENGTH() -> DafnyInt { - int!(2048) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(17,3) + pub fn MAX_AWS_KMS_IDENTIFIER_LENGTH() -> u64 { + 2048 } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(18,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(19,3) #[derive(PartialEq, Clone)] pub enum AwsResource { AwsResource { @@ -57780,11 +57860,11 @@ pub mod _AwsArnParsing_Compile { } impl AwsResource { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(22,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(23,5) pub fn Valid(self: &Arc) -> bool { - true && int!(0) < self.value().cardinality() + true && 0 < truncate!(self.value().cardinality(), u64) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(27,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(29,5) pub fn ToString(self: &Arc) -> Sequence { self.resourceType().concat(&string_utf16_of("/")).concat(self.value()) } @@ -57857,7 +57937,7 @@ pub mod _AwsArnParsing_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(36,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(38,3) #[derive(PartialEq, Clone)] pub enum AwsArn { AwsArn { @@ -57871,15 +57951,15 @@ pub mod _AwsArnParsing_Compile { } impl AwsArn { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(44,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(46,5) pub fn Valid(self: &Arc) -> bool { - self.arnLiteral().clone() == string_utf16_of("arn") && int!(0) < self.partition().cardinality() && int!(0) < self.service().cardinality() && int!(0) < self.region().cardinality() && int!(0) < self.account().cardinality() && self.resource().Valid() + self.arnLiteral().clone() == string_utf16_of("arn") && 0 < truncate!(self.partition().cardinality(), u64) && 0 < truncate!(self.service().cardinality(), u64) && 0 < truncate!(self.region().cardinality(), u64) && 0 < truncate!(self.account().cardinality(), u64) && self.resource().Valid() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(54,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(60,5) pub fn ToString(self: &Arc) -> Sequence { self.ToArnString(&Arc::new(Option::>::None {})) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(60,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(66,5) pub fn ToArnString(self: &Arc, customRegion: &Arc>>) -> Sequence { let mut _this = self.clone(); let mut _r0 = customRegion.clone(); @@ -58010,13 +58090,13 @@ pub mod _AwsArnParsing_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(96,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(102,3) pub type AwsKmsArn = Arc; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(99,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(105,3) pub type AwsKmsResource = Arc; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(102,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(108,3) #[derive(PartialEq, Clone)] pub enum AwsKmsIdentifier { AwsKmsArnIdentifier { @@ -58028,7 +58108,7 @@ pub mod _AwsArnParsing_Compile { } impl AwsKmsIdentifier { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(106,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(112,5) pub fn ToString(self: &Arc) -> Sequence { let mut _source0: Arc = self.clone(); if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) { @@ -58117,13 +58197,13 @@ pub mod _AwsArnParsing_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(159,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(167,3) pub type AmazonDynamodbTableArn = Arc; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(162,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(170,3) pub type AmazonDynamodbResource = Arc; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(165,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(173,3) #[derive(PartialEq, Clone)] pub enum AmazonDynamodbTableName { AmazonDynamodbTableArn { @@ -58132,7 +58212,7 @@ pub mod _AwsArnParsing_Compile { } impl AmazonDynamodbTableName { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(167,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(175,5) pub fn GetTableName(self: &Arc) -> Sequence { let mut _source0: Arc = self.clone(); let mut ___mcc_h0: AmazonDynamodbTableArn = _source0.a().clone(); @@ -58198,7 +58278,7 @@ pub mod _AwsArnParsing_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(461,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(473,3) pub type AwsKmsIdentifierString = Sequence; } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(13,1) @@ -58217,7 +58297,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyOutput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None; pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; @@ -58253,7 +58333,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { /// = aws-encryption-sdk-specification/framework/branch-key-store.md#getkeystoreinfo /// = type=implication /// # This operation MUST return the keystore information in this keystore configuration. - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(58,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(59,3) pub fn GetKeyStoreInfo(config: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>> = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: Arc::new(GetKeyStoreInfoOutput::GetKeyStoreInfoOutput { @@ -58266,7 +58346,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { }); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(87,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(88,3) pub fn CreateKeyStore(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, Arc>>; @@ -58296,10 +58376,10 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { /// = type=implication /// # If an optional branch key id is provided /// # and no encryption context is provided this operation MUST fail. - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(107,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(108,3) pub fn CreateKey(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(!matches!(input.branchKeyIdentifier().as_ref(), Some{ .. }) || matches!(input.encryptionContext().as_ref(), Some{ .. }) && int!(0) < input.encryptionContext().value().cardinality(), &Arc::new(Error::KeyStoreException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(!matches!(input.branchKeyIdentifier().as_ref(), Some{ .. }) || matches!(input.encryptionContext().as_ref(), Some{ .. }) && 0 < truncate!(input.encryptionContext().value().cardinality(), u64), &Arc::new(Error::KeyStoreException { message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::CUSTOM_BRANCH_KEY_ID_NEED_EC() })); if valueOrError0.IsFailure() { @@ -58331,7 +58411,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { }; branchKeyIdentifier = valueOrError2.Extract(); } else { - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < input.branchKeyIdentifier().value().cardinality(), &Arc::new(Error::KeyStoreException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(input.branchKeyIdentifier().value().cardinality(), u64), &Arc::new(Error::KeyStoreException { message: string_utf16_of("Custom branch key id can not be an empty string.") })); if valueOrError3.IsFailure() { @@ -58432,7 +58512,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { /// = type=implication /// # If the Keystore's KMS Configuration is `Discovery` or `MRDiscovery`, /// # this operation MUST immediately fail. - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(209,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(211,3) pub fn VersionKey(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::HasKeyId(config.kmsConfiguration()), &Arc::new(Error::KeyStoreException { @@ -58442,7 +58522,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { output = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); return output.read(); }; - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < input.branchKeyIdentifier().cardinality(), &Arc::new(Error::KeyStoreException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(input.branchKeyIdentifier().cardinality(), u64), &Arc::new(Error::KeyStoreException { message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::BRANCH_KEY_ID_NEEDED() })); if valueOrError1.IsFailure() { @@ -58483,21 +58563,21 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { output = MaybePlacebo::from(_out2.clone()); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(253,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(256,3) pub fn GetActiveBranchKey(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>>; let mut _out0: Arc, Arc>> = crate::implementation_from_dafny::_GetKeys_Compile::_default::GetActiveKeyAndUnwrap(input, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient()); output = _out0.clone(); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(270,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(273,3) pub fn GetBranchKeyVersion(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>>; let mut _out0: Arc, Arc>> = crate::implementation_from_dafny::_GetKeys_Compile::_default::GetBranchKeyVersion(input, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient()); output = _out0.clone(); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(287,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(290,3) pub fn GetBeaconKey(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>>; let mut _out0: Arc, Arc>> = crate::implementation_from_dafny::_GetKeys_Compile::_default::GetBeaconKeyAndUnwrap(input, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient()); @@ -58506,7 +58586,7 @@ pub mod _AwsCryptographyKeyStoreOperations_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(28,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(29,3) #[derive(PartialEq, Clone)] pub enum Config { Config { @@ -58769,7 +58849,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(91,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(92,3) pub fn CreateAwsKmsKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(input.kmsKeyId()); @@ -58793,7 +58873,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(103,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(104,3) pub fn CreateAwsKmsDiscoveryKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); if matches!(input.discoveryFilter().as_ref(), Some{ .. }) { @@ -58819,7 +58899,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(117,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(118,3) pub fn CreateAwsKmsMultiKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens()); @@ -58849,7 +58929,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(147,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(148,3) pub fn CreateAwsKmsDiscoveryMultiKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens()); @@ -58877,7 +58957,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::coerce(upcast_object::(), upcast_id::>()))(_out1.clone())); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(172,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(173,3) pub fn CreateAwsKmsMrkKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(input.kmsKeyId()); @@ -58901,7 +58981,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(185,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(186,3) pub fn CreateAwsKmsMrkMultiKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens()); @@ -58929,7 +59009,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::coerce(upcast_object::(), upcast_id::>()))(_out1.clone())); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(210,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(211,3) pub fn CreateAwsKmsMrkDiscoveryKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); if matches!(input.discoveryFilter().as_ref(), Some{ .. }) { @@ -58965,7 +59045,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(235,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(236,3) pub fn CreateAwsKmsMrkDiscoveryMultiKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens()); @@ -58993,11 +59073,11 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::coerce(upcast_object::(), upcast_id::>()))(_out1.clone())); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(262,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(263,3) pub fn N(n: PositiveLong) -> Sequence { crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&n).clone())) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(269,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(270,3) pub fn CheckCache(cache: &Arc, ttlSeconds: PositiveLong) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); if matches!(cache.as_ref(), StormTracking{ .. }) { @@ -59025,7 +59105,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(289,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(290,3) pub fn CreateAwsKmsHierarchicalKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut cmc: Object; @@ -59230,7 +59310,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(389,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(390,3) pub fn CreateAwsKmsEcdhKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens()); @@ -59383,10 +59463,10 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(493,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(494,3) pub fn CreateMultiKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(input.generator().as_ref(), Some{ .. }) || int!(0) < input.childKeyrings().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(input.generator().as_ref(), Some{ .. }) || 0 < truncate!(input.childKeyrings().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Must include a generator keyring and/or at least one child keyring") })); if valueOrError0.IsFailure() { @@ -59402,7 +59482,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(515,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(517,3) pub fn CreateRawAesKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.keyNamespace().clone() != string_utf16_of("aws-kms"), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -59444,14 +59524,15 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { let mut __let_tmp_rhs0: (ValidUTF8Bytes, ValidUTF8Bytes) = namespaceAndName.clone(); let mut namespace: ValidUTF8Bytes = __let_tmp_rhs0.0.clone(); let mut name: ValidUTF8Bytes = __let_tmp_rhs0.1.clone(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.wrappingKey().cardinality() == int!(16) || input.wrappingKey().cardinality() == int!(24) || input.wrappingKey().cardinality() == int!(32), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut wrapping_key_size: u64 = truncate!(input.wrappingKey().cardinality(), u64); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(wrapping_key_size == 16 || wrapping_key_size == 24 || wrapping_key_size == 32, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid wrapping key length") })); if valueOrError2.IsFailure() { output = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return output.read(); }; - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.wrappingKey().cardinality() == int!(wrappingAlg.keyLength().clone()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(wrapping_key_size == wrappingAlg.keyLength().clone() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Wrapping key length does not match specified wrapping algorithm") })); if valueOrError3.IsFailure() { @@ -59467,7 +59548,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(574,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(578,3) pub fn CreateRawRsaKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.keyNamespace().clone() != string_utf16_of("aws-kms"), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -59521,7 +59602,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(609,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(613,3) pub fn CreateRawEcdhKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut recipientPublicKey: Sequence; @@ -59648,7 +59729,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(708,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(712,3) pub fn CreateAwsKmsRsaKeyring(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(input.publicKey().as_ref(), Some{ .. }) || matches!(input.kmsClient().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -59717,7 +59798,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(765,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(769,3) pub fn CreateDefaultCryptographicMaterialsManager(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>>; let mut cmm: Object; @@ -59729,13 +59810,13 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { })); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(772,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(776,3) pub fn CmpError(s: &Sequence) -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: s.clone() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(780,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(784,3) pub fn CreateRequiredEncryptionContextCMM(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(input.underlyingCMM().as_ref(), Some{ .. }) && matches!(input.keyring().as_ref(), None{ .. }), &_default::CmpError(&string_utf16_of("CreateRequiredEncryptionContextCMM currently only supports cmm."))); @@ -59761,7 +59842,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { _coll0.build() }) }))(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < keySet.cardinality(), &_default::CmpError(&string_utf16_of("RequiredEncryptionContextCMM needs at least one requiredEncryptionContextKey."))); + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(keySet.cardinality(), u64), &_default::CmpError(&string_utf16_of("RequiredEncryptionContextCMM needs at least one requiredEncryptionContextKey."))); if valueOrError1.IsFailure() { output = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); return output.read(); @@ -59775,7 +59856,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }))); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(797,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(802,3) pub fn CreateCryptographicMaterialsCache(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut _source0: Arc = input.cache().clone(); @@ -59816,7 +59897,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { let mut ___mcc_h1: Arc = _source0.No().clone(); let mut cmc: Object; let mut _nw2: Object = LocalCMC::_allocate_object(); - LocalCMC::_ctor(&_nw2, &int!(0), &int!(1)); + LocalCMC::_ctor(&_nw2, 0, 1); cmc = _nw2.clone(); output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::coerce(upcast_object::(), upcast_id::>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: cmc.clone() @@ -59828,7 +59909,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { let mut c: Arc = ___mcc_h2.clone(); let mut cmc: Object; let mut _nw3: Object = LocalCMC::_allocate_object(); - LocalCMC::_ctor(&_nw3, &int!(c.entryCapacity().clone()), &int!((&_default::OptionalCountingNumber(c.entryPruningTailSize()).UnwrapOr(&truncate!((&int!(1)).clone(), i32))).clone())); + LocalCMC::_ctor(&_nw3, c.entryCapacity().clone() as u64, _default::OptionalCountingNumber(c.entryPruningTailSize()).UnwrapOr(&truncate!((&int!(1)).clone(), i32)) as u64); cmc = _nw3.clone(); output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::coerce(upcast_object::(), upcast_id::>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: cmc.clone() @@ -59840,7 +59921,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { let mut c: Arc = ___mcc_h3.clone(); let mut cmc: Object; let mut _nw4: Object = LocalCMC::_allocate_object(); - LocalCMC::_ctor(&_nw4, &int!(c.entryCapacity().clone()), &int!((&_default::OptionalCountingNumber(c.entryPruningTailSize()).UnwrapOr(&truncate!((&int!(1)).clone(), i32))).clone())); + LocalCMC::_ctor(&_nw4, c.entryCapacity().clone() as u64, _default::OptionalCountingNumber(c.entryPruningTailSize()).UnwrapOr(&truncate!((&int!(1)).clone(), i32)) as u64); cmc = _nw4.clone(); let mut synCmc: Object; let mut _nw5: Object = SynchronizedLocalCMC::_allocate_object(cmc.clone()); @@ -59899,7 +59980,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(845,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(850,3) pub fn OptionalCountingNumber(c: &Arc>) -> Arc> { if matches!(c.as_ref(), Some{ .. }) && c.value().clone() <= 0 { Arc::new(Option::::None {}) @@ -59907,7 +59988,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { c.clone() } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(862,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(867,3) pub fn CreateDefaultClientSupplier(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>>; let mut clientSupplier: Object; @@ -59919,15 +60000,15 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { })); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(869,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(874,3) pub fn InitializeEncryptionMaterials(config: &Arc, input: &Arc) -> Arc, Arc>> { crate::implementation_from_dafny::_Materials_Compile::_default::InitializeEncryptionMaterials(input) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(875,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(880,3) pub fn InitializeDecryptionMaterials(config: &Arc, input: &Arc) -> Arc, Arc>> { crate::implementation_from_dafny::_Materials_Compile::_default::InitializeDecryptionMaterials(input) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(881,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(886,3) pub fn ValidEncryptionMaterialsTransition(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(input.start(), input.stop()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidEncryptionMaterialsTransition { message: string_utf16_of("Invalid Encryption Materials Transition") @@ -59940,7 +60021,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(892,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(897,3) pub fn ValidDecryptionMaterialsTransition(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(input.start(), input.stop()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidDecryptionMaterialsTransition { message: string_utf16_of("Invalid Decryption Materials Transition") @@ -59953,7 +60034,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(903,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(908,3) pub fn EncryptionMaterialsHasPlaintextDataKey(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(input), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidDecryptionMaterials { message: string_utf16_of("Invalid Encryption Materials") @@ -59966,7 +60047,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(913,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(918,3) pub fn DecryptionMaterialsWithPlaintextDataKey(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithPlaintextDataKey(input), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidDecryptionMaterials { message: string_utf16_of("Invalid Decryption Materials") @@ -59979,11 +60060,11 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(924,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(929,3) pub fn GetAlgorithmSuiteInfo(config: &Arc, input: &Sequence) -> Arc, Arc>> { crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetAlgorithmSuiteInfo(input) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(930,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(935,3) pub fn ValidAlgorithmSuiteInfo(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::_AlgorithmSuite_q(input), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidAlgorithmSuiteInfo { message: string_utf16_of("Invalid AlgorithmSuiteInfo") @@ -59996,7 +60077,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(940,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(945,3) pub fn ValidateCommitmentPolicyOnEncrypt(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnEncrypt(input.algorithm(), input.commitmentPolicy()); if valueOrError0.IsFailure() { @@ -60007,7 +60088,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(948,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(953,3) pub fn ValidateCommitmentPolicyOnDecrypt(config: &Arc, input: &Arc) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnDecrypt(input.algorithm(), input.commitmentPolicy()); if valueOrError0.IsFailure() { @@ -60020,7 +60101,7 @@ pub mod _AwsCryptographyMaterialProvidersOperations_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(72,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(73,3) #[derive(PartialEq, Clone)] pub enum Config { Config { @@ -60416,8 +60497,8 @@ pub mod _AwsEncryptionSdkOperations_Compile { pub use ::dafny_runtime::rd; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnEncryptInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy; - pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials; pub use ::dafny_runtime::truncate; + pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId::ESDK; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16; pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey; @@ -60434,9 +60515,9 @@ pub mod _AwsEncryptionSdkOperations_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnDecryptInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; @@ -60489,7 +60570,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { /// # * encrypt (encrypt.md) MUST only support algorithm suites that have /// # a Key Commitment (../framework/algorithm-suites.md#algorithm- /// # suites-encryption-key-derivation-settings) value of True - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(66,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(67,3) pub fn Encrypt(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError1: Arc>>; @@ -60562,7 +60643,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { }; let mut _v0: () = valueOrError4.Extract(); }; - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.plaintext().cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { + let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(input.plaintext().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Plaintext exceeds maximum allowed size") })); if valueOrError5.IsFailure() { @@ -60638,7 +60719,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { output = MaybePlacebo::from(maybeSignedMessage.clone()); return output.read(); } - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(238,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(240,3) pub fn SignAndSerializeMessage(config: &Arc, header: &Arc, framedMessage: &FramedMessage, materials: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); if matches!(framedMessage.finalFrame().header().suite().signature().as_ref(), ECDSA{ .. }) { @@ -60675,7 +60756,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { return output.read(); }; let mut bytes: Sequence = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(bytes.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(bytes.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Length of signature bytes is larger than the uint16 limit.") })); if valueOrError3.IsFailure() { @@ -60710,7 +60791,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { }; return output.read(); } - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(379,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(382,3) pub fn Decrypt(config: &Arc, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, Arc>>; @@ -60723,13 +60804,13 @@ pub mod _AwsEncryptionSdkOperations_Compile { let mut cmm: Object = valueOrError0.Extract(); let mut buffer: Arc = Arc::new(ReadableBuffer::ReadableBuffer { bytes: input.ciphertext().clone(), - start: int!(0) + start: 0 }); let mut _out1: Arc, Arc>> = _default::InternalDecrypt(config, &cmm, &buffer, input.encryptionContext()); output = MaybePlacebo::from(_out1.clone()); return output.read(); } - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(435,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(438,3) pub fn InternalDecrypt(config: &Arc, cmm: &Object, buffer: &Arc, inputEncryptionContext: &Arc>>) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut v4Retry: bool = false; @@ -60739,7 +60820,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { return output.read(); }; let mut headerBody: Arc>> = valueOrError0.Extract(); - let mut rawHeader: Sequence = buffer.bytes().slice(buffer.start(), headerBody.tail().start()); + let mut rawHeader: Sequence = buffer.bytes().slice(&int!(buffer.start().clone()), &int!(headerBody.tail().start().clone())); let mut algorithmSuite: Arc = headerBody.data().algorithmSuite().clone(); let mut valueOrError1: Arc>> = IAwsCryptographicMaterialProvidersClient::ValidateCommitmentPolicyOnDecrypt(rd!(config.mpl().clone()), &Arc::new(ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput { algorithm: algorithmSuite.id().clone(), @@ -60892,14 +60973,14 @@ pub mod _AwsEncryptionSdkOperations_Compile { messageBodyTail = decryptRes.1.clone(); }; let mut valueOrError12: Arc, Arc>>; - let mut _out8: Arc, Arc>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::VerifySignature(&messageBodyTail, &messageBodyTail.bytes().slice(buffer.start(), messageBodyTail.start()), &decMat, config.crypto()); + let mut _out8: Arc, Arc>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::VerifySignature(&messageBodyTail, &messageBodyTail.bytes().slice(&int!(buffer.start().clone()), &int!(messageBodyTail.start().clone())), &decMat, config.crypto()); valueOrError12 = _out8.clone(); if valueOrError12.IsFailure() { output = MaybePlacebo::from(valueOrError12.PropagateFailure::>()); return output.read(); }; let mut signature: Arc = valueOrError12.Extract(); - let mut valueOrError13: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(signature.start().clone() == signature.bytes().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { + let mut valueOrError13: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(signature.start().clone() == truncate!(signature.bytes().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Data after message footer.") })); if valueOrError13.IsFailure() { @@ -60915,7 +60996,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { })); return output.read(); } - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(804,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(807,3) pub fn buildEncryptionContextToOnlyAuthenticate(decMat: &Arc) -> Map { (&({ let mut decMat = decMat.clone(); @@ -60938,7 +61019,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { } } - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(40,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(41,3) #[derive(PartialEq, Clone)] pub enum Config { Config { @@ -61050,7 +61131,7 @@ pub mod _AwsEncryptionSdkOperations_Compile { } } - /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(50,3) + /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(51,3) pub type FrameLength = i64; } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(15,1) @@ -61087,7 +61168,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { pub use ::dafny_runtime::upcast_object; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult; pub use crate::implementation_from_dafny::_Constants_Compile::AwsKmsEdkHelper; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::DafnyCharUTF16; pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; @@ -61106,7 +61187,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(544,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(574,3) pub fn DiscoveryMatch(arn: &AwsKmsArn, discoveryFilter: &Arc>>) -> bool { true && (&({ let mut arn = arn.clone(); @@ -61123,7 +61204,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(34,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(35,3) pub struct AwsKmsDiscoveryKeyring { pub __i_client: Object, pub __i_discoveryFilter: Arc>>, @@ -61135,7 +61216,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(56,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(57,5) pub fn _ctor(this: &Object, client: &Object, discoveryFilter: &Arc>>, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_discoveryFilter: bool = false; @@ -61145,15 +61226,15 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(40,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(41,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(41,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(42,5) pub fn discoveryFilter(&self) -> Arc>> { self.__i_discoveryFilter.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(42,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(43,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -61174,7 +61255,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { impl IKeyring for AwsKmsDiscoveryKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(88,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(105,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>> = Arc::new(Result::, Arc>::Failure { error: Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -61183,7 +61264,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { }); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(116,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(147,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -61220,7 +61301,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { return res.read(); }; let mut edksToAttempt: Sequence> = valueOrError2.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); @@ -61269,7 +61350,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(285,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(311,3) pub struct AwsKmsEncryptedDataKeyFilter { pub __i_discoveryFilter: Arc>> } @@ -61279,13 +61360,13 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(293,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(319,5) pub fn _ctor(this: &Object, discoveryFilter: &Arc>>) -> () { let mut _set___i_discoveryFilter: bool = false; update_field_uninit_object!(this.clone(), __i_discoveryFilter, _set___i_discoveryFilter, discoveryFilter.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(292,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(318,5) pub fn discoveryFilter(&self) -> Arc>> { self.__i_discoveryFilter.clone() } @@ -61306,7 +61387,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { impl DeterministicAction, Arc>>> for AwsKmsEncryptedDataKeyFilter { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(322,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(348,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -61359,7 +61440,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { UpcastObjectFn!(dyn DeterministicAction, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(373,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(399,3) pub struct AwsKmsEncryptedDataKeyTransformer {} impl AwsKmsEncryptedDataKeyTransformer { @@ -61367,7 +61448,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(380,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(406,5) pub fn _ctor(this: &Object) -> () { return (); } @@ -61388,7 +61469,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { impl DeterministicAction, Arc>, Arc>>> for AwsKmsEncryptedDataKeyTransformer { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(401,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(427,5) fn Invoke(&self, edk: &Arc) -> Arc>, Arc>> { let mut res = MaybePlacebo::>, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(edk.keyProviderId().clone() == crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -61432,7 +61513,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { UpcastObjectFn!(dyn DeterministicAction, Arc>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(428,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(454,3) pub struct AwsKmsEncryptedDataKeyDecryptor { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_client: Object, @@ -61444,7 +61525,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(438,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(464,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object, grantTokens: &GrantTokenList) -> () { let mut _set___i_materials: bool = false; let mut _set___i_client: bool = false; @@ -61454,15 +61535,15 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(434,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(460,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(435,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(461,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(436,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(462,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -61483,7 +61564,7 @@ pub mod _AwsKmsDiscoveryKeyring_Compile { impl Action, Arc>>> for AwsKmsEncryptedDataKeyDecryptor { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(509,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(539,5) fn Invoke(&self, helper: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut awsKmsKey: Sequence = AwsArn::ToString(helper.arn()); @@ -61580,12 +61661,12 @@ pub mod _AwsKmsEcdhKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials; pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey; pub use crate::implementation_from_dafny::_Actions_Compile::Action; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPublicKeyDiscoveryInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPrivateKeyToStaticPublicKeyInput; pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhUnwrap; @@ -61599,7 +61680,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(369,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(404,3) pub fn DeriveSharedSecret(client: &Object, senderAwsKmsKey: &Sequence, recipientPublicKey: &Sequence, grantTokens: &GrantTokenList) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut deriveSharedSecretRequest: Arc = Arc::new(DeriveSharedSecretRequest::DeriveSharedSecretRequest { @@ -61637,19 +61718,19 @@ pub mod _AwsKmsEcdhKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(707,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(748,3) pub fn E(s: &Sequence) -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: s.clone() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(44,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(45,3) pub fn AWS_KMS_ECDH_KEYRING_VERSION() -> Sequence { crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::RAW_ECDH_KEYRING_VERSION() } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(49,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(50,3) pub struct AwsKmsEcdhKeyring { pub __i_client: Object, pub __i_cryptoPrimitives: Object, @@ -61668,7 +61749,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(75,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(76,5) pub fn _ctor(this: &Object, KeyAgreementScheme: &Arc, curveSpec: &Arc, client: &Object, grantTokens: &GrantTokenList, senderKmsKeyId: &Arc>>, senderPublicKey: &Arc>, recipientPublicKey: &PublicKeyType, compressedSenderPublicKey: &Arc>>, compressedRecipientPublicKey: &Sequence, cryptoPrimitives: &Object) -> () { let mut _set___i_client: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -61692,43 +61773,43 @@ pub mod _AwsKmsEcdhKeyring_Compile { update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(52,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(53,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(61,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(62,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(58,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(59,5) pub fn keyAgreementScheme(&self) -> Arc { self.__i_keyAgreementScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(59,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(60,5) pub fn curveSpec(&self) -> Arc { self.__i_curveSpec.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(60,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(61,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(55,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(56,5) pub fn recipientPublicKey(&self) -> PublicKeyType { self.__i_recipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(54,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(55,5) pub fn senderPublicKey(&self) -> Arc> { self.__i_senderPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(56,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(57,5) pub fn compressedSenderPublicKey(&self) -> Arc>> { self.__i_compressedSenderPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(57,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(58,5) pub fn compressedRecipientPublicKey(&self) -> Sequence { self.__i_compressedRecipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(53,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(54,5) pub fn senderKmsKeyId(&self) -> Arc>> { self.__i_senderKmsKeyId.clone() } @@ -61749,7 +61830,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { impl IKeyring for AwsKmsEcdhKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(133,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(155,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(!matches!((&self.keyAgreementScheme().clone()).as_ref(), KmsPublicKeyDiscovery{ .. }), &_default::E(&string_utf16_of("KmsPublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt."))); @@ -61868,7 +61949,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { }; return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(286,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(320,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -61890,7 +61971,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { return res.read(); }; let mut edksToAttempt: Sequence> = valueOrError1.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError2: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); @@ -61936,7 +62017,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(434,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(469,3) pub struct DecryptSingleEncryptedDataKey { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_cryptoPrimitives: Object, @@ -61952,7 +62033,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(448,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(483,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, cryptoPrimitives: &Object, recipientPublicKey: &Sequence, client: &Object, grantTokens: &GrantTokenList, keyAgreementScheme: &Arc, curveSpec: &Arc) -> () { let mut _set___i_materials: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -61970,31 +62051,31 @@ pub mod _AwsKmsEcdhKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(440,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(475,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(441,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(476,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(442,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(477,5) pub fn recipientPublicKey(&self) -> Sequence { self.__i_recipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(445,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(480,5) pub fn keyAgreementScheme(&self) -> Arc { self.__i_keyAgreementScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(443,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(478,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(446,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(481,5) pub fn curveSpec(&self) -> Arc { self.__i_curveSpec.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(444,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(479,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -62015,107 +62096,100 @@ pub mod _AwsKmsEcdhKeyring_Compile { impl Action, Arc>>> for DecryptSingleEncryptedDataKey { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(500,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(540,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderId()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Received invalid EDK provider id for AWS KMS ECDH Keyring") - })); - if valueOrError0.IsFailure() { - res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); - return res.read(); - }; let mut suite: Arc = self.materials().clone().algorithmSuite().clone(); let mut keyProviderId: ValidUTF8Bytes = edk.keyProviderId().clone(); let mut providerInfo: Sequence = edk.keyProviderInfo().clone(); let mut ciphertext: Sequence = edk.ciphertext().clone(); - let mut valueOrError1: Arc, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite); + let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite); + if valueOrError0.IsFailure() { + res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); + return res.read(); + }; + let mut providerWrappedMaterial: Sequence = valueOrError0.Extract(); + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::()); return res.read(); }; - let mut providerWrappedMaterial: Sequence = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerInfo.cardinality() <= int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN()) && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); + let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(seq![keyringVersion] == _default::AWS_KMS_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info."))); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::()); return res.read(); }; - let mut keyringVersion: u8 = providerInfo.get(&int!(0)); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(seq![keyringVersion] == _default::AWS_KMS_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info."))); + let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()))); + let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64; + let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::()); return res.read(); }; - let mut recipientPublicKeyLength: DafnyInt = int!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())))); - let mut recipientPublicKeyLengthIndex: DafnyInt = int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()) + recipientPublicKeyLength.clone(); - let mut senderPublicKeyIndex: DafnyInt = recipientPublicKeyLengthIndex.clone() + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex.clone() + int!(4) < providerInfo.cardinality(), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); + let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone())); + let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&int!((&senderPublicKeyIndex).clone())); + let mut valueOrError4: Arc, Arc>>; + let mut _out0: Arc, Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::DecompressPublicKey(&providerInfoSenderPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); + valueOrError4 = _out0.clone(); if valueOrError4.IsFailure() { res = MaybePlacebo::from(valueOrError4.PropagateFailure::()); return res.read(); }; - let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &recipientPublicKeyLengthIndex); - let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&senderPublicKeyIndex); + let mut senderPublicKey: Sequence = valueOrError4.Extract(); let mut valueOrError5: Arc, Arc>>; - let mut _out0: Arc, Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::DecompressPublicKey(&providerInfoSenderPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); - valueOrError5 = _out0.clone(); + let mut _out1: Arc, Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::DecompressPublicKey(&providerInfoRecipientPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); + valueOrError5 = _out1.clone(); if valueOrError5.IsFailure() { res = MaybePlacebo::from(valueOrError5.PropagateFailure::()); return res.read(); }; - let mut senderPublicKey: Sequence = valueOrError5.Extract(); - let mut valueOrError6: Arc, Arc>>; - let mut _out1: Arc, Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::DecompressPublicKey(&providerInfoRecipientPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); - valueOrError6 = _out1.clone(); + let mut recipientPublicKey: Sequence = valueOrError5.Extract(); + let mut valueOrError6: Arc>>; + let mut _out2: Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &senderPublicKey); + valueOrError6 = _out2.clone(); if valueOrError6.IsFailure() { res = MaybePlacebo::from(valueOrError6.PropagateFailure::()); return res.read(); }; - let mut recipientPublicKey: Sequence = valueOrError6.Extract(); + let mut _v0: bool = valueOrError6.Extract(); let mut valueOrError7: Arc>>; - let mut _out2: Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &senderPublicKey); - valueOrError7 = _out2.clone(); + let mut _out3: Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &recipientPublicKey); + valueOrError7 = _out3.clone(); if valueOrError7.IsFailure() { res = MaybePlacebo::from(valueOrError7.PropagateFailure::()); return res.read(); }; - let mut _v0: bool = valueOrError7.Extract(); - let mut valueOrError8: Arc>>; - let mut _out3: Arc>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &recipientPublicKey); - valueOrError8 = _out3.clone(); + let mut _v1: bool = valueOrError7.Extract(); + let mut valueOrError8: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&senderPublicKey) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&self.recipientPublicKey().clone()), &_default::E(&string_utf16_of("Received serialized sender public key of incorrect length"))); if valueOrError8.IsFailure() { res = MaybePlacebo::from(valueOrError8.PropagateFailure::()); return res.read(); }; - let mut _v1: bool = valueOrError8.Extract(); - let mut valueOrError9: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&senderPublicKey) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&self.recipientPublicKey().clone()), &_default::E(&string_utf16_of("Received serialized sender public key of incorrect length"))); - if valueOrError9.IsFailure() { - res = MaybePlacebo::from(valueOrError9.PropagateFailure::()); - return res.read(); - }; let mut sharedSecretPublicKey: Sequence; let mut sharedSecretKmsKeyId: Sequence; let mut _source0: Arc = self.keyAgreementScheme().clone(); if matches!((&_source0).as_ref(), KmsPublicKeyDiscovery{ .. }) { let mut ___mcc_h0: Arc = _source0.KmsPublicKeyDiscovery().clone(); let mut kmsPublicKeyDiscovery: Arc = ___mcc_h0.clone(); - let mut valueOrError10: Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPublicKeyDiscovery.recipientKmsIdentifier()); - if valueOrError10.IsFailure() { - res = MaybePlacebo::from(valueOrError10.PropagateFailure::()); + let mut valueOrError9: Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPublicKeyDiscovery.recipientKmsIdentifier()); + if valueOrError9.IsFailure() { + res = MaybePlacebo::from(valueOrError9.PropagateFailure::()); return res.read(); }; - let mut _v2: () = valueOrError10.Extract(); + let mut _v2: () = valueOrError9.Extract(); sharedSecretPublicKey = senderPublicKey.clone(); sharedSecretKmsKeyId = kmsPublicKeyDiscovery.recipientKmsIdentifier().clone(); } else { let mut ___mcc_h1: Arc = _source0.KmsPrivateKeyToStaticPublicKey().clone(); let mut kmsPrivateKeyToStaticPublicKey: Arc = ___mcc_h1.clone(); - let mut valueOrError11: Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier()); - if valueOrError11.IsFailure() { - res = MaybePlacebo::from(valueOrError11.PropagateFailure::()); + let mut valueOrError10: Arc>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier()); + if valueOrError10.IsFailure() { + res = MaybePlacebo::from(valueOrError10.PropagateFailure::()); return res.read(); }; - let mut _v3: () = valueOrError11.Extract(); + let mut _v3: () = valueOrError10.Extract(); sharedSecretKmsKeyId = kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier().clone(); if kmsPrivateKeyToStaticPublicKey.recipientPublicKey().clone() == recipientPublicKey.clone() { sharedSecretPublicKey = recipientPublicKey.clone(); @@ -62123,19 +62197,19 @@ pub mod _AwsKmsEcdhKeyring_Compile { sharedSecretPublicKey = senderPublicKey.clone(); } }; - let mut valueOrError12: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&sharedSecretPublicKey), &_default::E(&string_utf16_of("Received Recipient Public Key of incorrect expected length"))); - if valueOrError12.IsFailure() { - res = MaybePlacebo::from(valueOrError12.PropagateFailure::()); + let mut valueOrError11: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&sharedSecretPublicKey), &_default::E(&string_utf16_of("Received Recipient Public Key of incorrect expected length"))); + if valueOrError11.IsFailure() { + res = MaybePlacebo::from(valueOrError11.PropagateFailure::()); return res.read(); }; - let mut valueOrError13: Arc, Arc>>; + let mut valueOrError12: Arc, Arc>>; let mut _out4: Arc, Arc>> = _default::DeriveSharedSecret(&self.client().clone(), &sharedSecretKmsKeyId, &sharedSecretPublicKey, &self.grantTokens().clone()); - valueOrError13 = _out4.clone(); - if valueOrError13.IsFailure() { - res = MaybePlacebo::from(valueOrError13.PropagateFailure::()); + valueOrError12 = _out4.clone(); + if valueOrError12.IsFailure() { + res = MaybePlacebo::from(valueOrError12.PropagateFailure::()); return res.read(); }; - let mut sharedSecret: Sequence = valueOrError13.Extract(); + let mut sharedSecret: Sequence = valueOrError12.Extract(); let mut ecdhUnwrap: Object; let mut _nw0: Object = EcdhUnwrap::_allocate_object(); EcdhUnwrap::_ctor(&_nw0, &providerInfoSenderPublicKey, &providerInfoRecipientPublicKey, &sharedSecret, &_default::AWS_KMS_ECDH_KEYRING_VERSION(), &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); @@ -62143,18 +62217,18 @@ pub mod _AwsKmsEcdhKeyring_Compile { let mut unwrapOutputRes: Arc>>, Arc>>; let mut _out5: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::>(edk.ciphertext(), &self.materials().clone(), &upcast_object::>>()(ecdhUnwrap.clone())); unwrapOutputRes = _out5.clone(); - let mut valueOrError14: Arc>>, Arc>> = unwrapOutputRes.clone(); - if valueOrError14.IsFailure() { - res = MaybePlacebo::from(valueOrError14.PropagateFailure::()); + let mut valueOrError13: Arc>>, Arc>> = unwrapOutputRes.clone(); + if valueOrError13.IsFailure() { + res = MaybePlacebo::from(valueOrError13.PropagateFailure::()); return res.read(); }; - let mut unwrapOutput: Arc>> = valueOrError14.Extract(); - let mut valueOrError15: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()); - if valueOrError15.IsFailure() { - res = MaybePlacebo::from(valueOrError15.PropagateFailure::()); + let mut unwrapOutput: Arc>> = valueOrError13.Extract(); + let mut valueOrError14: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()); + if valueOrError14.IsFailure() { + res = MaybePlacebo::from(valueOrError14.PropagateFailure::()); return res.read(); }; - let mut result: Arc = valueOrError15.Extract(); + let mut result: Arc = valueOrError14.Extract(); res = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: result.clone() })); @@ -62167,7 +62241,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(620,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(660,3) pub struct OnDecryptEcdhDataKeyFilter { pub __i_keyAgreementScheme: Arc, pub __i_compressedRecipientPublicKey: Sequence, @@ -62179,7 +62253,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(627,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(667,5) pub fn _ctor(this: &Object, keyAgreementScheme: &Arc, compressedRecipientPublicKey: &Sequence, compressedSenderPublicKey: &Arc>>) -> () { let mut _set___i_keyAgreementScheme: bool = false; let mut _set___i_compressedRecipientPublicKey: bool = false; @@ -62194,15 +62268,15 @@ pub mod _AwsKmsEcdhKeyring_Compile { update_field_if_uninit_object!(this, __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, as Default>::default()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(623,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(663,5) pub fn keyAgreementScheme(&self) -> Arc { self.__i_keyAgreementScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(624,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(664,5) pub fn compressedRecipientPublicKey(&self) -> Sequence { self.__i_compressedRecipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(625,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(665,5) pub fn compressedSenderPublicKey(&self) -> Sequence { self.__i_compressedSenderPublicKey.clone() } @@ -62223,7 +62297,7 @@ pub mod _AwsKmsEcdhKeyring_Compile { impl DeterministicAction, Arc>>> for OnDecryptEcdhDataKeyFilter { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(655,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(696,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut providerInfo: Sequence = edk.keyProviderInfo().clone(); @@ -62234,27 +62308,27 @@ pub mod _AwsKmsEcdhKeyring_Compile { })); return res.read(); }; - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerInfo.cardinality() <= int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN()) && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); }; - let mut keyringVersion: u8 = providerInfo.get(&int!(0)); + let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())); let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(seq![keyringVersion] == _default::AWS_KMS_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info."))); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::()); return res.read(); }; - let mut recipientPublicKeyLength: DafnyInt = int!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())))); - let mut recipientPublicKeyLengthIndex: DafnyInt = int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()) + recipientPublicKeyLength.clone(); - let mut senderPublicKeyIndex: DafnyInt = recipientPublicKeyLengthIndex.clone() + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex.clone() + int!(4) < providerInfo.cardinality(), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); + let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()))); + let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64; + let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::()); return res.read(); }; - let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &recipientPublicKeyLengthIndex); - let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&senderPublicKeyIndex); + let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone())); + let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&int!((&senderPublicKeyIndex).clone())); if matches!((&self.keyAgreementScheme().clone()).as_ref(), KmsPublicKeyDiscovery{ .. }) { res = MaybePlacebo::from(Arc::new(Result::>::Success { value: self.compressedRecipientPublicKey().clone() == providerInfoRecipientPublicKey.clone() @@ -62305,10 +62379,8 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdInput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::std::marker::Sync; - pub use ::std::marker::Send; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput; @@ -62317,6 +62389,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::EntryDoesNotExist; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyInput; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::EntryAlreadyExists; @@ -62330,6 +62403,8 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; + pub use ::std::marker::Sync; + pub use ::std::marker::Send; pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput; pub use ::dafny_runtime::upcast_object; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial; @@ -62374,11 +62449,11 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(96,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(97,3) pub fn cacheEntryWithinLimits(creationTime: PositiveLong, now: PositiveLong, ttlSeconds: PositiveLong) -> bool { now - creationTime <= ttlSeconds } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(522,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(549,3) pub fn DeriveEncryptionKeyFromBranchKey(branchKey: &Sequence, salt: &Sequence, purpose: &Arc>>, cryptoPrimitives: &Object) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut maybeDerivedBranchKey: Arc, Arc>>; @@ -62409,33 +62484,33 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(559,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(586,3) pub fn WrappingAad(branchKeyId: &Sequence, branchKeyVersion: &Sequence, aad: &Sequence) -> Sequence { crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID_HIERARCHY().concat(branchKeyId).concat(branchKeyVersion).concat(aad) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1283,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1309,3) pub fn SerializeEDKCiphertext(encOutput: &Arc) -> Sequence { encOutput.cipherText().concat(encOutput.authTag()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1287,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1313,3) pub fn E(s: &Sequence) -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: s.clone() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(75,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(76,3) pub fn AES_256_ENC_KEY_LENGTH() -> i32 { 32 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(76,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(77,3) pub fn AES_256_ENC_TAG_LENGTH() -> i32 { 16 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(77,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(78,3) pub fn AES_256_ENC_IV_LENGTH() -> i32 { 12 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(78,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(79,3) pub fn AES_256_ENC_ALG() -> Arc { Arc::new(AES_GCM::AES_GCM { keyLength: _default::AES_256_ENC_KEY_LENGTH(), @@ -62443,73 +62518,73 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { ivLength: _default::AES_256_ENC_IV_LENGTH() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(72,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(73,3) pub fn H_WRAP_SALT_LEN() -> PositiveInteger { 16 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(73,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(74,3) pub fn H_WRAP_NONCE_LEN() -> PositiveInteger { 12 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(88,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(89,3) pub fn EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX() -> i32 { _default::H_WRAP_SALT_LEN() + _default::H_WRAP_NONCE_LEN() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(87,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(88,3) pub fn EDK_CIPHERTEXT_VERSION_LENGTH() -> i32 { 16 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(89,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(90,3) pub fn EDK_CIPHERTEXT_VERSION_INDEX() -> i32 { _default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX() + _default::EDK_CIPHERTEXT_VERSION_LENGTH() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(91,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(92,3) pub fn EXPECTED_EDK_CIPHERTEXT_OVERHEAD() -> i32 { _default::EDK_CIPHERTEXT_VERSION_INDEX() + _default::AES_256_ENC_TAG_LENGTH() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(74,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(75,3) pub fn DERIVED_BRANCH_KEY_EXPECTED_LENGTH() -> PositiveInteger { 32 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(58,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(59,3) pub fn BRANCH_KEY_STORE_GSI() -> Sequence { string_utf16_of("Active-Keys") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(59,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(60,3) pub fn BRANCH_KEY_FIELD() -> Sequence { string_utf16_of("enc") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(60,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(61,3) pub fn VERSION_FIELD() -> Sequence { string_utf16_of("version") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(61,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(62,3) pub fn BRANCH_KEY_IDENTIFIER_FIELD() -> Sequence { string_utf16_of("branch-key-id") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(63,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(64,3) pub fn KEY_CONDITION_EXPRESSION() -> Sequence { string_utf16_of("#status = :status and #branch_key_id = :branch_key_id") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(64,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(65,3) pub fn EXPRESSION_ATTRIBUTE_NAMES() -> Map, Sequence> { map![(string_utf16_of("#status")) => (string_utf16_of("status")), (string_utf16_of("#branch_key_id")) => (string_utf16_of("branch-key-id"))] } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(68,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(69,3) pub fn EXPRESSION_ATTRIBUTE_VALUE_STATUS_KEY() -> Sequence { string_utf16_of(":status") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(69,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(70,3) pub fn EXPRESSION_ATTRIBUTE_VALUE_STATUS_VALUE() -> Sequence { string_utf16_of("ACTIVE") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(70,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(71,3) pub fn EXPRESSION_ATTRIBUTE_VALUE_BRANCH_KEY() -> Sequence { string_utf16_of(":branch_key_id") } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(108,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(109,3) pub struct AwsKmsHierarchicalKeyring { pub __i_keyStore: Object, pub __i_cryptoPrimitives: Object, @@ -62526,7 +62601,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(140,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(141,5) pub fn _ctor(this: &Object, keyStore: &Object, branchKeyId: &Arc>>, branchKeyIdSupplier: &Arc>>, ttlSeconds: PositiveLong, cmc: &Object, partitionIdBytes: &Sequence, logicalKeyStoreNameBytes: &Sequence, cryptoPrimitives: &Object) -> () { let mut _set___i_keyStore: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -62546,7 +62621,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { update_field_uninit_object!(this.clone(), __i_logicalKeyStoreNameBytes, _set___i_logicalKeyStoreNameBytes, logicalKeyStoreNameBytes.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(193,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(194,5) pub fn GetBranchKeyId(&self, context: &Map) -> Arc, Arc>> { let mut ret = MaybePlacebo::, Arc>>>::new(); if matches!((&self.branchKeyId().clone()).as_ref(), Some{ .. }) { @@ -62572,14 +62647,14 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { }; return ret.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(383,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(412,5) pub fn GetActiveCacheId(&self, branchKeyId: &Sequence, branchKeyIdUtf8: &Sequence, cryptoPrimitives: &Object) -> Arc, Arc>> { let mut cacheId = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>))).as_ref(), Success{ .. }) && ({ - let __pat_let1_0: Sequence = crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)).value().clone(); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(true && ({ + let __pat_let1_0: Arc, Sequence>> = crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8); { - let branchKeyId: Sequence = __pat_let1_0.clone(); - true && (int!(0) <= branchKeyId.cardinality() && branchKeyId.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT()) + let branchKeyId: Arc, Sequence>> = __pat_let1_0.clone(); + matches!((&branchKeyId).as_ref(), Success{ .. }) && (0 <= truncate!(branchKeyId.value().cardinality(), u64) && truncate!(branchKeyId.value().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT(), u64)) } }), &_default::E(&string_utf16_of("Invalid Branch Key ID Length"))); if valueOrError0.IsFailure() { @@ -62609,7 +62684,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { return cacheId.read(); }; let mut cacheDigest: Sequence = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(cacheDigest.cardinality() == crate::implementation_from_dafny::_Digest_Compile::_default::Length(&hashAlgorithm), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(cacheDigest.cardinality(), u64) == crate::implementation_from_dafny::_Digest_Compile::_default::Length(&hashAlgorithm), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Digest generated a message not equal to the expected length.") })); if valueOrError2.IsFailure() { @@ -62621,7 +62696,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { })); return cacheId.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(443,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(474,5) pub fn GetActiveHierarchicalMaterials(&self, branchKeyId: &Sequence, cacheId: &Sequence, keyStore: &Object) -> Arc, Arc>> { let mut material = MaybePlacebo::, Arc>>>::new(); let mut getCacheInput: Arc = Arc::new(GetCacheEntryInput::GetCacheEntryInput { @@ -62693,9 +62768,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { })); return material.read(); } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getCacheOutput.value().materials().as_ref(), BranchKey{ .. }) && getCacheOutput.value().materials().clone() == Arc::new(Materials::BranchKey { - BranchKey: getCacheOutput.value().materials().BranchKey().clone() - }), &_default::E(&string_utf16_of("Invalid Material Type."))); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getCacheOutput.value().materials().as_ref(), BranchKey{ .. }), &_default::E(&string_utf16_of("Invalid Material Type."))); if valueOrError2.IsFailure() { material = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return material.read(); @@ -62707,35 +62780,35 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { }; return material.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(113,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(114,5) pub fn keyStore(&self) -> Object { self.__i_keyStore.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(115,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(116,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(116,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(117,5) pub fn cache(&self) -> Object { self.__i_cache.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(112,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(113,5) pub fn branchKeyIdSupplier(&self) -> Arc>> { self.__i_branchKeyIdSupplier.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(111,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(112,5) pub fn branchKeyId(&self) -> Arc>> { self.__i_branchKeyId.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(114,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(115,5) pub fn ttlSeconds(&self) -> PositiveLong { self.__i_ttlSeconds.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(117,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(118,5) pub fn partitionIdBytes(&self) -> Sequence { self.__i_partitionIdBytes.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(118,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(119,5) pub fn logicalKeyStoreNameBytes(&self) -> Sequence { self.__i_logicalKeyStoreNameBytes.clone() } @@ -62756,7 +62829,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { impl IKeyring for AwsKmsHierarchicalKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(216,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(238,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -62865,7 +62938,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { }; return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(313,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(346,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -62895,7 +62968,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { return res.read(); }; let mut edksToAttempt: Sequence> = valueOrError2.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); @@ -62943,7 +63016,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(580,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(607,3) pub struct OnDecryptHierarchyEncryptedDataKeyFilter { pub __i_branchKeyId: Sequence } @@ -62953,13 +63026,13 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(585,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(612,5) pub fn _ctor(this: &Object, branchKeyId: &Sequence) -> () { let mut _set___i_branchKeyId: bool = false; update_field_uninit_object!(this.clone(), __i_branchKeyId, _set___i_branchKeyId, branchKeyId.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(583,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(610,5) pub fn branchKeyId(&self) -> Sequence { self.__i_branchKeyId.clone() } @@ -62980,7 +63053,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { impl DeterministicAction, Arc>>> for OnDecryptHierarchyEncryptedDataKeyFilter { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(603,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(632,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut providerInfo: Sequence = edk.keyProviderInfo().clone(); @@ -62991,13 +63064,11 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { })); return res.read(); }; - if !crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&providerInfo) { - res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>::Failure { - error: _default::E(&string_utf16_of("Invalid encoding, provider info is not UTF8.")) - })); - return res.read(); - }; - let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(&providerInfo).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); + let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(&providerInfo).MapFailure::>(&({ + Arc::new(move |e: &Sequence| -> Arc{ + _default::E(&string_utf16_of("Invalid encoding, provider info is not UTF8.")) + }) + })); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); @@ -63015,7 +63086,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { UpcastObjectFn!(dyn DeterministicAction, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(633,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(660,3) pub struct DecryptSingleEncryptedDataKey { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_keyStore: Object, @@ -63032,7 +63103,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(648,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(675,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, keyStore: &Object, cryptoPrimitives: &Object, branchKeyId: &Sequence, ttlSeconds: PositiveLong, cache: &Object, partitionIdBytes: &Sequence, logicalKeyStoreNameBytes: &Sequence) -> () { let mut _set___i_materials: bool = false; let mut _set___i_keyStore: bool = false; @@ -63052,14 +63123,14 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { update_field_uninit_object!(this.clone(), __i_logicalKeyStoreNameBytes, _set___i_logicalKeyStoreNameBytes, logicalKeyStoreNameBytes.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(767,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(798,5) pub fn GetVersionCacheId(&self, branchKeyIdUtf8: &Sequence, branchKeyVersion: &Sequence, cryptoPrimitives: &Object) -> Arc, Arc>> { let mut cacheId = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>))).as_ref(), Success{ .. }) && ({ - let __pat_let2_0: Sequence = crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)).value().clone(); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(true && ({ + let __pat_let2_0: Arc, Sequence>> = crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8); { - let branchKeyId: Sequence = __pat_let2_0.clone(); - true && (int!(0) <= branchKeyId.cardinality() && branchKeyId.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT()) + let branchKeyId: Arc, Sequence>> = __pat_let2_0.clone(); + matches!((&branchKeyId).as_ref(), Success{ .. }) && (0 <= truncate!(branchKeyId.value().cardinality(), u64) && truncate!(branchKeyId.value().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT(), u64)) } }), &_default::E(&string_utf16_of("Invalid Branch Key ID Length"))); if valueOrError0.IsFailure() { @@ -63074,7 +63145,18 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { cacheId = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); return cacheId.read(); }; - let mut versionBytes: ValidUTF8Bytes = crate::implementation_from_dafny::UTF8::_default::EncodeAscii(branchKeyVersion); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::UTF8::_default::Encode(branchKeyVersion).MapFailure::>(&({ + Arc::new(move |e: &Sequence| -> Arc{ + Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + message: e.clone() + }) + }) + })); + if valueOrError2.IsFailure() { + cacheId = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); + return cacheId.read(); + }; + let mut versionBytes: ValidUTF8Bytes = valueOrError2.Extract(); let mut suffix: Sequence = self.logicalKeyStoreNameBytes().clone().concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(branchKeyIdUtf8).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&versionBytes); let mut identifier: Sequence = resourceId.concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&scopeId).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&self.partitionIdBytes().clone()).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&suffix); let mut identifierDigestInput: Arc = Arc::new(DigestInput::DigestInput { @@ -63084,31 +63166,24 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { let mut maybeCacheDigest: Arc, Arc>>; let mut _out0: Arc, Arc>> = crate::implementation_from_dafny::_Digest_Compile::_default::Digest(&identifierDigestInput); maybeCacheDigest = _out0.clone(); - let mut valueOrError2: Arc, Arc>> = maybeCacheDigest.MapFailure::>(&({ + let mut valueOrError3: Arc, Arc>> = maybeCacheDigest.MapFailure::>(&({ Arc::new(move |e: &Arc| -> Arc{ Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives { AwsCryptographyPrimitives: e.clone() }) }) })); - if valueOrError2.IsFailure() { - cacheId = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); - return cacheId.read(); - }; - let mut cacheDigest: Sequence = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(cacheDigest.cardinality() == crate::implementation_from_dafny::_Digest_Compile::_default::Length(&hashAlgorithm), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Digest generated a message not equal to the expected length.") - })); if valueOrError3.IsFailure() { cacheId = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); return cacheId.read(); }; + let mut cacheDigest: Sequence = valueOrError3.Extract(); cacheId = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: cacheDigest.clone() })); return cacheId.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(832,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(860,5) pub fn GetHierarchicalMaterialsVersion(&self, branchKeyId: &Sequence, branchKeyIdUtf8: &Sequence, version: &Sequence, cacheId: &Sequence) -> Arc, Arc>> { let mut material = MaybePlacebo::, Arc>>>::new(); let mut getCacheInput: Arc = Arc::new(GetCacheEntryInput::GetCacheEntryInput { @@ -63181,9 +63256,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { })); return material.read(); } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getCacheOutput.value().materials().as_ref(), BranchKey{ .. }) && getCacheOutput.value().materials().clone() == Arc::new(Materials::BranchKey { - BranchKey: getCacheOutput.value().materials().BranchKey().clone() - }), &_default::E(&string_utf16_of("Invalid Material Type."))); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getCacheOutput.value().materials().as_ref(), BranchKey{ .. }), &_default::E(&string_utf16_of("Invalid Material Type."))); if valueOrError2.IsFailure() { material = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return material.read(); @@ -63195,35 +63268,35 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { }; return material.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(639,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(666,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(640,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(667,5) pub fn keyStore(&self) -> Object { self.__i_keyStore.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(641,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(668,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(642,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(669,5) pub fn branchKeyId(&self) -> Sequence { self.__i_branchKeyId.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(643,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(670,5) pub fn ttlSeconds(&self) -> PositiveLong { self.__i_ttlSeconds.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(644,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(671,5) pub fn cache(&self) -> Object { self.__i_cache.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(645,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(672,5) pub fn partitionIdBytes(&self) -> Sequence { self.__i_partitionIdBytes.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(646,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(673,5) pub fn logicalKeyStoreNameBytes(&self) -> Sequence { self.__i_logicalKeyStoreNameBytes.clone() } @@ -63244,85 +63317,78 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { impl Action, Arc>>> for DecryptSingleEncryptedDataKey { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(705,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(736,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Received invalid EDK provider info for Hierarchical Keyring") - })); - if valueOrError0.IsFailure() { - res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); - return res.read(); - }; let mut suite: Arc = self.materials().clone().algorithmSuite().clone(); let mut keyProviderId: ValidUTF8Bytes = edk.keyProviderId().clone(); let mut branchKeyIdUtf8: Sequence = edk.keyProviderInfo().clone(); let mut ciphertext: Sequence = edk.ciphertext().clone(); - let mut valueOrError1: Arc, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite); - if valueOrError1.IsFailure() { - res = MaybePlacebo::from(valueOrError1.PropagateFailure::()); + let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite); + if valueOrError0.IsFailure() { + res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); }; - let mut providerWrappedMaterial: Sequence = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerWrappedMaterial.cardinality() >= int!(_default::EDK_CIPHERTEXT_VERSION_INDEX()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut providerWrappedMaterial: Sequence = valueOrError0.Extract(); + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerWrappedMaterial.cardinality(), u64) >= _default::EDK_CIPHERTEXT_VERSION_INDEX() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Received EDK Ciphertext of incorrect length.") })); + if valueOrError1.IsFailure() { + res = MaybePlacebo::from(valueOrError1.PropagateFailure::()); + return res.read(); + }; + let mut branchKeyVersionUuid: Sequence = providerWrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone()), &int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone())); + let mut valueOrError2: Arc, Arc>> = crate::implementation_from_dafny::UUID::_default::FromByteArray(&branchKeyVersionUuid).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::()); return res.read(); }; - let mut branchKeyVersionUuid: Sequence = providerWrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone()), &int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone())); - let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::UUID::_default::FromByteArray(&branchKeyVersionUuid).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); + let mut version: Sequence = valueOrError2.Extract(); + let mut valueOrError3: Arc, Arc>>; + let mut _out0: Arc, Arc>> = self.GetVersionCacheId(&branchKeyIdUtf8, &version, &self.cryptoPrimitives().clone()); + valueOrError3 = _out0.clone(); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::()); return res.read(); }; - let mut version: Sequence = valueOrError3.Extract(); - let mut valueOrError4: Arc, Arc>>; - let mut _out0: Arc, Arc>> = self.GetVersionCacheId(&branchKeyIdUtf8, &version, &self.cryptoPrimitives().clone()); - valueOrError4 = _out0.clone(); + let mut cacheId: Sequence = valueOrError3.Extract(); + let mut valueOrError4: Arc, Arc>>; + let mut _out1: Arc, Arc>> = self.GetHierarchicalMaterialsVersion(&self.branchKeyId().clone(), &branchKeyIdUtf8, &version, &cacheId); + valueOrError4 = _out1.clone(); if valueOrError4.IsFailure() { res = MaybePlacebo::from(valueOrError4.PropagateFailure::()); return res.read(); }; - let mut cacheId: Sequence = valueOrError4.Extract(); - let mut valueOrError5: Arc, Arc>>; - let mut _out1: Arc, Arc>> = self.GetHierarchicalMaterialsVersion(&self.branchKeyId().clone(), &branchKeyIdUtf8, &version, &cacheId); - valueOrError5 = _out1.clone(); + let mut hierarchicalMaterials: Arc = valueOrError4.Extract(); + let mut branchKey: Sequence = hierarchicalMaterials.branchKey().clone(); + let mut branchKeyVersion: ValidUTF8Bytes = hierarchicalMaterials.branchKeyVersion().clone(); + let mut valueOrError5: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(&branchKeyVersion).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError5.IsFailure() { res = MaybePlacebo::from(valueOrError5.PropagateFailure::()); return res.read(); }; - let mut hierarchicalMaterials: Arc = valueOrError5.Extract(); - let mut branchKey: Sequence = hierarchicalMaterials.branchKey().clone(); - let mut branchKeyVersion: ValidUTF8Bytes = hierarchicalMaterials.branchKeyVersion().clone(); - let mut valueOrError6: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(&branchKeyVersion).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); + let mut branchKeyVersionAsString: Sequence = valueOrError5.Extract(); + let mut valueOrError6: Arc, Arc>> = crate::implementation_from_dafny::UUID::_default::ToByteArray(&branchKeyVersionAsString).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError6.IsFailure() { res = MaybePlacebo::from(valueOrError6.PropagateFailure::()); return res.read(); }; - let mut branchKeyVersionAsString: Sequence = valueOrError6.Extract(); - let mut valueOrError7: Arc, Arc>> = crate::implementation_from_dafny::UUID::_default::ToByteArray(&branchKeyVersionAsString).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); - if valueOrError7.IsFailure() { - res = MaybePlacebo::from(valueOrError7.PropagateFailure::()); - return res.read(); - }; - let mut branchKeyVersionAsBytes: Sequence = valueOrError7.Extract(); + let mut branchKeyVersionAsBytes: Sequence = valueOrError6.Extract(); let mut maybeCrypto: Arc, Arc>>; let mut _out2: Arc, Arc>> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig()); maybeCrypto = _out2.clone(); - let mut valueOrError8: Arc, Arc>> = maybeCrypto.MapFailure::>(&({ + let mut valueOrError7: Arc, Arc>> = maybeCrypto.MapFailure::>(&({ Arc::new(move |e: &Arc| -> Arc{ Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives { AwsCryptographyPrimitives: e.clone() }) }) })); - if valueOrError8.IsFailure() { - res = MaybePlacebo::from(valueOrError8.PropagateFailure::()); + if valueOrError7.IsFailure() { + res = MaybePlacebo::from(valueOrError7.PropagateFailure::()); return res.read(); }; - let mut cryptoPrimitivesX: Object = upcast_object::()(valueOrError8.Extract()); + let mut cryptoPrimitivesX: Object = upcast_object::()(valueOrError7.Extract()); let mut cryptoPrimitives: Object = cast_object!(cryptoPrimitivesX.clone(), AtomicPrimitivesClient); let mut kmsHierarchyUnwrap: Object; let mut _nw0: Object = KmsHierarchyUnwrapKeyMaterial::_allocate_object(); @@ -63331,18 +63397,18 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { let mut unwrapOutputRes: Arc>>, Arc>>; let mut _out3: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::>(edk.ciphertext(), &self.materials().clone(), &upcast_object::>>()(kmsHierarchyUnwrap.clone())); unwrapOutputRes = _out3.clone(); - let mut valueOrError9: Arc>>, Arc>> = unwrapOutputRes.clone(); - if valueOrError9.IsFailure() { - res = MaybePlacebo::from(valueOrError9.PropagateFailure::()); + let mut valueOrError8: Arc>>, Arc>> = unwrapOutputRes.clone(); + if valueOrError8.IsFailure() { + res = MaybePlacebo::from(valueOrError8.PropagateFailure::()); return res.read(); }; - let mut unwrapOutput: Arc>> = valueOrError9.Extract(); - let mut valueOrError10: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()); - if valueOrError10.IsFailure() { - res = MaybePlacebo::from(valueOrError10.PropagateFailure::()); + let mut unwrapOutput: Arc>> = valueOrError8.Extract(); + let mut valueOrError9: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()); + if valueOrError9.IsFailure() { + res = MaybePlacebo::from(valueOrError9.PropagateFailure::()); return res.read(); }; - let mut result: Arc = valueOrError10.Extract(); + let mut result: Arc = valueOrError9.Extract(); res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: result.clone() })); @@ -63355,7 +63421,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(911,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(935,3) #[derive(PartialEq, Clone)] pub enum HierarchyUnwrapInfo { HierarchyUnwrapInfo {} @@ -63417,7 +63483,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(912,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(936,3) #[derive(PartialEq, Clone)] pub enum HierarchyWrapInfo { HierarchyWrapInfo {} @@ -63479,7 +63545,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(914,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(938,3) pub struct KmsHierarchyUnwrapKeyMaterial { pub __i_crypto: Object, pub __i_branchKeyIdUtf8: ValidUTF8Bytes, @@ -63492,7 +63558,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(922,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(946,5) pub fn _ctor(this: &Object, branchKey: &Sequence, branchKeyIdUtf8: &ValidUTF8Bytes, branchKeyVersionAsBytes: &Sequence, crypto: &Object) -> () { let mut _set___i_crypto: bool = false; let mut _set___i_branchKeyIdUtf8: bool = false; @@ -63504,19 +63570,19 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(920,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(944,5) pub fn crypto(&self) -> Object { self.__i_crypto.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(918,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(942,5) pub fn branchKeyIdUtf8(&self) -> ValidUTF8Bytes { self.__i_branchKeyIdUtf8.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(919,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(943,5) pub fn branchKeyVersionAsBytes(&self) -> Sequence { self.__i_branchKeyVersionAsBytes.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(917,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(941,5) pub fn branchKey(&self) -> Sequence { self.__i_branchKey.clone() } @@ -63545,26 +63611,26 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsHierarchyUnwrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(988,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1012,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); let mut wrappedMaterial: Sequence = input.wrappedMaterial().clone(); let mut aad: Map = input.encryptionContext().clone(); let mut KeyLength: i32 = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(wrappedMaterial.cardinality() == int!(_default::EXPECTED_EDK_CIPHERTEXT_OVERHEAD()) + int!(KeyLength), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(wrappedMaterial.cardinality(), u64) == _default::EXPECTED_EDK_CIPHERTEXT_OVERHEAD() as u64 + KeyLength as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Received EDK Ciphertext of incorrect length2.") })); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>>>()); return res.read(); }; - let mut salt: Sequence = wrappedMaterial.slice(&int!(0), &int!((&_default::H_WRAP_SALT_LEN()).clone())); + let mut salt: Sequence = wrappedMaterial.take(&int!((&_default::H_WRAP_SALT_LEN()).clone())); let mut iv: Sequence = wrappedMaterial.slice(&int!((&_default::H_WRAP_SALT_LEN()).clone()), &int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone())); let mut branchKeyVersionUuid: Sequence = wrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone()), &int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone())); let mut wrappedKey: Sequence = wrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone()), &int!((&(_default::EDK_CIPHERTEXT_VERSION_INDEX() + KeyLength)).clone())); let mut authTag: Sequence = wrappedMaterial.drop(&int!((&(_default::EDK_CIPHERTEXT_VERSION_INDEX() + KeyLength)).clone())); - let mut valueOrError1: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext()); + let mut valueOrError1: Arc, Arc>> = input.serializedEC().clone(); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>>>()); return res.read(); @@ -63603,11 +63669,6 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { return res.read(); }; let mut unwrappedPdk: Sequence = valueOrError3.Extract(); - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(unwrappedPdk.cardinality() == int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())), &_default::E(&string_utf16_of("Invalid Key Length"))); - if valueOrError4.IsFailure() { - res = MaybePlacebo::from(valueOrError4.PropagateFailure::>>>()); - return res.read(); - }; let mut output: Arc>> = Arc::new(UnwrapOutput::>::UnwrapOutput { unwrappedMaterial: unwrappedPdk.clone(), unwrapInfo: Arc::new(HierarchyUnwrapInfo::HierarchyUnwrapInfo {}) @@ -63624,7 +63685,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1053,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1076,3) pub struct KmsHierarchyGenerateAndWrapKeyMaterial { pub __i_branchKey: Sequence, pub __i_branchKeyIdUtf8: ValidUTF8Bytes, @@ -63637,7 +63698,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1061,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1084,5) pub fn _ctor(this: &Object, branchKey: &Sequence, branchKeyIdUtf8: &ValidUTF8Bytes, branchKeyVersionAsBytes: &Sequence, crypto: &Object) -> () { let mut _set___i_branchKey: bool = false; let mut _set___i_branchKeyIdUtf8: bool = false; @@ -63649,19 +63710,19 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1056,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1079,5) pub fn branchKey(&self) -> Sequence { self.__i_branchKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1057,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1080,5) pub fn branchKeyIdUtf8(&self) -> ValidUTF8Bytes { self.__i_branchKeyIdUtf8.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1058,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1081,5) pub fn branchKeyVersionAsBytes(&self) -> Sequence { self.__i_branchKeyVersionAsBytes.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1059,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1082,5) pub fn crypto(&self) -> Object { self.__i_crypto.clone() } @@ -63690,7 +63751,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsHierarchyGenerateAndWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1103,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1126,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -63719,7 +63780,8 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { let mut _out1: Arc>>, Arc>> = Action::, Arc>>, Arc>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput { plaintextMaterial: pdk.clone(), algorithmSuite: input.algorithmSuite().clone(), - encryptionContext: input.encryptionContext().clone() + encryptionContext: input.encryptionContext().clone(), + serializedEC: input.serializedEC().clone() })); valueOrError1 = _out1.clone(); if valueOrError1.IsFailure() { @@ -63744,7 +63806,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1143,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1168,3) pub struct KmsHierarchyWrapKeyMaterial { pub __i_branchKey: Sequence, pub __i_branchKeyIdUtf8: ValidUTF8Bytes, @@ -63757,7 +63819,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1151,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1176,5) pub fn _ctor(this: &Object, branchKey: &Sequence, branchKeyIdUtf8: &ValidUTF8Bytes, branchKeyVersionAsBytes: &Sequence, crypto: &Object) -> () { let mut _set___i_branchKey: bool = false; let mut _set___i_branchKeyIdUtf8: bool = false; @@ -63769,19 +63831,19 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1146,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1171,5) pub fn branchKey(&self) -> Sequence { self.__i_branchKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1147,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1172,5) pub fn branchKeyIdUtf8(&self) -> ValidUTF8Bytes { self.__i_branchKeyIdUtf8.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1148,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1173,5) pub fn branchKeyVersionAsBytes(&self) -> Sequence { self.__i_branchKeyVersionAsBytes.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1149,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1174,5) pub fn crypto(&self) -> Object { self.__i_crypto.clone() } @@ -63810,7 +63872,7 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsHierarchyWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1207,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1232,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -63831,9 +63893,9 @@ pub mod _AwsKmsHierarchicalKeyring_Compile { return res.read(); }; let mut saltAndNonce: Sequence = valueOrError0.Extract(); - let mut salt: Sequence = saltAndNonce.slice(&int!(0), &int!((&_default::H_WRAP_SALT_LEN()).clone())); + let mut salt: Sequence = saltAndNonce.take(&int!((&_default::H_WRAP_SALT_LEN()).clone())); let mut nonce: Sequence = saltAndNonce.drop(&int!((&_default::H_WRAP_SALT_LEN()).clone())); - let mut valueOrError1: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext()); + let mut valueOrError1: Arc, Arc>> = input.serializedEC().clone(); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>>>()); return res.read(); @@ -63920,6 +63982,7 @@ pub mod _AwsKmsKeyring_Compile { pub use ::std::marker::Sync; pub use ::std::marker::Send; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey; pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput; @@ -63928,7 +63991,6 @@ pub mod _AwsKmsKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction; @@ -63965,7 +64027,7 @@ pub mod _AwsKmsKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptRequest; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptResponse; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(40,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(41,3) pub struct AwsKmsKeyring { pub __i_client: Object, pub __i_awsKmsKey: Sequence, @@ -63983,7 +64045,7 @@ pub mod _AwsKmsKeyring_Compile { /// # The AWS KMS /// # key identifier MUST be [a valid identifier](aws-kms-key-arn.md#a- /// # valid-aws-kms-identifier). - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(57,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(58,5) pub fn _ctor(this: &Object, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_awsKmsKey: bool = false; @@ -63996,19 +64058,19 @@ pub mod _AwsKmsKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(43,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(44,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(44,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(45,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(46,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(47,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(45,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(46,5) pub fn awsKmsArn(&self) -> Arc { self.__i_awsKmsArn.clone() } @@ -64029,7 +64091,7 @@ pub mod _AwsKmsKeyring_Compile { impl IKeyring for AwsKmsKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(109,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(131,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -64071,7 +64133,7 @@ pub mod _AwsKmsKeyring_Compile { return res.read(); }; let mut providerInfo: ValidUTF8Bytes = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerInfo.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerInfo.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Key ID too long.") })); if valueOrError3.IsFailure() { @@ -64114,7 +64176,7 @@ pub mod _AwsKmsKeyring_Compile { }; return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(392,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(426,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -64131,19 +64193,19 @@ pub mod _AwsKmsKeyring_Compile { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); return res.read(); }; - let mut filter: Object; + let mut filter: Object, bool, Arc>>; let mut _nw0: Object = OnDecryptEncryptedDataKeyFilter::_allocate_object(); OnDecryptEncryptedDataKeyFilter::_ctor(&_nw0, &self.awsKmsKey().clone()); - filter = _nw0.clone(); + filter = upcast_object::, bool, Arc>>()(_nw0.clone()); let mut valueOrError2: Arc>, Arc>>; - let mut _out0: Arc>, Arc>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::, Arc>(&upcast_object::, bool, Arc>>()(filter.clone()), input.encryptedDataKeys()); + let mut _out0: Arc>, Arc>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::, Arc>(&filter, input.encryptedDataKeys()); valueOrError2 = _out0.clone(); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return res.read(); }; let mut edksToAttempt: Sequence> = valueOrError2.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); @@ -64191,7 +64253,7 @@ pub mod _AwsKmsKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(557,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(592,3) pub struct OnDecryptEncryptedDataKeyFilter { pub __i_awsKmsKey: Sequence } @@ -64201,13 +64263,13 @@ pub mod _AwsKmsKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(562,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(597,5) pub fn _ctor(this: &Object, awsKmsKey: &Sequence) -> () { let mut _set___i_awsKmsKey: bool = false; update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(560,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(595,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } @@ -64228,7 +64290,7 @@ pub mod _AwsKmsKeyring_Compile { impl DeterministicAction, Arc>>> for OnDecryptEncryptedDataKeyFilter { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(577,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(612,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); if edk.keyProviderId().clone() != crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID() { @@ -64269,7 +64331,7 @@ pub mod _AwsKmsKeyring_Compile { UpcastObjectFn!(dyn DeterministicAction, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(608,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(643,3) pub struct DecryptSingleEncryptedDataKey { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_client: Object, @@ -64282,7 +64344,7 @@ pub mod _AwsKmsKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(619,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(654,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_materials: bool = false; let mut _set___i_client: bool = false; @@ -64294,19 +64356,19 @@ pub mod _AwsKmsKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(614,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(649,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(615,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(650,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(616,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(651,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(617,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(652,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -64327,7 +64389,7 @@ pub mod _AwsKmsKeyring_Compile { impl Action, Arc>>> for DecryptSingleEncryptedDataKey { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(683,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(722,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut kmsUnwrap: Object; @@ -64361,7 +64423,7 @@ pub mod _AwsKmsKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(717,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(756,3) #[derive(PartialEq, Clone)] pub enum KmsUnwrapInfo { KmsUnwrapInfo {} @@ -64423,7 +64485,7 @@ pub mod _AwsKmsKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(719,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(758,3) #[derive(PartialEq, Clone)] pub enum KmsWrapInfo { KmsWrapInfo { @@ -64491,7 +64553,7 @@ pub mod _AwsKmsKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(723,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(762,3) pub struct KmsUnwrapKeyMaterial { pub __i_client: Object, pub __i_grantTokens: GrantTokenList, @@ -64503,7 +64565,7 @@ pub mod _AwsKmsKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(730,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(769,5) pub fn _ctor(this: &Object, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_grantTokens: bool = false; @@ -64513,15 +64575,15 @@ pub mod _AwsKmsKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(726,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(765,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(728,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(767,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(727,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(766,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } @@ -64550,7 +64612,7 @@ pub mod _AwsKmsKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsUnwrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(784,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(823,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(input.wrappedMaterial()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -64596,7 +64658,7 @@ pub mod _AwsKmsKeyring_Compile { return res.read(); }; let mut decryptResponse: Arc = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(decryptResponse.KeyId().as_ref(), Some{ .. }) && decryptResponse.KeyId().value().clone() == self.awsKmsKey().clone() && matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }) && int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())) == decryptResponse.Plaintext().value().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(decryptResponse.KeyId().as_ref(), Some{ .. }) && decryptResponse.KeyId().value().clone() == self.awsKmsKey().clone() && matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }) && crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64 == truncate!(decryptResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid response from KMS Decrypt") })); if valueOrError3.IsFailure() { @@ -64619,7 +64681,7 @@ pub mod _AwsKmsKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(827,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(867,3) pub struct KmsGenerateAndWrapKeyMaterial { pub __i_client: Object, pub __i_awsKmsKey: Sequence, @@ -64631,7 +64693,7 @@ pub mod _AwsKmsKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(834,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(874,5) pub fn _ctor(this: &Object, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_awsKmsKey: bool = false; @@ -64641,15 +64703,15 @@ pub mod _AwsKmsKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(830,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(870,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(831,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(871,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(832,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(872,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -64678,7 +64740,7 @@ pub mod _AwsKmsKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsGenerateAndWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(898,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(938,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -64725,7 +64787,7 @@ pub mod _AwsKmsKeyring_Compile { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>>>()); return res.read(); }; - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(generateResponse.Plaintext().as_ref(), Some{ .. }) && int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)) == generateResponse.Plaintext().value().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(generateResponse.Plaintext().as_ref(), Some{ .. }) && crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(generateResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Invalid data key") })); if valueOrError3.IsFailure() { @@ -64765,7 +64827,7 @@ pub mod _AwsKmsKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(973,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1014,3) pub struct KmsWrapKeyMaterial { pub __i_client: Object, pub __i_awsKmsKey: Sequence, @@ -64777,7 +64839,7 @@ pub mod _AwsKmsKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(980,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1021,5) pub fn _ctor(this: &Object, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_awsKmsKey: bool = false; @@ -64787,15 +64849,15 @@ pub mod _AwsKmsKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(976,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1017,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(977,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1018,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(978,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1019,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -64824,7 +64886,7 @@ pub mod _AwsKmsKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1039,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1080,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -64909,10 +64971,11 @@ pub mod _AwsKmsMrkAreUnique_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; pub use ::std::marker::Sync; pub use ::std::marker::Send; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::DafnyCharUTF16; pub use ::dafny_runtime::Set; pub use ::dafny_runtime::SetBuilder; + pub use ::dafny_runtime::int; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier::AwsKmsArnIdentifier; pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn; @@ -64921,15 +64984,15 @@ pub mod _AwsKmsMrkAreUnique_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(17,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(19,3) pub fn AwsKmsMrkAreUnique(identifiers: &Sequence>) -> Arc>> { let mut mrks: Sequence> = crate::implementation_from_dafny::_Seq_Compile::_default::Filter::>(&(Arc::new(move |x0: &Arc| crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsIdentifier(x0)) as Arc _ + Sync + Send>), identifiers); - if mrks.cardinality() == int!(0) { + if truncate!(mrks.cardinality(), u64) == 0 { Arc::new(Outcome::>::Pass {}) } else { let mut mrkKeyIds: Sequence> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::, Sequence>(&(Arc::new(move |x0: &Arc| _default::GetKeyId(x0)) as Arc _ + Sync + Send>), &mrks); let mut setMrks: Set> = crate::implementation_from_dafny::_Seq_Compile::_default::ToSet::>(&mrkKeyIds); - if mrkKeyIds.cardinality() == setMrks.cardinality() { + if truncate!(mrkKeyIds.cardinality(), u64) == truncate!(setMrks.cardinality(), u64) { Arc::new(Outcome::>::Pass {}) } else { let mut duplicateMrkIds: Set> = (&({ @@ -64961,7 +65024,7 @@ pub mod _AwsKmsMrkAreUnique_Compile { }; let mut duplicateIdentifiers: Sequence> = crate::implementation_from_dafny::_Seq_Compile::_default::Filter::>(&isDuplicate, identifiers); let mut duplicates: Sequence> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::, Sequence>(&identifierToString, &duplicateIdentifiers); - if duplicates.cardinality() == int!(0) { + if truncate!(duplicates.cardinality(), u64) == 0 { Arc::new(Outcome::>::Fail { error: Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Impossible") @@ -64977,7 +65040,7 @@ pub mod _AwsKmsMrkAreUnique_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(49,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(54,3) pub fn GetKeyId(identifier: &Arc) -> Sequence { let mut _source0: Arc = identifier.clone(); if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) { @@ -65027,7 +65090,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { pub use crate::implementation_from_dafny::_Constants_Compile::AwsKmsEdkHelper; pub use ::dafny_runtime::upcast_object; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; @@ -65043,7 +65106,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(514,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(558,3) pub fn ToStringForRegion(arn: &AwsKmsArn, region: &Sequence) -> Sequence { if crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsArn(arn) { AwsArn::ToArnString(arn, &Arc::new(Option::>::Some { @@ -65053,7 +65116,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { AwsArn::ToString(arn) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(537,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(581,3) pub fn DiscoveryMatch(arn: &AwsKmsArn, discoveryFilter: &Arc>>, region: &Sequence) -> bool { (&({ let mut arn = arn.clone(); @@ -65074,7 +65137,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(35,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(36,3) pub struct AwsKmsMrkDiscoveryKeyring { pub __i_client: Object, pub __i_region: Sequence, @@ -65087,7 +65150,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(59,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(60,5) pub fn _ctor(this: &Object, client: &Object, region: &Sequence, discoveryFilter: &Arc>>, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_region: bool = false; @@ -65099,19 +65162,19 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(42,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(43,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(45,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(46,5) pub fn region(&self) -> Sequence { self.__i_region.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(43,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(44,5) pub fn discoveryFilter(&self) -> Arc>> { self.__i_discoveryFilter.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(44,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(45,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -65132,7 +65195,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { impl IKeyring for AwsKmsMrkDiscoveryKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(89,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(111,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>> = Arc::new(Result::, Arc>::Failure { error: Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -65141,7 +65204,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { }); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(115,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(154,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -65166,7 +65229,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { return output.read(); }; let mut edksToAttempt: Sequence> = valueOrError1.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError2: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError2.IsFailure() { output = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); @@ -65215,7 +65278,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(308,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(348,3) pub struct AwsKmsEncryptedDataKeyFilterTransform { pub __i_region: Sequence, pub __i_discoveryFilter: Arc>> @@ -65226,7 +65289,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(317,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(357,5) pub fn _ctor(this: &Object, region: &Sequence, discoveryFilter: &Arc>>) -> () { let mut _set___i_region: bool = false; let mut _set___i_discoveryFilter: bool = false; @@ -65234,11 +65297,11 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { update_field_uninit_object!(this.clone(), __i_discoveryFilter, _set___i_discoveryFilter, discoveryFilter.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(315,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(355,5) pub fn region(&self) -> Sequence { self.__i_region.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(316,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(356,5) pub fn discoveryFilter(&self) -> Arc>> { self.__i_discoveryFilter.clone() } @@ -65259,7 +65322,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { impl DeterministicAction, Arc>, Arc>>> for AwsKmsEncryptedDataKeyFilterTransform { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(349,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(389,5) fn Invoke(&self, edk: &Arc) -> Arc>, Arc>> { let mut res = MaybePlacebo::>, Arc>>>::new(); if edk.keyProviderId().clone() != crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID() { @@ -65327,7 +65390,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { UpcastObjectFn!(dyn DeterministicAction, Arc>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(390,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(430,3) pub struct AwsKmsEncryptedDataKeyDecryptor { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_client: Object, @@ -65340,7 +65403,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(401,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(441,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object, region: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_materials: bool = false; let mut _set___i_client: bool = false; @@ -65352,19 +65415,19 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(396,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(436,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(397,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(437,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(398,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(438,5) pub fn region(&self) -> Sequence { self.__i_region.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(399,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(439,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -65385,7 +65448,7 @@ pub mod _AwsKmsMrkDiscoveryKeyring_Compile { impl Action, Arc>>> for AwsKmsEncryptedDataKeyDecryptor { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(478,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(522,5) fn Invoke(&self, helper: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut awsKmsKey: Sequence = _default::ToStringForRegion(helper.arn(), &self.region().clone()); @@ -65456,6 +65519,7 @@ pub mod _AwsKmsMrkKeyring_Compile { pub use ::std::marker::Sync; pub use ::std::marker::Send; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey; pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput; @@ -65465,7 +65529,6 @@ pub mod _AwsKmsMrkKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; pub use crate::implementation_from_dafny::_AwsKmsUtils_Compile::OnDecryptMrkAwareEncryptedDataKeyFilter; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey; @@ -65475,7 +65538,7 @@ pub mod _AwsKmsMrkKeyring_Compile { pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapInfo; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(39,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(40,3) pub struct AwsKmsMrkKeyring { pub __i_client: Object, pub __i_awsKmsKey: Sequence, @@ -65494,7 +65557,7 @@ pub mod _AwsKmsMrkKeyring_Compile { /// # The AWS KMS /// # key identifier MUST be [a valid identifier](aws-kms-key-arn.md#a- /// # valid-aws-kms-identifier). - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(57,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(58,5) pub fn _ctor(this: &Object, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_awsKmsKey: bool = false; @@ -65507,19 +65570,19 @@ pub mod _AwsKmsMrkKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(43,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(44,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(44,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(45,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(46,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(47,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(45,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(46,5) pub fn awsKmsArn(&self) -> Arc { self.__i_awsKmsArn.clone() } @@ -65540,7 +65603,7 @@ pub mod _AwsKmsMrkKeyring_Compile { impl IKeyring for AwsKmsMrkKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(97,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(119,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -65582,7 +65645,7 @@ pub mod _AwsKmsMrkKeyring_Compile { return output.read(); }; let mut providerInfo: ValidUTF8Bytes = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerInfo.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerInfo.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Key ID too long.") })); if valueOrError3.IsFailure() { @@ -65625,7 +65688,7 @@ pub mod _AwsKmsMrkKeyring_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(398,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(432,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -65654,7 +65717,7 @@ pub mod _AwsKmsMrkKeyring_Compile { return output.read(); }; let mut edksToAttempt: Sequence> = valueOrError2.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError3.IsFailure() { output = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); @@ -65702,7 +65765,7 @@ pub mod _AwsKmsMrkKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(533,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(568,3) pub struct DecryptSingleEncryptedDataKey { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_client: Object, @@ -65715,7 +65778,7 @@ pub mod _AwsKmsMrkKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(544,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(579,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object, awsKmsKey: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_materials: bool = false; let mut _set___i_client: bool = false; @@ -65727,19 +65790,19 @@ pub mod _AwsKmsMrkKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(539,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(574,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(540,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(575,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(541,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(576,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(542,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(577,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -65760,7 +65823,7 @@ pub mod _AwsKmsMrkKeyring_Compile { impl Action, Arc>>> for DecryptSingleEncryptedDataKey { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(609,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(648,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut kmsUnwrap: Object; @@ -65872,7 +65935,7 @@ pub mod _AwsKmsRsaKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None; pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput; @@ -65917,11 +65980,12 @@ pub mod _AwsKmsRsaKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptRequest; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse; + pub use ::dafny_runtime::int; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(277,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(318,3) pub fn EncryptionContextDigest(cryptoPrimitives: &Object, encryptionContext: &Map) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext); @@ -65954,13 +66018,13 @@ pub mod _AwsKmsRsaKeyring_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(40,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(41,3) pub fn MIN_KMS_RSA_KEY_LEN() -> RSAModulusLengthBits { 2048 } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(42,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(43,3) pub struct AwsKmsRsaKeyring { pub __i_cryptoPrimitives: Object, pub __i_client: Arc>>, @@ -65976,7 +66040,7 @@ pub mod _AwsKmsRsaKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(76,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(77,5) pub fn _ctor(this: &Object, publicKey: &Arc>>, awsKmsKey: &Sequence, paddingScheme: &Arc, client: &Arc>>, cryptoPrimitives: &Object, grantTokens: &GrantTokenList) -> () { let mut _set___i_cryptoPrimitives: bool = false; let mut _set___i_client: bool = false; @@ -65995,31 +66059,31 @@ pub mod _AwsKmsRsaKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(51,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(52,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(45,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(46,5) pub fn client(&self) -> Arc>> { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(49,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(50,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(47,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(48,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(50,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(51,5) pub fn publicKey(&self) -> Arc>> { self.__i_publicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(48,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(49,5) pub fn awsKmsArn(&self) -> Arc { self.__i_awsKmsArn.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(46,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(47,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -66040,10 +66104,10 @@ pub mod _AwsKmsRsaKeyring_Compile { impl IKeyring for AwsKmsRsaKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(115,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(137,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.publicKey().clone()).as_ref(), Some{ .. }) && int!(0) < self.publicKey().clone().Extract().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.publicKey().clone()).as_ref(), Some{ .. }) && 0 < truncate!(self.publicKey().clone().Extract().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("A AwsKmsRsaKeyring without a public key cannot provide OnEncrypt") })); if valueOrError0.IsFailure() { @@ -66111,7 +66175,7 @@ pub mod _AwsKmsRsaKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(190,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(230,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.client().clone()).as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -66153,7 +66217,7 @@ pub mod _AwsKmsRsaKeyring_Compile { return res.read(); }; let mut edksToAttempt: Sequence> = valueOrError4.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError5: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError5.IsFailure() { res = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); @@ -66209,7 +66273,7 @@ pub mod _AwsKmsRsaKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(304,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(345,3) pub struct DecryptSingleAWSRSAEncryptedDataKey { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_client: Object, @@ -66224,7 +66288,7 @@ pub mod _AwsKmsRsaKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(317,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(358,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object, awsKmsKey: &Sequence, paddingScheme: &Arc, encryptionContextDigest: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_materials: bool = false; let mut _set___i_client: bool = false; @@ -66240,27 +66304,27 @@ pub mod _AwsKmsRsaKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(310,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(351,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(311,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(352,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(312,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(353,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(313,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(354,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(314,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(355,5) pub fn encryptionContextDigest(&self) -> Sequence { self.__i_encryptionContextDigest.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(315,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(356,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } @@ -66281,7 +66345,7 @@ pub mod _AwsKmsRsaKeyring_Compile { impl Action, Arc>>> for DecryptSingleAWSRSAEncryptedDataKey { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(385,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(430,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut unwrap: Object; @@ -66314,7 +66378,7 @@ pub mod _AwsKmsRsaKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(413,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(458,3) #[derive(PartialEq, Clone)] pub enum KmsRsaUnwrapInfo { KmsRsaUnwrapInfo {} @@ -66376,7 +66440,7 @@ pub mod _AwsKmsRsaKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(415,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(460,3) #[derive(PartialEq, Clone)] pub enum KmsRsaWrapInfo { KmsRsaWrapInfo {} @@ -66438,7 +66502,7 @@ pub mod _AwsKmsRsaKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(417,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(462,3) pub struct KmsRsaGenerateAndWrapKeyMaterial { pub __i_publicKey: Sequence, pub __i_cryptoPrimitives: Object, @@ -66450,7 +66514,7 @@ pub mod _AwsKmsRsaKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(424,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(469,5) pub fn _ctor(this: &Object, publicKey: &Sequence, paddingScheme: &Arc, cryptoPrimitives: &Object) -> () { let mut _set___i_publicKey: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -66460,15 +66524,15 @@ pub mod _AwsKmsRsaKeyring_Compile { update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(420,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(465,5) pub fn publicKey(&self) -> Sequence { self.__i_publicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(422,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(467,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(421,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(466,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } @@ -66497,7 +66561,7 @@ pub mod _AwsKmsRsaKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsRsaGenerateAndWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(461,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(506,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut generateBytesResult: Arc, Arc>>; @@ -66525,7 +66589,8 @@ pub mod _AwsKmsRsaKeyring_Compile { let mut _out1: Arc>>, Arc>> = Action::, Arc>>, Arc>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput { plaintextMaterial: plaintextMaterial.clone(), algorithmSuite: input.algorithmSuite().clone(), - encryptionContext: input.encryptionContext().clone() + encryptionContext: input.encryptionContext().clone(), + serializedEC: input.serializedEC().clone() })); valueOrError1 = _out1.clone(); if valueOrError1.IsFailure() { @@ -66550,7 +66615,7 @@ pub mod _AwsKmsRsaKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(498,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(544,3) pub struct KmsRsaWrapKeyMaterial { pub __i_publicKey: Sequence, pub __i_cryptoPrimitives: Object, @@ -66562,7 +66627,7 @@ pub mod _AwsKmsRsaKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(505,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(551,5) pub fn _ctor(this: &Object, publicKey: &Sequence, paddingScheme: &Arc, cryptoPrimitives: &Object) -> () { let mut _set___i_publicKey: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -66572,15 +66637,15 @@ pub mod _AwsKmsRsaKeyring_Compile { update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(501,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(547,5) pub fn publicKey(&self) -> Sequence { self.__i_publicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(503,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(549,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(502,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(548,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } @@ -66609,7 +66674,7 @@ pub mod _AwsKmsRsaKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsRsaWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(542,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(588,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut valueOrError0: Arc, Arc>>; @@ -66662,7 +66727,7 @@ pub mod _AwsKmsRsaKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(576,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(622,3) pub struct KmsRsaUnwrapKeyMaterial { pub __i_client: Object, pub __i_grantTokens: GrantTokenList, @@ -66676,7 +66741,7 @@ pub mod _AwsKmsRsaKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(585,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(631,5) pub fn _ctor(this: &Object, client: &Object, awsKmsKey: &Sequence, paddingScheme: &Arc, encryptionContextDigest: &Sequence, grantTokens: &GrantTokenList) -> () { let mut _set___i_client: bool = false; let mut _set___i_grantTokens: bool = false; @@ -66690,23 +66755,23 @@ pub mod _AwsKmsRsaKeyring_Compile { update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(579,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(625,5) pub fn client(&self) -> Object { self.__i_client.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(583,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(629,5) pub fn grantTokens(&self) -> GrantTokenList { self.__i_grantTokens.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(580,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(626,5) pub fn awsKmsKey(&self) -> Sequence { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(581,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(627,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(582,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(628,5) pub fn encryptionContextDigest(&self) -> Sequence { self.__i_encryptionContextDigest.clone() } @@ -66735,7 +66800,7 @@ pub mod _AwsKmsRsaKeyring_Compile { impl Action, Arc>>, Arc>>> for KmsRsaUnwrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(644,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(690,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(input.wrappedMaterial()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -66782,7 +66847,7 @@ pub mod _AwsKmsRsaKeyring_Compile { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>>>()); return res.read(); }; - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(self.encryptionContextDigest().clone() <= decryptResponse.Plaintext().value().clone() && int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())) + self.encryptionContextDigest().clone().cardinality() == decryptResponse.Plaintext().value().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(self.encryptionContextDigest().clone() <= decryptResponse.Plaintext().value().clone() && crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64 + truncate!(self.encryptionContextDigest().clone().cardinality(), u64) == truncate!(decryptResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Encryption context digest does not match expected value.") })); if valueOrError3.IsFailure() { @@ -66790,7 +66855,7 @@ pub mod _AwsKmsRsaKeyring_Compile { return res.read(); }; let mut output: Arc>> = Arc::new(UnwrapOutput::>::UnwrapOutput { - unwrappedMaterial: decryptResponse.Plaintext().value().drop(&self.encryptionContextDigest().clone().cardinality()), + unwrappedMaterial: decryptResponse.Plaintext().value().drop(&int!((&truncate!((&self.encryptionContextDigest().clone().cardinality()).clone(), u64)).clone())), unwrapInfo: Arc::new(KmsRsaUnwrapInfo::KmsRsaUnwrapInfo {}) }); res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>>, Arc>::Success { @@ -66817,7 +66882,7 @@ pub mod _AwsKmsUtils_Compile { pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::map; pub use ::dafny_runtime::MapBuilder; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure; @@ -66850,7 +66915,7 @@ pub mod _AwsKmsUtils_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(19,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(20,3) pub fn OkForDecrypt(id: &Arc, arn: &Sequence) -> Arc>> { if !matches!(id.as_ref(), AwsKmsArnIdentifier{ .. }) { Arc::new(Outcome::>::Fail { @@ -66870,9 +66935,9 @@ pub mod _AwsKmsUtils_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(29,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(30,3) pub fn StringifyEncryptionContext(utf8EncCtx: &Map) -> Arc, Sequence>, Arc>> { - if utf8EncCtx.cardinality() == int!(0) { + if truncate!(utf8EncCtx.cardinality(), u64) == 0 { Arc::new(Result::, Sequence>, Arc>::Success { value: map![] }) @@ -66948,7 +67013,7 @@ pub mod _AwsKmsUtils_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(49,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(51,3) pub fn StringifyEncryptionContextPair(utf8Key: &ValidUTF8Bytes, utf8Value: &ValidUTF8Bytes) -> Arc, Sequence), Arc>> { let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(utf8Key).MapFailure::>(&(Arc::new(move |x0: &Sequence| _default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError0.IsFailure() { @@ -66969,13 +67034,13 @@ pub mod _AwsKmsUtils_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(63,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(65,3) pub fn WrapStringToError(e: &Sequence) -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: e.clone() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(69,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(71,3) pub fn ValidateKmsKeyId(keyId: &Sequence) -> Arc>> { let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(keyId).MapFailure::>(&(Arc::new(move |x0: &Sequence| _default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError0.IsFailure() { @@ -66988,7 +67053,7 @@ pub mod _AwsKmsUtils_Compile { if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::<()>() } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < keyId.cardinality() && keyId.cardinality() <= crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::MAX_AWS_KMS_IDENTIFIER_LENGTH(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(keyId.cardinality(), u64) && truncate!(keyId.cardinality(), u64) <= crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::MAX_AWS_KMS_IDENTIFIER_LENGTH(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Key identifier is too long") })); if valueOrError2.IsFailure() { @@ -67001,10 +67066,10 @@ pub mod _AwsKmsUtils_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(87,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(90,3) pub fn GetValidGrantTokens(grantTokens: &Arc>>>) -> Arc>, Arc>> { let mut tokens: Sequence> = grantTokens.UnwrapOr(&(seq![] as Sequence>)); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) <= tokens.cardinality() && tokens.cardinality() <= int!(10), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 <= truncate!(tokens.cardinality(), u64) && truncate!(tokens.cardinality(), u64) <= 10, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Grant token list can have no more than 10 tokens") })); if valueOrError0.IsFailure() { @@ -67014,7 +67079,7 @@ pub mod _AwsKmsUtils_Compile { let mut tokens = tokens.clone(); Arc::new(move |__forall_var_0: Sequence| -> bool{ let mut token: Sequence = __forall_var_0.clone(); - !tokens.contains(&token) || int!(1) <= token.cardinality() && token.cardinality() <= int!(8192) + !tokens.contains(&token) || 1 <= truncate!(token.cardinality(), u64) && truncate!(token.cardinality(), u64) <= 8192 }) }).as_ref()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Grant token list contains a grant token with invalid length") @@ -67028,7 +67093,7 @@ pub mod _AwsKmsUtils_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(105,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(110,3) pub fn GetEcdhPublicKey(client: &Object, awsKmsKey: &Sequence) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut getPublicKeyRequest: Arc = Arc::new(GetPublicKeyRequest::GetPublicKeyRequest { @@ -67062,7 +67127,7 @@ pub mod _AwsKmsUtils_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(154,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(159,3) pub fn ParseKeyNamespaceAndName(keyNamespace: &Sequence, keyName: &Sequence) -> Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::UTF8::_default::Encode(keyNamespace).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ @@ -67075,7 +67140,7 @@ pub mod _AwsKmsUtils_Compile { valueOrError0.PropagateFailure::<(ValidUTF8Bytes, ValidUTF8Bytes)>() } else { let mut namespace: ValidUTF8Bytes = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(namespace.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(namespace.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Key namespace too long") })); if valueOrError1.IsFailure() { @@ -67092,7 +67157,7 @@ pub mod _AwsKmsUtils_Compile { valueOrError2.PropagateFailure::<(ValidUTF8Bytes, ValidUTF8Bytes)>() } else { let mut name: ValidUTF8Bytes = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(name.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(name.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Key name too long") })); if valueOrError3.IsFailure() { @@ -67109,9 +67174,9 @@ pub mod _AwsKmsUtils_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(178,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(185,3) pub fn ValidateDiscoveryFilter(filter: &Arc) -> Arc>> { - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < filter.accountIds().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(filter.accountIds().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Discovery filter must have at least one account ID") })); if valueOrError0.IsFailure() { @@ -67121,7 +67186,7 @@ pub mod _AwsKmsUtils_Compile { let mut filter = filter.clone(); Arc::new(move |__forall_var_0: Sequence| -> bool{ let mut accountId: Sequence = __forall_var_0.clone(); - !filter.accountIds().contains(&accountId) || int!(0) < accountId.cardinality() + !filter.accountIds().contains(&accountId) || 0 < truncate!(accountId.cardinality(), u64) }) }).as_ref()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Discovery filter account IDs cannot be blank") @@ -67129,7 +67194,7 @@ pub mod _AwsKmsUtils_Compile { if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::<()>() } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < filter.partition().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(filter.partition().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Discovery filter partition cannot be blank") })); if valueOrError2.IsFailure() { @@ -67144,7 +67209,7 @@ pub mod _AwsKmsUtils_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(197,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(207,3) pub struct OnDecryptMrkAwareEncryptedDataKeyFilter { pub __i_awsKmsKey: Arc, pub __i_providerId: ValidUTF8Bytes @@ -67155,7 +67220,7 @@ pub mod _AwsKmsUtils_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(205,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(215,5) pub fn _ctor(this: &Object, awsKmsKey: &Arc, providerId: &ValidUTF8Bytes) -> () { let mut _set___i_awsKmsKey: bool = false; let mut _set___i_providerId: bool = false; @@ -67163,11 +67228,11 @@ pub mod _AwsKmsUtils_Compile { update_field_uninit_object!(this.clone(), __i_providerId, _set___i_providerId, providerId.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(200,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(210,5) pub fn awsKmsKey(&self) -> Arc { self.__i_awsKmsKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(201,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(211,5) pub fn providerId(&self) -> ValidUTF8Bytes { self.__i_providerId.clone() } @@ -67188,7 +67253,7 @@ pub mod _AwsKmsUtils_Compile { impl DeterministicAction, Arc>>> for OnDecryptMrkAwareEncryptedDataKeyFilter { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(229,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(239,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); if edk.keyProviderId().clone() != self.providerId().clone() { @@ -67235,17 +67300,16 @@ pub mod _AwsKmsUtils_Compile { pub mod _Base64_Compile { pub use ::dafny_runtime::DafnyCharUTF16; pub use ::dafny_runtime::Sequence; - pub use ::dafny_runtime::euclidian_modulo; + pub use ::std::default::Default; + pub use ::dafny_runtime::truncate; + pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use ::dafny_runtime::int; - pub use ::dafny_runtime::itertools::Itertools; - pub use ::std::sync::Arc; - pub use ::dafny_runtime::NumCast; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::integer_range; - pub use ::dafny_runtime::Zero; + pub use ::dafny_runtime::MaybePlacebo; + pub use ::std::sync::Arc; pub use ::dafny_runtime::string_utf16_of; - pub use ::std::default::Default; + pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::DafnyPrint; pub use ::std::fmt::Formatter; pub use ::std::ops::Deref; @@ -67263,21 +67327,29 @@ pub mod _Base64_Compile { pub struct _default {} impl _default { - /// ../mpl/StandardLibrary/src/Base64.dfy(20,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(21,3) pub fn IsBase64Char(c: &DafnyCharUTF16) -> bool { c.clone() == DafnyCharUTF16(43 as u16) || c.clone() == DafnyCharUTF16(47 as u16) || DafnyCharUTF16(48 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(57 as u16) || DafnyCharUTF16(65 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(90 as u16) || DafnyCharUTF16(97 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(122 as u16) } - /// ../mpl/StandardLibrary/src/Base64.dfy(26,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(27,3) pub fn IsUnpaddedBase64String(s: &Sequence) -> bool { - euclidian_modulo(s.cardinality(), int!(4)) == int!(0) && Itertools::unique(s.iter()).all(({ - let mut s = s.clone(); - Arc::new(move |__forall_var_0: DafnyCharUTF16| -> bool{ - let mut k: DafnyCharUTF16 = __forall_var_0.clone(); - !s.contains(&k) || _default::IsBase64Char(&k) - }) - }).as_ref()) + let mut _hresult: bool = ::default(); + let mut size: u64 = truncate!(s.cardinality(), u64); + if size % 4 != 0 { + _hresult = false; + return _hresult; + }; + let mut _hi0: u64 = size; + for i in integer_range(0, _hi0).map(Into::::into) { + if !_default::IsBase64Char(&s.get(&int!((&i).clone()))) { + _hresult = false; + return _hresult; + } + } + _hresult = true; + return _hresult; } - /// ../mpl/StandardLibrary/src/Base64.dfy(31,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(46,3) pub fn IndexToChar(i: u8) -> DafnyCharUTF16 { if i == 63 { DafnyCharUTF16(47 as u16) @@ -67289,15 +67361,15 @@ pub mod _Base64_Compile { DafnyCharUTF16((i - 4) as u16) } else { if 26 <= i && i <= 51 { - DafnyCharUTF16(i as u16) + DafnyCharUTF16(::from(int!(71)).unwrap()) + DafnyCharUTF16((i + 71) as u16) } else { - DafnyCharUTF16(i as u16) + DafnyCharUTF16(::from(int!(65)).unwrap()) + DafnyCharUTF16((i + 65) as u16) } } } } } - /// ../mpl/StandardLibrary/src/Base64.dfy(47,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(62,3) pub fn CharToIndex(c: &DafnyCharUTF16) -> u8 { if c.clone() == DafnyCharUTF16(47 as u16) { 63 @@ -67306,18 +67378,18 @@ pub mod _Base64_Compile { 62 } else { if DafnyCharUTF16(48 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(57 as u16) { - (c.clone() + DafnyCharUTF16(::from(int!(4)).unwrap())).0 as u8 + c.clone().0 as u8 + 4 } else { if DafnyCharUTF16(97 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(122 as u16) { - (c.clone() - DafnyCharUTF16(::from(int!(71)).unwrap())).0 as u8 + c.clone().0 as u8 - 71 } else { - (c.clone() - DafnyCharUTF16(::from(int!(65)).unwrap())).0 as u8 + c.clone().0 as u8 - 65 } } } } } - /// ../mpl/StandardLibrary/src/Base64.dfy(68,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(83,3) pub fn UInt24ToSeq(x: u32) -> Sequence { let mut b0: u8 = (x / 65536) as u8; let mut x0: u32 = x - b0 as u32 * 65536; @@ -67325,11 +67397,15 @@ pub mod _Base64_Compile { let mut b2: u8 = (x0 % 256) as u8; seq![b0, b1, b2] } - /// ../mpl/StandardLibrary/src/Base64.dfy(80,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(95,3) pub fn SeqToUInt24(s: &Sequence) -> u32 { - s.get(&int!(0)) as u32 * 65536 + s.get(&int!(1)) as u32 * 256 + s.get(&int!(2)) as u32 + s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u32 * 65536 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u32 * 256 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u32 + } + /// ../mpl/StandardLibrary/src/Base64.dfy(102,3) + pub fn SeqPosToUInt24(s: &Sequence, pos: u64) -> u32 { + s.get(&int!((&pos).clone())) as u32 * 65536 + s.get(&int!((&(pos + 1)).clone())) as u32 * 256 + s.get(&int!((&(pos + 2)).clone())) as u32 } - /// ../mpl/StandardLibrary/src/Base64.dfy(96,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(119,3) pub fn UInt24ToIndexSeq(x: u32) -> Sequence { let mut b0: u8 = (x / 262144) as u8; let mut x0: u32 = x - b0 as u32 * 262144; @@ -67339,130 +67415,127 @@ pub mod _Base64_Compile { let mut b3: u8 = (x1 % 64) as u8; seq![b0, b1, b2, b3] } - /// ../mpl/StandardLibrary/src/Base64.dfy(114,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(137,3) pub fn IndexSeqToUInt24(s: &Sequence) -> u32 { - s.get(&int!(0)) as u32 * 262144 + s.get(&int!(1)) as u32 * 4096 + s.get(&int!(2)) as u32 * 64 + s.get(&int!(3)) as u32 + s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u32 * 262144 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u32 * 4096 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u32 * 64 + s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) as u32 } - /// ../mpl/StandardLibrary/src/Base64.dfy(130,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(144,3) + pub fn IndexSeqPosToUInt24(s: &Sequence, pos: u64) -> u32 { + s.get(&int!((&pos).clone())) as u32 * 262144 + s.get(&int!((&(pos + 1)).clone())) as u32 * 4096 + s.get(&int!((&(pos + 2)).clone())) as u32 * 64 + s.get(&int!((&(pos + 3)).clone())) as u32 + } + /// ../mpl/StandardLibrary/src/Base64.dfy(161,3) pub fn DecodeBlock(s: &Sequence) -> Sequence { _default::UInt24ToSeq(_default::IndexSeqToUInt24(s)) } - /// ../mpl/StandardLibrary/src/Base64.dfy(138,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(169,3) + pub fn DecodeBlockPos(s: &Sequence, pos: u64) -> Sequence { + _default::UInt24ToSeq(_default::IndexSeqPosToUInt24(s, pos)) + } + /// ../mpl/StandardLibrary/src/Base64.dfy(178,3) pub fn EncodeBlock(s: &Sequence) -> Sequence { _default::UInt24ToIndexSeq(_default::SeqToUInt24(s)) } - /// ../mpl/StandardLibrary/src/Base64.dfy(157,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(187,3) + pub fn EncodeBlockPos(s: &Sequence, pos: u64) -> Sequence { + _default::UInt24ToIndexSeq(_default::SeqPosToUInt24(s, pos)) + } + /// ../mpl/StandardLibrary/src/Base64.dfy(206,3) pub fn DecodeRecursively(s: &Sequence) -> Sequence { - let mut _accumulator: Sequence = seq![] as Sequence; - let mut _r0 = s.clone(); - 'TAIL_CALL_START: loop { - let s = _r0; - if s.cardinality() == int!(0) { - return _accumulator.concat(&(seq![] as Sequence)); - } else { - _accumulator = _accumulator.concat(&_default::DecodeBlock(&s.take(&int!(4)))); - let mut _in0: Sequence = s.drop(&int!(4)); - _r0 = _in0.clone(); - continue 'TAIL_CALL_START; - } - } + let mut b = MaybePlacebo::>::new(); + let mut i: u64 = truncate!(s.cardinality(), u64); + let mut result: Sequence = seq![] as Sequence; + while 0 < i { + result = _default::DecodeBlockPos(s, i - 4).concat(&result); + i = i - 4; + }; + b = MaybePlacebo::from(result.clone()); + return b.read(); } - /// ../mpl/StandardLibrary/src/Base64.dfy(169,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(232,3) pub fn EncodeRecursively(b: &Sequence) -> Sequence { - let mut _accumulator: Sequence = seq![] as Sequence; - let mut _r0 = b.clone(); - 'TAIL_CALL_START: loop { - let b = _r0; - if b.cardinality() == int!(0) { - return _accumulator.concat(&(seq![] as Sequence)); - } else { - _accumulator = _accumulator.concat(&_default::EncodeBlock(&b.take(&int!(3)))); - let mut _in0: Sequence = b.drop(&int!(3)); - _r0 = _in0.clone(); - continue 'TAIL_CALL_START; - } - } + let mut s = MaybePlacebo::>::new(); + let mut i: u64 = truncate!(b.cardinality(), u64); + let mut result: Sequence = seq![] as Sequence; + while 0 < i { + result = _default::EncodeBlockPos(b, i - 3).concat(&result); + i = i - 3; + }; + s = MaybePlacebo::from(result.clone()); + return s.read(); } - /// ../mpl/StandardLibrary/src/Base64.dfy(189,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(266,3) pub fn FromCharsToIndices(s: &Sequence) -> Sequence { - { - let _initializer = { - let s: Sequence = s.clone(); - { - let mut s = s.clone(); - Arc::new(move |i: &DafnyInt| -> u8{ - _default::CharToIndex(&s.get(i)) - }) - } - }; - integer_range(Zero::zero(), s.cardinality()).map(move |i| _initializer(&i)).collect::>() + let mut b = MaybePlacebo::>::new(); + let mut result: Sequence = seq![] as Sequence; + let mut _hi0: u64 = truncate!(s.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + result = result.concat(&seq![_default::CharToIndex(&s.get(&int!((&i).clone())))]); } + b = MaybePlacebo::from(result.clone()); + return b.read(); } - /// ../mpl/StandardLibrary/src/Base64.dfy(197,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(284,3) pub fn FromIndicesToChars(b: &Sequence) -> Sequence { - { - let _initializer = { - let b: Sequence = b.clone(); - { - let mut b = b.clone(); - Arc::new(move |i: &DafnyInt| -> DafnyCharUTF16{ - _default::IndexToChar(b.get(i)) - }) - } - }; - integer_range(Zero::zero(), b.cardinality()).map(move |i| _initializer(&i)).collect::>() + let mut s = MaybePlacebo::>::new(); + let mut result: Sequence = seq![] as Sequence; + let mut _hi0: u64 = truncate!(b.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + result = result.concat(&seq![_default::IndexToChar(b.get(&int!((&i).clone())))]); } + s = MaybePlacebo::from(result.clone()); + return s.read(); } - /// ../mpl/StandardLibrary/src/Base64.dfy(215,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(311,3) pub fn DecodeUnpadded(s: &Sequence) -> Sequence { _default::DecodeRecursively(&_default::FromCharsToIndices(s)) } - /// ../mpl/StandardLibrary/src/Base64.dfy(223,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(319,3) pub fn EncodeUnpadded(b: &Sequence) -> Sequence { _default::FromIndicesToChars(&_default::EncodeRecursively(b)) } - /// ../mpl/StandardLibrary/src/Base64.dfy(263,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(359,3) pub fn Is1Padding(s: &Sequence) -> bool { - s.cardinality() == int!(4) && _default::IsBase64Char(&s.get(&int!(0))) && _default::IsBase64Char(&s.get(&int!(1))) && _default::IsBase64Char(&s.get(&int!(2))) && _default::CharToIndex(&s.get(&int!(2))) % 4 == 0 && s.get(&int!(3)) == DafnyCharUTF16(61 as u16) + truncate!(s.cardinality(), u64) == 4 && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))) && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))) && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))) && _default::CharToIndex(&s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))) % 4 == 0 && s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) == DafnyCharUTF16(61 as u16) } - /// ../mpl/StandardLibrary/src/Base64.dfy(273,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(370,3) pub fn Decode1Padding(s: &Sequence) -> Sequence { - let mut d: Sequence = _default::DecodeBlock(&seq![_default::CharToIndex(&s.get(&int!(0))), _default::CharToIndex(&s.get(&int!(1))), _default::CharToIndex(&s.get(&int!(2))), 0]); - seq![d.get(&int!(0)), d.get(&int!(1))] + let mut d: Sequence = _default::DecodeBlock(&seq![_default::CharToIndex(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::CharToIndex(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), _default::CharToIndex(&s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))), 0]); + seq![d.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), d.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))] } - /// ../mpl/StandardLibrary/src/Base64.dfy(282,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(379,3) pub fn Encode1Padding(b: &Sequence) -> Sequence { - let mut e: Sequence = _default::EncodeBlock(&seq![b.get(&int!(0)), b.get(&int!(1)), 0]); - seq![_default::IndexToChar(e.get(&int!(0))), _default::IndexToChar(e.get(&int!(1))), _default::IndexToChar(e.get(&int!(2))), DafnyCharUTF16(61 as u16)] + let mut e: Sequence = _default::EncodeBlock(&seq![b.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), b.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), 0]); + seq![_default::IndexToChar(e.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::IndexToChar(e.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), _default::IndexToChar(e.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))), DafnyCharUTF16(61 as u16)] } - /// ../mpl/StandardLibrary/src/Base64.dfy(303,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(400,3) pub fn Is2Padding(s: &Sequence) -> bool { - s.cardinality() == int!(4) && _default::IsBase64Char(&s.get(&int!(0))) && _default::IsBase64Char(&s.get(&int!(1))) && _default::CharToIndex(&s.get(&int!(1))) % 16 == 0 && s.get(&int!(2)) == DafnyCharUTF16(61 as u16) && s.get(&int!(3)) == DafnyCharUTF16(61 as u16) + truncate!(s.cardinality(), u64) == 4 && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))) && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))) && _default::CharToIndex(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))) % 16 == 0 && s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) == DafnyCharUTF16(61 as u16) && s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) == DafnyCharUTF16(61 as u16) } - /// ../mpl/StandardLibrary/src/Base64.dfy(313,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(411,3) pub fn Decode2Padding(s: &Sequence) -> Sequence { - let mut d: Sequence = _default::DecodeBlock(&seq![_default::CharToIndex(&s.get(&int!(0))), _default::CharToIndex(&s.get(&int!(1))), 0, 0]); - seq![d.get(&int!(0))] + let mut d: Sequence = _default::DecodeBlock(&seq![_default::CharToIndex(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::CharToIndex(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), 0, 0]); + seq![d.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))] } /// Padding with 2 = implies the sequence represents 1 bytes - /// ../mpl/StandardLibrary/src/Base64.dfy(322,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(420,3) pub fn Encode2Padding(b: &Sequence) -> Sequence { - let mut e: Sequence = _default::EncodeBlock(&seq![b.get(&int!(0)), 0, 0]); - seq![_default::IndexToChar(e.get(&int!(0))), _default::IndexToChar(e.get(&int!(1))), DafnyCharUTF16(61 as u16), DafnyCharUTF16(61 as u16)] + let mut e: Sequence = _default::EncodeBlock(&seq![b.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), 0, 0]); + seq![_default::IndexToChar(e.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::IndexToChar(e.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), DafnyCharUTF16(61 as u16), DafnyCharUTF16(61 as u16)] } - /// ../mpl/StandardLibrary/src/Base64.dfy(344,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(442,3) pub fn IsBase64String(s: &Sequence) -> bool { - let mut finalBlockStart: DafnyInt = s.cardinality() - int!(4); - euclidian_modulo(s.cardinality(), int!(4)) == int!(0) && (_default::IsUnpaddedBase64String(s) || _default::IsUnpaddedBase64String(&s.take(&finalBlockStart)) && (_default::Is1Padding(&s.drop(&finalBlockStart)) || _default::Is2Padding(&s.drop(&finalBlockStart)))) + let mut size: u64 = truncate!(s.cardinality(), u64); + size % 4 == 0 && (_default::IsUnpaddedBase64String(s) || _default::IsUnpaddedBase64String(&s.take(&int!((&(size - 4)).clone()))) && (_default::Is1Padding(&s.drop(&int!((&(size - 4)).clone()))) || _default::Is2Padding(&s.drop(&int!((&(size - 4)).clone()))))) } - /// ../mpl/StandardLibrary/src/Base64.dfy(352,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(451,3) pub fn DecodeValid(s: &Sequence) -> Sequence { - if s.clone().to_array().len() == 0 { + let mut size: u64 = truncate!(s.cardinality(), u64); + if size == 0 { seq![] as Sequence } else { - let mut finalBlockStart: DafnyInt = s.cardinality() - int!(4); - let mut prefix: Sequence = s.take(&finalBlockStart); - let mut suffix: Sequence = s.drop(&finalBlockStart); + let mut finalBlockStart: u64 = size - 4; + let mut prefix: Sequence = s.take(&int!((&finalBlockStart).clone())); + let mut suffix: Sequence = s.drop(&int!((&finalBlockStart).clone())); if _default::Is1Padding(&suffix) { _default::DecodeUnpadded(&prefix).concat(&_default::Decode1Padding(&suffix)) } else { @@ -67474,7 +67547,7 @@ pub mod _Base64_Compile { } } } - /// ../mpl/StandardLibrary/src/Base64.dfy(403,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(504,3) pub fn Decode(s: &Sequence) -> Arc, Sequence>> { if _default::IsBase64String(s) { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Sequence>::Success { @@ -67486,20 +67559,22 @@ pub mod _Base64_Compile { }) } } - /// ../mpl/StandardLibrary/src/Base64.dfy(421,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(522,3) pub fn Encode(b: &Sequence) -> Sequence { - if euclidian_modulo(b.cardinality(), int!(3)) == int!(0) { + let mut size: u64 = truncate!(b.cardinality(), u64); + let mut r#mod: u64 = size % 3; + if r#mod == 0 { let mut s: Sequence = _default::EncodeUnpadded(b); s.clone() } else { - if euclidian_modulo(b.cardinality(), int!(3)) == int!(1) { - let mut s1: Sequence = _default::EncodeUnpadded(&b.take(&(b.cardinality() - int!(1)))); - let mut s2: Sequence = _default::Encode2Padding(&b.drop(&(b.cardinality() - int!(1)))); + if r#mod == 1 { + let mut s1: Sequence = _default::EncodeUnpadded(&b.take(&int!((&(size - 1)).clone()))); + let mut s2: Sequence = _default::Encode2Padding(&b.drop(&int!((&(size - 1)).clone()))); let mut s: Sequence = s1.concat(&s2); s.clone() } else { - let mut s1: Sequence = _default::EncodeUnpadded(&b.take(&(b.cardinality() - int!(2)))); - let mut s2: Sequence = _default::Encode1Padding(&b.drop(&(b.cardinality() - int!(2)))); + let mut s1: Sequence = _default::EncodeUnpadded(&b.take(&int!((&(size - 2)).clone()))); + let mut s2: Sequence = _default::Encode1Padding(&b.drop(&int!((&(size - 2)).clone()))); let mut s: Sequence = s1.concat(&s2); s.clone() } @@ -67507,7 +67582,7 @@ pub mod _Base64_Compile { } } - /// ../mpl/StandardLibrary/src/Base64.dfy(15,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(16,3) #[derive(Clone, PartialEq, Copy)] #[repr(transparent)] pub struct index(pub u8); @@ -67599,7 +67674,7 @@ pub mod _Base64_Compile { } } - /// ../mpl/StandardLibrary/src/Base64.dfy(18,3) + /// ../mpl/StandardLibrary/src/Base64.dfy(19,3) #[derive(Clone, PartialEq, Copy)] #[repr(transparent)] pub struct uint24(pub u32); @@ -69058,7 +69133,7 @@ pub mod _CMM_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(60,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(76,3) pub fn _RequiredEncryptionContextKeys_q(requiredEncryptionContextKeys: &Arc>>, encryptionMaterials: &Arc) -> bool { Itertools::unique((&requiredEncryptionContextKeys.UnwrapOr(&(seq![] as Sequence))).iter()).all(({ let mut encryptionMaterials = encryptionMaterials.clone(); @@ -69076,27 +69151,27 @@ pub mod _CMM_Compile { }) }).as_ref()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(65,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(81,3) pub fn EncryptionContextComplete(input: &Arc, decryptionMaterials: &Arc) -> bool { let mut reproducedEncryptionContext: Map = input.reproducedEncryptionContext().UnwrapOr(&map![]); - (&reproducedEncryptionContext.keys()).iter().all(({ + (&reproducedEncryptionContext).keys().iter().all(({ let mut decryptionMaterials = decryptionMaterials.clone(); let mut reproducedEncryptionContext = reproducedEncryptionContext.clone(); Arc::new(move |__forall_var_0: &ValidUTF8Bytes| -> bool{ let mut k: Sequence = __forall_var_0.clone(); - !reproducedEncryptionContext.keys().contains(&k) || decryptionMaterials.encryptionContext().contains(&k) && decryptionMaterials.encryptionContext().get(&k) == reproducedEncryptionContext.get(&k) + !reproducedEncryptionContext.contains(&k) || decryptionMaterials.encryptionContext().contains(&k) && decryptionMaterials.encryptionContext().get(&k) == reproducedEncryptionContext.get(&k) }) }).as_ref()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(73,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(89,3) pub fn _ReproducedEncryptionContext_q(input: &Arc) -> bool { let mut reproducedEncryptionContext: Map = input.reproducedEncryptionContext().UnwrapOr(&map![]); - (&reproducedEncryptionContext.keys()).iter().all(({ + (&reproducedEncryptionContext).keys().iter().all(({ let mut reproducedEncryptionContext = reproducedEncryptionContext.clone(); let mut input = input.clone(); Arc::new(move |__forall_var_0: &ValidUTF8Bytes| -> bool{ let mut k: Sequence = __forall_var_0.clone(); - !(reproducedEncryptionContext.keys().contains(&k) && input.encryptionContext().contains(&k)) || input.encryptionContext().get(&k) == reproducedEncryptionContext.get(&k) + !(reproducedEncryptionContext.contains(&k) && input.encryptionContext().contains(&k)) || input.encryptionContext().get(&k) == reproducedEncryptionContext.get(&k) }) }).as_ref()) } @@ -69148,26 +69223,25 @@ pub mod _CanonicalEncryptionContext_Compile { pub use ::dafny_runtime::Sequence; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use ::std::marker::Sync; pub use ::std::marker::Send; - pub use ::dafny_runtime::int; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::truncate; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CanonicalEncryptionContext.dfy(22,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CanonicalEncryptionContext.dfy(23,3) pub fn EncryptionContextToAAD(encryptionContext: &Map) -> Arc, Arc>> { - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(encryptionContext.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(encryptionContext.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Encryption Context is too large") })); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() } else { let mut keys: Sequence> = crate::implementation_from_dafny::SortedSets::_default::SetToOrderedSequence2::(&encryptionContext.keys(), &(Arc::new(move |x0: &u8,x1: &u8| crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt8Less(x0.clone(), x1.clone())) as Arc _ + Sync + Send>)); - if keys.cardinality() == int!(0) { + if truncate!(keys.cardinality(), u16) == 0 { Arc::new(Result::, Arc>::Success { value: seq![] as Sequence }) @@ -69303,9 +69377,6 @@ pub mod ConcurrentCall { } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(7,1) pub mod _Constants_Compile { - pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::int; - pub use ::dafny_runtime::truncate; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; @@ -69333,12 +69404,12 @@ pub mod _Constants_Compile { 1 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(29,3) - pub fn ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN() -> DafnyInt { - int!(4) + pub fn ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN() -> u64 { + 4 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(28,3) pub fn ECDH_PROVIDER_INFO_RPK_INDEX() -> u32 { - _default::ECDH_PROVIDER_INFO_RPL_INDEX() + truncate!(_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(), u32) + _default::ECDH_PROVIDER_INFO_RPL_INDEX() + _default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN() as u32 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(39,3) pub fn ECDH_AES_256_ENC_KEY_LENGTH() -> i32 { @@ -69366,8 +69437,8 @@ pub mod _Constants_Compile { s.clone() } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(14,3) - pub fn UINT32_TO_SEQ_LEN() -> DafnyInt { - int!(4) + pub fn UINT32_TO_SEQ_LEN() -> u64 { + 4 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(15,3) pub fn KDF_SALT_LEN() -> i32 { @@ -69378,16 +69449,16 @@ pub mod _Constants_Compile { 64 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(17,3) - pub fn ECDH_COMMITMENT_KEY_LENGTH() -> DafnyInt { - int!(32) + pub fn ECDH_COMMITMENT_KEY_LENGTH() -> u64 { + 32 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(18,3) - pub fn ECDH_COMMITMENT_KEY_INDEX() -> DafnyInt { - int!(32) + pub fn ECDH_COMMITMENT_KEY_INDEX() -> u64 { + 32 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(19,3) - pub fn ECDH_WRAPPED_KEY_MATERIAL_INDEX() -> DafnyInt { - int!(64) + pub fn ECDH_WRAPPED_KEY_MATERIAL_INDEX() -> u64 { + 64 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(20,3) pub fn ECDH_KDF_STRING() -> Sequence { @@ -69398,7 +69469,7 @@ pub mod _Constants_Compile { string_utf16_of("HMAC_SHA384") } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(22,3) - pub fn ECDH_KDF_DELIMETER() -> Sequence { + pub fn ECDH_KDF_DELIMITER() -> Sequence { seq![0] } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(24,3) @@ -69414,32 +69485,32 @@ pub mod _Constants_Compile { 143 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(30,3) - pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_256() -> DafnyInt { - int!(91) + pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_256() -> u64 { + 91 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(31,3) - pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_384() -> DafnyInt { - int!(120) + pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_384() -> u64 { + 120 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(32,3) - pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_521() -> DafnyInt { - int!(158) + pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_521() -> u64 { + 158 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(34,3) - pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_256() -> DafnyInt { - int!(33) + pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_256() -> u64 { + 33 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(35,3) - pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_384() -> DafnyInt { - int!(49) + pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_384() -> u64 { + 49 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(36,3) - pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_521() -> DafnyInt { - int!(67) + pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_521() -> u64 { + 67 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(38,3) - pub fn CIPHERTEXT_WRAPPED_MATERIAL_INDEX() -> DafnyInt { - int!(68) + pub fn CIPHERTEXT_WRAPPED_MATERIAL_INDEX() -> u64 { + 68 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(58,3) pub fn PROVIDER_ID_HIERARCHY() -> ValidUTF8Bytes { @@ -69453,26 +69524,30 @@ pub mod _Constants_Compile { } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(71,3) pub fn KMS_ECDH_PROVIDER_ID() -> ValidUTF8Bytes { - crate::implementation_from_dafny::UTF8::_default::EncodeAscii(&string_utf16_of("aws-kms-ecdh")) + let mut s: Sequence = seq![97, 119, 115, 45, 107, 109, 115, 45, 101, 99, 100, 104]; + s.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(74,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(77,3) pub fn RAW_ECDH_PROVIDER_ID() -> ValidUTF8Bytes { - crate::implementation_from_dafny::UTF8::_default::EncodeAscii(&string_utf16_of("raw-ecdh")) + let mut s: Sequence = seq![114, 97, 119, 45, 101, 99, 100, 104]; + s.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(77,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(83,3) pub fn ECDH_KDF_PRF_NAME() -> ValidUTF8Bytes { - crate::implementation_from_dafny::UTF8::_default::EncodeAscii(&string_utf16_of("HMAC_SHA384")) + let mut s: Sequence = seq![72, 77, 65, 67, 95, 83, 72, 65, 51, 56, 52]; + s.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(80,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(89,3) pub fn ECDH_KDF_UTF8() -> ValidUTF8Bytes { - crate::implementation_from_dafny::UTF8::_default::EncodeAscii(&string_utf16_of("ecdh-key-derivation")) + let mut s: Sequence = seq![101, 99, 100, 104, 45, 107, 101, 121, 45, 100, 101, 114, 105, 118, 97, 116, 105, 111, 110]; + s.clone() } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(82,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(94,3) pub type AwsKmsEncryptedDataKey = Arc; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(94,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(106,3) #[derive(PartialEq, Clone)] pub enum AwsKmsEdkHelper { AwsKmsEdkHelper { @@ -69880,7 +69955,7 @@ pub mod _DDBKeystoreOperations_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemOutput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItem; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionCheck; @@ -69902,7 +69977,7 @@ pub mod _DDBKeystoreOperations_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(29,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(30,3) pub fn WriteNewKeyToStore(versionBranchKeyItem: &VersionBranchKeyItem, activeBranchKeyItem: &ActiveBranchKeyItem, beaconKeyItem: &BeaconKeyItem, tableName: &Sequence, ddbClient: &Object) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut items: TransactWriteItemList = seq![_default::CreateTransactWritePutItem(versionBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {})), _default::CreateTransactWritePutItem(activeBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {})), _default::CreateTransactWritePutItem(beaconKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {}))]; @@ -69932,7 +70007,7 @@ pub mod _DDBKeystoreOperations_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(91,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(92,3) pub fn WriteNewBranchKeyVersionToKeystore(versionBranchKeyItem: &VersionBranchKeyItem, activeBranchKeyItem: &ActiveBranchKeyItem, tableName: &Sequence, ddbClient: &Object) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut items: TransactWriteItemList = seq![_default::CreateTransactWritePutItem(versionBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {})), _default::CreateTransactWritePutItem(activeBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_EXISTS {}))]; @@ -69962,7 +70037,7 @@ pub mod _DDBKeystoreOperations_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(145,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(146,3) pub fn GetActiveBranchKeyItem(branchKeyIdentifier: &Sequence, tableName: &Sequence, ddbClient: &Object) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); let mut dynamoDbKey: Map, Arc> = map![(crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (Arc::new(AttributeValue::S { @@ -69994,7 +70069,7 @@ pub mod _DDBKeystoreOperations_Compile { return output.read(); }; let mut getItemResponse: Arc = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && getItemResponse.Item().value().cardinality() >= int!(1), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && truncate!(getItemResponse.Item().value().cardinality(), u64) >= 1, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::NO_CORRESPONDING_BRANCH_KEY() })); if valueOrError1.IsFailure() { @@ -70013,7 +70088,7 @@ pub mod _DDBKeystoreOperations_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(213,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(215,3) pub fn GetVersionBranchKeyItem(branchKeyIdentifier: &Sequence, branchKeyVersion: &Sequence, tableName: &Sequence, ddbClient: &Object) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); let mut dynamoDbKey: Map, Arc> = map![(crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (Arc::new(AttributeValue::S { @@ -70045,7 +70120,7 @@ pub mod _DDBKeystoreOperations_Compile { return output.read(); }; let mut getItemResponse: Arc = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && getItemResponse.Item().value().cardinality() >= int!(1), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && truncate!(getItemResponse.Item().value().cardinality(), u64) >= 1, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::NO_CORRESPONDING_BRANCH_KEY() })); if valueOrError1.IsFailure() { @@ -70064,7 +70139,7 @@ pub mod _DDBKeystoreOperations_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(281,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(284,3) pub fn GetBeaconKeyItem(branchKeyIdentifier: &Sequence, tableName: &Sequence, ddbClient: &Object) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); let mut dynamoDbKey: Map, Arc> = map![(crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (Arc::new(AttributeValue::S { @@ -70096,7 +70171,7 @@ pub mod _DDBKeystoreOperations_Compile { return output.read(); }; let mut getItemResponse: Arc = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && getItemResponse.Item().value().cardinality() >= int!(1), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && truncate!(getItemResponse.Item().value().cardinality(), u64) >= 1, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::NO_CORRESPONDING_BRANCH_KEY() })); if valueOrError1.IsFailure() { @@ -70115,7 +70190,7 @@ pub mod _DDBKeystoreOperations_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(350,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(354,3) pub fn CreateTransactWritePutItem(item: &Map, Arc>, tableName: &Sequence, conditionExpression: &Arc) -> Arc { Arc::new(TransactWriteItem::TransactWriteItem { ConditionCheck: Arc::new(Option::>::None {}), @@ -70145,25 +70220,25 @@ pub mod _DDBKeystoreOperations_Compile { Update: Arc::new(Option::>::None {}) }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(17,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(18,3) pub fn BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME() -> Sequence { string_utf16_of("#BranchKeyIdentifierField") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(18,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(19,3) pub fn BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAMES() -> Map, Sequence> { map![(_default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME()) => (crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD())] } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(22,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(23,3) pub fn BRANCH_KEY_NOT_EXIST_CONDITION() -> Sequence { string_utf16_of("attribute_not_exists(").concat(&_default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME()).concat(&string_utf16_of(")")) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(23,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(24,3) pub fn BRANCH_KEY_EXISTS_CONDITION() -> Sequence { string_utf16_of("attribute_exists(").concat(&_default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME()).concat(&string_utf16_of(")")) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(25,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(26,3) #[derive(PartialEq, Clone)] pub enum ConditionExpression { BRANCH_KEY_NOT_EXIST {}, @@ -70273,7 +70348,7 @@ pub mod DafnyLibraries { fn Size(&self) -> DafnyInt; } } -/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(11,1) +/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(13,1) pub mod _DefaultCMM_Compile { pub use ::dafny_runtime::Object; pub use ::dafny_runtime::allocate_object; @@ -70308,10 +70383,11 @@ pub mod _DefaultCMM_Compile { pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput; + pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput; pub use ::dafny_runtime::Set; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput; @@ -70319,7 +70395,7 @@ pub mod _DefaultCMM_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(28,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(33,3) pub struct DefaultCMM { pub __i_keyring: Object, pub __i_cryptoPrimitives: Object @@ -70330,7 +70406,7 @@ pub mod _DefaultCMM_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(47,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(52,5) pub fn OfKeyring(this: &Object, k: &Object, c: &Object) -> () { let mut _set___i_keyring: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -70338,11 +70414,11 @@ pub mod _DefaultCMM_Compile { update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, c.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(45,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(50,5) pub fn keyring(&self) -> Object { self.__i_keyring.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(31,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(36,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } @@ -70363,7 +70439,7 @@ pub mod _DefaultCMM_Compile { impl ICryptographicMaterialsManager for DefaultCMM { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(90,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(107,5) fn _GetEncryptionMaterials_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(!input.encryptionContext().contains(&crate::implementation_from_dafny::_Materials_Compile::_default::EC_PUBLIC_KEY_FIELD()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { @@ -70440,26 +70516,31 @@ pub mod _DefaultCMM_Compile { let mut encryptionMaterialsOutput: Arc = Arc::new(GetEncryptionMaterialsOutput::GetEncryptionMaterialsOutput { encryptionMaterials: result.materials().clone() }); - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(encryptionMaterialsOutput.encryptionMaterials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Could not retrieve materials required for encryption") - })); - if valueOrError5.IsFailure() { - output = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); - return output.read(); - }; - let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(&materials, encryptionMaterialsOutput.encryptionMaterials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Keyring returned an invalid response") - })); - if valueOrError6.IsFailure() { - output = MaybePlacebo::from(valueOrError6.PropagateFailure::>()); - return output.read(); + if !(crate::implementation_from_dafny::_MultiKeyring_Compile::_default::_Verified_q(&self.keyring().clone()) || ({ + let __is_5: Object = self.keyring().clone(); + __is_5.clone().is_instance_of::() + })) { + let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(encryptionMaterialsOutput.encryptionMaterials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Could not retrieve materials required for encryption") + })); + if valueOrError5.IsFailure() { + output = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); + return output.read(); + }; + let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(&materials, encryptionMaterialsOutput.encryptionMaterials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Keyring returned an invalid response") + })); + if valueOrError6.IsFailure() { + output = MaybePlacebo::from(valueOrError6.PropagateFailure::>()); + return output.read(); + } }; output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: encryptionMaterialsOutput.clone() })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(333,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(355,5) fn _DecryptMaterials_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnDecrypt(input.algorithmSuiteId(), input.commitmentPolicy()); @@ -70473,9 +70554,9 @@ pub mod _DefaultCMM_Compile { let mut keysSeq: Sequence; let mut _out0: Sequence = crate::implementation_from_dafny::SortedSets::_default::SetToSequence::(&keysSet); keysSeq = _out0.clone(); - let mut i: DafnyInt = int!(0); - while i.clone() < keysSeq.cardinality() { - let mut key: ValidUTF8Bytes = keysSeq.get(&i); + let mut i: u64 = 0; + while i < truncate!(keysSeq.cardinality(), u64) { + let mut key: ValidUTF8Bytes = keysSeq.get(&int!((&i).clone())); if input.encryptionContext().contains(&key) { let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.reproducedEncryptionContext().value().get(&key) == input.encryptionContext().get(&key), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Encryption context does not match reproduced encryption context.") @@ -70487,7 +70568,7 @@ pub mod _DefaultCMM_Compile { } else { requiredEncryptionContextKeys = requiredEncryptionContextKeys.concat(&seq![key.clone()]); }; - i = i.clone() + int!(1); + i = i + 1; } }; let mut valueOrError2: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::InitializeDecryptionMaterials(&Arc::new(InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput { @@ -70511,12 +70592,17 @@ pub mod _DefaultCMM_Compile { return output.read(); }; let mut result: Arc = valueOrError3.Extract(); - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(&materials, result.materials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Keyring.OnDecrypt failed to decrypt the plaintext data key.") - })); - if valueOrError4.IsFailure() { - output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); - return output.read(); + if !(crate::implementation_from_dafny::_MultiKeyring_Compile::_default::_Verified_q(&self.keyring().clone()) || ({ + let __is_6: Object = self.keyring().clone(); + __is_6.clone().is_instance_of::() + })) { + let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(&materials, result.materials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Keyring.OnDecrypt failed to decrypt the plaintext data key.") + })); + if valueOrError4.IsFailure() { + output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); + return output.read(); + } }; output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: Arc::new(DecryptMaterialsOutput::DecryptMaterialsOutput { @@ -70643,9 +70729,7 @@ pub mod _Defaults_Compile { pub mod _Digest_Compile { pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm::SHA_512; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm::SHA_384; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; @@ -70653,25 +70737,26 @@ pub mod _Digest_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error; pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(13,3) - pub fn Length(digestAlgorithm: &Arc) -> nat { + /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(14,3) + pub fn Length(digestAlgorithm: &Arc) -> u64 { let mut _source0: Arc = digestAlgorithm.clone(); if matches!((&_source0).as_ref(), SHA_512{ .. }) { - int!(64) + 64 } else { if matches!((&_source0).as_ref(), SHA_384{ .. }) { - int!(48) + 48 } else { - int!(32) + 32 } } } - /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(21,3) + /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(22,3) pub fn Digest(input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut __let_tmp_rhs0: Arc = input.clone(); @@ -70685,7 +70770,7 @@ pub mod _Digest_Compile { return res.read(); }; let mut value: Sequence = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(value.cardinality() == _default::Length(&digestAlgorithm), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(value.cardinality(), u64) == _default::Length(&digestAlgorithm), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Incorrect length digest from ExternDigest.") })); if valueOrError1.IsFailure() { @@ -70714,13 +70799,14 @@ pub mod _DiscoveryMultiKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None; pub use crate::implementation_from_dafny::_AwsKmsDiscoveryKeyring_Compile::AwsKmsDiscoveryKeyring; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient; pub use ::dafny_runtime::rd; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput; @@ -70730,10 +70816,10 @@ pub mod _DiscoveryMultiKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/DiscoveryMultiKeyring.dfy(33,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/DiscoveryMultiKeyring.dfy(35,3) pub fn DiscoveryMultiKeyring(regions: &Sequence>, discoveryFilter: &Arc>>, clientSupplier: &Object, grantTokens: &Arc>) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < regions.cardinality(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(regions.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("No regions passed.") })); if valueOrError0.IsFailure() { @@ -70748,9 +70834,9 @@ pub mod _DiscoveryMultiKeyring_Compile { return output.read(); }; let mut children: Sequence> = seq![] as Sequence>; - let mut _hi0: DafnyInt = regions.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { - let mut region: Sequence = regions.get(&i); + let mut _hi0: u64 = truncate!(regions.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + let mut region: Sequence = regions.get(&int!((&i).clone())); let mut valueOrError2: Arc, Arc>>; let mut _out0: Arc, Arc>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput { region: region.clone() @@ -71235,8 +71321,9 @@ pub mod _EcdhEdkWrapping_Compile { pub use ::std::convert::AsRef; pub use ::dafny_runtime::allocate_object; pub use ::dafny_runtime::update_field_uninit_object; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use ::dafny_runtime::int; pub use ::dafny_runtime::UpcastObject; pub use ::dafny_runtime::DynAny; @@ -71249,6 +71336,7 @@ pub mod _EcdhEdkWrapping_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::Zero; pub use ::std::marker::Sync; pub use ::std::marker::Send; @@ -71266,7 +71354,7 @@ pub mod _EcdhEdkWrapping_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(460,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(464,3) pub fn DeriveSharedKeyingMaterial(sharedSecret: &Sequence, fixedInfo: &Sequence, salt: &Sequence, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut maybeDerivedKeyingMaterial: Arc, Arc>>; @@ -71302,11 +71390,11 @@ pub mod _EcdhEdkWrapping_Compile { /// = aws-encryption-sdk-specification/framework/key-agreement-schemas.md#key-derivation /// = type=implication /// # The FixedInfo field MUST be serialized in the following order: - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(509,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(513,3) pub fn SerializeFixedInfo(ecdhKeyDerivationUtf8: &ValidUTF8Bytes, curveSpecUtf8: &ValidUTF8Bytes, senderPublicKey: &Sequence, recipientPublicKey: &Sequence, canonicalizedEC: &Sequence, keyringVersion: &Sequence) -> Sequence { - ecdhKeyDerivationUtf8.concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMETER()).concat(curveSpecUtf8).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMETER()).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_PRF_NAME()).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMETER()).concat(senderPublicKey).concat(recipientPublicKey).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMETER()).concat(keyringVersion).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMETER()).concat(canonicalizedEC) + ecdhKeyDerivationUtf8.concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(curveSpecUtf8).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_PRF_NAME()).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(senderPublicKey).concat(recipientPublicKey).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(keyringVersion).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(canonicalizedEC) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(570,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(574,3) pub fn CurveSpecTypeToString(c: &Arc) -> Sequence { let mut _source0: Arc = c.clone(); if matches!((&_source0).as_ref(), ECC_NIST_P256{ .. }) { @@ -71323,7 +71411,7 @@ pub mod _EcdhEdkWrapping_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(580,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(584,3) pub fn E(s: &Sequence) -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: s.clone() @@ -71331,7 +71419,7 @@ pub mod _EcdhEdkWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(26,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(27,3) #[derive(PartialEq, Clone)] pub enum EcdhUnwrapInfo { EcdhUnwrapInfo {} @@ -71393,7 +71481,7 @@ pub mod _EcdhEdkWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(27,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(28,3) #[derive(PartialEq, Clone)] pub enum EcdhWrapInfo { EcdhWrapInfo {} @@ -71455,7 +71543,7 @@ pub mod _EcdhEdkWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(29,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(30,3) pub struct EcdhUnwrap { pub __i_senderPublicKey: Sequence, pub __i_recipientPublicKey: Sequence, @@ -71470,7 +71558,7 @@ pub mod _EcdhEdkWrapping_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(39,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(40,5) pub fn _ctor(this: &Object, senderPublicKey: &Sequence, recipientPublicKey: &Sequence, sharedSecret: &Sequence, keyringVersion: &Sequence, curveSpec: &Arc, crypto: &Object) -> () { let mut _set___i_senderPublicKey: bool = false; let mut _set___i_recipientPublicKey: bool = false; @@ -71486,38 +71574,38 @@ pub mod _EcdhEdkWrapping_Compile { update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(205,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(207,5) pub fn commitmentKeyCheck(&self, calculatedCommitmentKey: &Sequence, serializedCommitmentKey: &Sequence) -> bool { let mut res: bool = ::default(); let mut _diff_q: u8 = 0 as u8; - let mut _hi0: DafnyInt = serializedCommitmentKey.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { - _diff_q = _diff_q | calculatedCommitmentKey.get(&i) as u8 ^ serializedCommitmentKey.get(&i) as u8; + let mut _hi0: u64 = truncate!(serializedCommitmentKey.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + _diff_q = _diff_q | calculatedCommitmentKey.get(&int!((&i).clone())) as u8 ^ serializedCommitmentKey.get(&int!((&i).clone())) as u8; } res = _diff_q == 0 as u8; return res; } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(32,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(33,5) pub fn senderPublicKey(&self) -> Sequence { self.__i_senderPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(33,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(34,5) pub fn recipientPublicKey(&self) -> Sequence { self.__i_recipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(34,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(35,5) pub fn sharedSecret(&self) -> Sequence { self.__i_sharedSecret.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(35,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(36,5) pub fn keyringVersion(&self) -> Sequence { self.__i_keyringVersion.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(36,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(37,5) pub fn curveSpec(&self) -> Arc { self.__i_curveSpec.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(37,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(38,5) pub fn crypto(&self) -> Object { self.__i_crypto.clone() } @@ -71546,26 +71634,26 @@ pub mod _EcdhEdkWrapping_Compile { impl Action, Arc>>, Arc>>> for EcdhUnwrap { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(87,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(88,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); let mut wrappedMaterial: Sequence = input.wrappedMaterial().clone(); let mut aad: Map = input.encryptionContext().clone(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Constants_Compile::_default::CIPHERTEXT_WRAPPED_MATERIAL_INDEX() < wrappedMaterial.cardinality(), &_default::E(&string_utf16_of("Recieved ciphertext is shorter than expected."))); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Constants_Compile::_default::CIPHERTEXT_WRAPPED_MATERIAL_INDEX() < truncate!(wrappedMaterial.cardinality(), u64), &_default::E(&string_utf16_of("Received ciphertext is shorter than expected."))); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>>>()); return res.read(); }; - let mut KeyLength: DafnyInt = int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength.clone() < wrappedMaterial.cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Received EDK Ciphertext of incorrect length.") + let mut KeyLength: i32 = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite); + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()) + int!(KeyLength) < wrappedMaterial.cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Received EDK Ciphertext of incorrect length3.") })); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>>>()); return res.read(); }; - let mut kdfNonce: Sequence = wrappedMaterial.slice(&int!(0), &crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_COMMITMENT_KEY_INDEX()); + let mut kdfNonce: Sequence = wrappedMaterial.take(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_COMMITMENT_KEY_INDEX()).clone())); let mut iv: Sequence = { let _initializer = { Arc::new(move |_v0: &DafnyInt| -> u8{ @@ -71574,9 +71662,9 @@ pub mod _EcdhEdkWrapping_Compile { }; integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_AES_256_ENC_ALG().ivLength().clone())).map(move |i| _initializer(&i)).collect::>() }; - let mut commitmentKey: Sequence = wrappedMaterial.slice(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_COMMITMENT_KEY_INDEX(), &crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()); - let mut wrappedKey: Sequence = wrappedMaterial.slice(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX(), &(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength.clone())); - let mut authTag: Sequence = wrappedMaterial.drop(&(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength.clone())); + let mut commitmentKey: Sequence = wrappedMaterial.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_COMMITMENT_KEY_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()).clone())); + let mut wrappedKey: Sequence = wrappedMaterial.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()).clone()), &int!((&(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength as u64)).clone())); + let mut authTag: Sequence = wrappedMaterial.drop(&int!((&(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength as u64)).clone())); let mut valueOrError2: Arc>> = crate::implementation_from_dafny::UTF8::_default::Encode(&_default::CurveSpecTypeToString(&self.curveSpec().clone())).MapFailure::>(&(Arc::new(move |x0: &Sequence| _default::E(x0)) as Arc _ + Sync + Send>)); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>>>()); @@ -71598,9 +71686,9 @@ pub mod _EcdhEdkWrapping_Compile { return res.read(); }; let mut derivedKeyingMaterial: Sequence = valueOrError4.Extract(); - let mut calculatedCommitmentKey: Sequence = derivedKeyingMaterial.slice(&int!(0), &int!(32)); - let mut sharedKeyingMaterial: Sequence = derivedKeyingMaterial.drop(&int!(32)); - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(calculatedCommitmentKey.cardinality() == commitmentKey.cardinality(), &_default::E(&string_utf16_of("Calculated commitment key length does NOT match expected commitment key length"))); + let mut calculatedCommitmentKey: Sequence = derivedKeyingMaterial.take(&int!((&truncate!((&int!(32)).clone(), u32)).clone())); + let mut sharedKeyingMaterial: Sequence = derivedKeyingMaterial.drop(&int!((&truncate!((&int!(32)).clone(), u32)).clone())); + let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(calculatedCommitmentKey.cardinality(), u64) == truncate!(commitmentKey.cardinality(), u64), &_default::E(&string_utf16_of("Calculated commitment key length does NOT match expected commitment key length"))); if valueOrError5.IsFailure() { res = MaybePlacebo::from(valueOrError5.PropagateFailure::>>>()); return res.read(); @@ -71635,7 +71723,7 @@ pub mod _EcdhEdkWrapping_Compile { return res.read(); }; let mut unwrappedPdk: Sequence = valueOrError7.Extract(); - let mut valueOrError8: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(unwrappedPdk.cardinality() == int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())), &_default::E(&string_utf16_of("Invalid Key Length"))); + let mut valueOrError8: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(unwrappedPdk.cardinality(), u64) == crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64, &_default::E(&string_utf16_of("Invalid Key Length"))); if valueOrError8.IsFailure() { res = MaybePlacebo::from(valueOrError8.PropagateFailure::>>>()); return res.read(); @@ -71656,7 +71744,7 @@ pub mod _EcdhEdkWrapping_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(226,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(229,3) pub struct EcdhGenerateAndWrapKeyMaterial { pub __i_crypto: Object, pub __i_sharedSecret: Sequence, @@ -71668,7 +71756,7 @@ pub mod _EcdhEdkWrapping_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(233,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(236,5) pub fn _ctor(this: &Object, sharedSecret: &Sequence, fixedInfo: &Sequence, crypto: &Object) -> () { let mut _set___i_crypto: bool = false; let mut _set___i_sharedSecret: bool = false; @@ -71678,15 +71766,15 @@ pub mod _EcdhEdkWrapping_Compile { update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(231,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(234,5) pub fn crypto(&self) -> Object { self.__i_crypto.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(229,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(232,5) pub fn sharedSecret(&self) -> Sequence { self.__i_sharedSecret.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(230,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(233,5) pub fn fixedInfo(&self) -> Sequence { self.__i_fixedInfo.clone() } @@ -71715,7 +71803,7 @@ pub mod _EcdhEdkWrapping_Compile { impl Action, Arc>>, Arc>>> for EcdhGenerateAndWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(272,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(275,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -71744,7 +71832,8 @@ pub mod _EcdhEdkWrapping_Compile { let mut _out1: Arc>>, Arc>> = Action::, Arc>>, Arc>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput { plaintextMaterial: pdk.clone(), algorithmSuite: input.algorithmSuite().clone(), - encryptionContext: input.encryptionContext().clone() + encryptionContext: input.encryptionContext().clone(), + serializedEC: input.serializedEC().clone() })); valueOrError1 = _out1.clone(); if valueOrError1.IsFailure() { @@ -71769,7 +71858,7 @@ pub mod _EcdhEdkWrapping_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(314,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(318,3) pub struct EcdhWrapKeyMaterial { pub __i_crypto: Object, pub __i_fixedInfo: Sequence, @@ -71781,7 +71870,7 @@ pub mod _EcdhEdkWrapping_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(321,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(325,5) pub fn _ctor(this: &Object, sharedSecret: &Sequence, fixedInfo: &Sequence, crypto: &Object) -> () { let mut _set___i_crypto: bool = false; let mut _set___i_fixedInfo: bool = false; @@ -71791,15 +71880,15 @@ pub mod _EcdhEdkWrapping_Compile { update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(319,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(323,5) pub fn crypto(&self) -> Object { self.__i_crypto.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(318,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(322,5) pub fn fixedInfo(&self) -> Sequence { self.__i_fixedInfo.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(317,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(321,5) pub fn sharedSecret(&self) -> Sequence { self.__i_sharedSecret.clone() } @@ -71828,7 +71917,7 @@ pub mod _EcdhEdkWrapping_Compile { impl Action, Arc>>, Arc>>> for EcdhWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(380,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(384,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -71863,8 +71952,8 @@ pub mod _EcdhEdkWrapping_Compile { return res.read(); }; let mut derivedKeyingMaterial: Sequence = valueOrError2.Extract(); - let mut commitmentKey: Sequence = derivedKeyingMaterial.slice(&int!(0), &int!(32)); - let mut sharedKeyingMaterial: Sequence = derivedKeyingMaterial.drop(&int!(32)); + let mut commitmentKey: Sequence = derivedKeyingMaterial.take(&int!((&truncate!((&int!(32)).clone(), u32)).clone())); + let mut sharedKeyingMaterial: Sequence = derivedKeyingMaterial.drop(&int!((&truncate!((&int!(32)).clone(), u32)).clone())); let mut iv: Sequence = { let _initializer = { Arc::new(move |_v3: &DafnyInt| -> u8{ @@ -71941,7 +72030,7 @@ pub mod _EdkWrapping_Compile { pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::IntermediateUnwrapOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::DeserializedIntermediateWrappedMaterial; @@ -71958,7 +72047,7 @@ pub mod _EdkWrapping_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(72,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(73,3) pub fn WrapEdkMaterial<_T: DafnyType>(encryptionMaterials: &Arc, wrap: &Object>, generateAndWrap: &Object>) -> Arc>, Arc>> { let mut ret = MaybePlacebo::>, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterials(encryptionMaterials), &Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -71973,7 +72062,8 @@ pub mod _EdkWrapping_Compile { let mut _out0: Arc>, Arc>> = Action::, Arc>, Arc>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput { plaintextMaterial: encryptionMaterials.plaintextDataKey().value().clone(), algorithmSuite: encryptionMaterials.algorithmSuite().clone(), - encryptionContext: encryptionMaterials.encryptionContext().clone() + encryptionContext: encryptionMaterials.encryptionContext().clone(), + serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionMaterials.encryptionContext()) })); valueOrError1 = _out0.clone(); if valueOrError1.IsFailure() { @@ -72014,7 +72104,8 @@ pub mod _EdkWrapping_Compile { let mut valueOrError3: Arc>, Arc>>; let mut _out2: Arc>, Arc>> = Action::, Arc>, Arc>>>::Invoke(rd!(generateAndWrap.clone()), &Arc::new(GenerateAndWrapInput::GenerateAndWrapInput { algorithmSuite: encryptionMaterials.algorithmSuite().clone(), - encryptionContext: encryptionMaterials.encryptionContext().clone() + encryptionContext: encryptionMaterials.encryptionContext().clone(), + serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionMaterials.encryptionContext()) })); valueOrError3 = _out2.clone(); if valueOrError3.IsFailure() { @@ -72065,7 +72156,7 @@ pub mod _EdkWrapping_Compile { }; return ret.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(263,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(275,3) pub fn UnwrapEdkMaterial<_T: DafnyType>(wrappedMaterial: &Sequence, decryptionMaterials: &DecryptionMaterialsPendingPlaintextDataKey, unwrap: &Object>) -> Arc>, Arc>> { let mut ret = MaybePlacebo::>, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidDecryptionMaterials(decryptionMaterials), &Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -72080,7 +72171,8 @@ pub mod _EdkWrapping_Compile { let mut _out0: Arc>, Arc>> = Action::, Arc>, Arc>>>::Invoke(rd!(unwrap.clone()), &Arc::new(UnwrapInput::UnwrapInput { wrappedMaterial: wrappedMaterial.clone(), algorithmSuite: decryptionMaterials.algorithmSuite().clone(), - encryptionContext: decryptionMaterials.encryptionContext().clone() + encryptionContext: decryptionMaterials.encryptionContext().clone(), + serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(decryptionMaterials.encryptionContext()) })); valueOrError1 = _out0.clone(); if valueOrError1.IsFailure() { @@ -72098,7 +72190,7 @@ pub mod _EdkWrapping_Compile { return ret.read(); } else { if matches!(decryptionMaterials.algorithmSuite().edkWrapping().as_ref(), IntermediateKeyWrapping{ .. }) { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(wrappedMaterial.cardinality() >= int!(decryptionMaterials.algorithmSuite().encrypt().AES_GCM().keyLength().clone() + decryptionMaterials.algorithmSuite().encrypt().AES_GCM().tagLength().clone()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(wrappedMaterial.cardinality(), u64) >= (decryptionMaterials.algorithmSuite().encrypt().AES_GCM().keyLength().clone() + decryptionMaterials.algorithmSuite().encrypt().AES_GCM().tagLength().clone()) as u64, &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid material for Intermediate Unwrapping") })); if valueOrError2.IsFailure() { @@ -72127,7 +72219,7 @@ pub mod _EdkWrapping_Compile { }; return ret.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(350,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(371,3) pub fn GetProviderWrappedMaterial(material: &Sequence, algSuite: &Arc) -> Arc, Arc>> { if matches!(algSuite.edkWrapping().as_ref(), DIRECT_KEY_WRAPPING{ .. }) { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { @@ -72150,7 +72242,7 @@ pub mod _EdkWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(27,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(28,3) #[derive(PartialEq, Clone)] pub enum WrapEdkMaterialOutput { WrapOnlyEdkMaterialOutput { @@ -72274,7 +72366,7 @@ pub mod _EdkWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(51,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(52,3) #[derive(PartialEq, Clone)] pub enum UnwrapEdkMaterialOutput { UnwrapEdkMaterialOutput { @@ -72388,7 +72480,6 @@ pub mod _EncryptDecryptHelpers_Compile { pub use ::std::marker::Sync; pub use ::std::marker::Send; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems::MoreNeeded; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; @@ -72401,10 +72492,9 @@ pub mod _EncryptDecryptHelpers_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultCryptographicMaterialsManagerInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput; - pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite; pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey; pub use crate::implementation_from_dafny::_KeyDerivation_Compile::ExpandedKeyMaterial; @@ -72418,9 +72508,6 @@ pub mod _EncryptDecryptHelpers_Compile { pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageType; - pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::integer_range; - pub use ::dafny_runtime::Zero; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput; pub use ::dafny_runtime::seq; @@ -72444,7 +72531,7 @@ pub mod _EncryptDecryptHelpers_Compile { pub struct _default {} impl _default { - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(46,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(47,3) pub fn SerializeMessageWithSignature(framedMessage: &FramedMessage, signature: &Sequence, suite: &Arc) -> Arc, Arc>> { let mut serializedSignature: Sequence = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(signature); let mut valueOrError0: Arc, Arc>> = _default::SerializeMessageWithoutSignature(framedMessage, suite); @@ -72457,7 +72544,7 @@ pub mod _EncryptDecryptHelpers_Compile { }) } } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(65,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(66,3) pub fn SerializeMessageWithoutSignature(framedMessage: &FramedMessage, suite: &Arc) -> Arc, Arc>> { let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_HeaderAuth_Compile::_default::WriteHeaderAuthTag(framedMessage.finalFrame().header().headerAuth(), suite); if valueOrError0.IsFailure() { @@ -72471,7 +72558,7 @@ pub mod _EncryptDecryptHelpers_Compile { } /// DecryptionMaterialsWithPlaintextDataKey ensures that the materials and the suite match. /// requires Client.Materials.DecryptionMaterialsWithPlaintextDataKey(decMat) - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(89,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(90,3) pub fn VerifySignature(buffer: &Arc, msg: &Sequence, decMat: &Arc, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); if matches!(decMat.verificationKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) { @@ -72520,7 +72607,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(217,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(218,3) pub fn MapSerializeFailure(s: &Sequence) -> Arc) -> Arc + Sync + Send> { { let s: Sequence = s.clone(); @@ -72531,7 +72618,7 @@ pub mod _EncryptDecryptHelpers_Compile { let mut s = s.clone(); Arc::new(move |_source0: &Arc| -> Arc{ if matches!(_source0.as_ref(), MoreNeeded{ .. }) { - let mut ___mcc_h0: nat = _source0.pos().clone(); + let mut ___mcc_h0: u64 = _source0.pos().clone(); Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Incomplete message").concat(&s) }) @@ -72555,7 +72642,7 @@ pub mod _EncryptDecryptHelpers_Compile { /// # such use. /// # If the input encryption context contains any entries with /// # a key beginning with this prefix, the encryption operation MUST fail. - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(224,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(225,3) pub fn ValidateEncryptionContext(input: &Arc>>) -> Arc>> { if matches!(input.as_ref(), Some{ .. }) && (&input.value().keys()).iter().any(({ let mut input = input.clone(); @@ -72580,7 +72667,7 @@ pub mod _EncryptDecryptHelpers_Compile { Arc::new(Outcome::>::Pass {}) } } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(254,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(255,3) pub fn CreateCmmFromInput(inputCmm: &Arc>>, inputKeyring: &Arc>>) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(inputCmm.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) || matches!(inputKeyring.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { @@ -72635,9 +72722,9 @@ pub mod _EncryptDecryptHelpers_Compile { }; return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(348,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(349,3) pub fn ValidateMaxEncryptedDataKeys(maxEncryptedDataKeys: &Arc>, edks: &Sequence>) -> Arc>> { - if matches!(maxEncryptedDataKeys.as_ref(), Some{ .. }) && int!(maxEncryptedDataKeys.value().clone()) < edks.cardinality() { + if matches!(maxEncryptedDataKeys.as_ref(), Some{ .. }) && (maxEncryptedDataKeys.value().clone() as u64) < truncate!(edks.cardinality(), u64) { Arc::new(Outcome::>::Fail { error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Encrypted data keys exceed maxEncryptedDataKeys") @@ -72647,18 +72734,18 @@ pub mod _EncryptDecryptHelpers_Compile { Arc::new(Outcome::>::Pass {}) } } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(374,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(376,3) pub fn GenerateMessageId(suite: &Arc, crypto: &Object) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut maybeId: Arc, Arc>>; if suite.messageVersion().clone() == 1 { let mut _out0: Arc, Arc>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(crypto.clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput { - length: truncate!(crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V1(), i32) + length: crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V1() as i32 })); maybeId = _out0.clone(); } else { let mut _out1: Arc, Arc>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(crypto.clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput { - length: truncate!(crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V2(), i32) + length: crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V2() as i32 })); maybeId = _out1.clone(); }; @@ -72679,7 +72766,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(411,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(413,3) pub fn BuildHeaderForEncrypt(messageId: &MessageId, suite: &ESDKAlgorithmSuite, encryptionContext: &Map, requiredEncryptionContextKeys: &Sequence, encryptedDataKeys: &seq16, frameLength: u32, derivedDataKeys: &Arc, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut reqKeySet: Set = (&({ @@ -72765,7 +72852,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(503,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(505,3) pub fn BuildHeaderBody(messageId: &MessageId, suite: &ESDKAlgorithmSuite, encryptionContext: &ESDKCanonicalEncryptionContext, encryptedDataKeys: &seq16, frameLength: u32, suiteData: &Arc>>) -> Arc { let mut res: Arc; let mut contentType: Arc = Arc::new(ContentType::Framed {}); @@ -72791,33 +72878,25 @@ pub mod _EncryptDecryptHelpers_Compile { encryptionContext: encryptionContext.clone(), encryptedDataKeys: encryptedDataKeys.clone(), contentType: contentType.clone(), - headerIvLength: int!(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite)), + headerIvLength: crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite) as u64, frameLength: frameLength }); return res.clone(); }; return res.clone(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(588,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(590,3) pub fn BuildHeaderAuthTag(suite: &Arc, dataKey: &Sequence, rawHeader: &Sequence, serializedReqEncryptionContext: &Sequence, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); - let mut keyLength: nat = int!(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(suite)); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(dataKey.cardinality() == keyLength.clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { + let mut keyLength: i32 = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(suite); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(dataKey.cardinality(), u64) == keyLength as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Incorrect data key length") })); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); return res.read(); }; - let mut ivLength: u8 = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite); - let mut iv: Sequence = { - let _initializer = { - Arc::new(move |_v3: &DafnyInt| -> u8{ - 0 - }) - }; - integer_range(Zero::zero(), int!(ivLength)).map(move |i| _initializer(&i)).collect::>() - }; + let mut iv: Sequence = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLengthZeros(suite); let mut maybeEncryptionOutput: Arc, Arc>>; let mut _out0: Arc, Arc>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(crypto.clone()), &Arc::new(AESEncryptInput::AESEncryptInput { encAlg: suite.encrypt().AES_GCM().clone(), @@ -72848,7 +72927,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(640,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(642,3) pub fn GetEncryptionMaterials(cmm: &Object, algorithmSuiteId: &Arc>>, encryptionContext: &Map, maxPlaintextLength: i64, commitmentPolicy: &Arc, mpl: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut encMatRequest: Arc = Arc::new(GetEncryptionMaterialsInput::GetEncryptionMaterialsInput { @@ -72894,7 +72973,7 @@ pub mod _EncryptDecryptHelpers_Compile { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); return res.read(); }; - let mut _v4: () = valueOrError1.Extract(); + let mut _v3: () = valueOrError1.Extract(); let mut valueOrError2: Arc>> = IAwsCryptographicMaterialProvidersClient::EncryptionMaterialsHasPlaintextDataKey(rd!(mpl.clone()), &materials).MapFailure::>(&({ Arc::new(move |e: &Arc| -> Arc{ Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders { @@ -72906,7 +72985,7 @@ pub mod _EncryptDecryptHelpers_Compile { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return res.read(); }; - let mut _v5: () = valueOrError2.Extract(); + let mut _v4: () = valueOrError2.Extract(); let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::IsESDKEncryptionContext(materials.encryptionContext()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("CMM failed to return serializable encryption materials.") })); @@ -72939,7 +73018,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(717,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(719,3) pub fn GetDecryptionMaterials(cmm: &Object, algorithmSuiteId: &Arc, headerBody: &Arc, reproducedEncryptionContext: &Arc>>, commitmentPolicy: &Arc, mpl: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut encryptionContext: Map = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::GetEncryptionContext(headerBody.encryptionContext()); @@ -72984,7 +73063,7 @@ pub mod _EncryptDecryptHelpers_Compile { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); return res.read(); }; - let mut _v6: () = valueOrError1.Extract(); + let mut _v5: () = valueOrError1.Extract(); let mut valueOrError2: Arc>> = IAwsCryptographicMaterialProvidersClient::DecryptionMaterialsWithPlaintextDataKey(rd!(mpl.clone()), &materials).MapFailure::>(&({ Arc::new(move |e: &Arc| -> Arc{ Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders { @@ -72996,7 +73075,7 @@ pub mod _EncryptDecryptHelpers_Compile { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); return res.read(); }; - let mut _v7: () = valueOrError2.Extract(); + let mut _v6: () = valueOrError2.Extract(); let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::IsESDKEncryptionContext(materials.encryptionContext()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("CMM failed to return serializable encryption materials.") })); @@ -73010,10 +73089,10 @@ pub mod _EncryptDecryptHelpers_Compile { return res.read(); } /// Validating suite data is only relevant for suites with commitment - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(794,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(796,3) pub fn ValidateSuiteData(suite: &Arc, header: &Arc, expectedSuiteData: &Sequence) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(header.suiteData().cardinality() == int!(suite.commitment().HKDF().outputKeyLength().clone()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(header.suiteData().cardinality(), u64) == suite.commitment().HKDF().outputKeyLength().clone() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Commitment key is invalid") })); if valueOrError0.IsFailure() { @@ -73032,7 +73111,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(834,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(837,3) pub fn ReadAndDecryptFramedMessageBody(buffer: &Arc, header: &FramedHeader, key: &Sequence, crypto: &Object) -> Arc, Arc), Arc>> { let mut res = MaybePlacebo::, Arc), Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::ReadFramedMessageBody(buffer, header, &(seq![] as Sequence), buffer).MapFailure::>(&_default::MapSerializeFailure(&string_utf16_of(": ReadFramedMessageBody"))); @@ -73058,7 +73137,7 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(870,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(873,3) pub fn ReadAndDecryptNonFramedMessageBody(buffer: &Arc, header: &NonFramedHeader, key: &Sequence, crypto: &Object) -> Arc, Arc), Arc>> { let mut res = MaybePlacebo::, Arc), Arc>>>::new(); let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::ReadNonFramedMessageBody(buffer, header).MapFailure::>(&_default::MapSerializeFailure(&string_utf16_of(": ReadNonFramedMessageBody"))); @@ -73085,18 +73164,18 @@ pub mod _EncryptDecryptHelpers_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(36,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(37,3) pub fn DEFAULT_FRAME_LENGTH() -> FrameLength { 4096 } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(39,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(40,3) pub fn RESERVED_ENCRYPTION_CONTEXT() -> ValidUTF8Bytes { let mut s: Sequence = seq![97, 119, 115, 45, 99, 114, 121, 112, 116, 111, 45]; s.clone() } } - /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(30,3) + /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(31,3) pub type FrameLength = i64; } /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(8,1) @@ -73105,7 +73184,6 @@ pub mod _EncryptedDataKeys_Compile { pub use ::dafny_runtime::Sequence; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::int; pub use ::dafny_runtime::truncate; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer; @@ -73127,13 +73205,13 @@ pub mod _EncryptedDataKeys_Compile { pub fn WriteEncryptedDataKey(edk: &ESDKEncryptedDataKey) -> Sequence { crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(edk.keyProviderId()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(edk.keyProviderInfo())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(edk.ciphertext())) } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(25,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(27,3) pub fn WriteEncryptedDataKeys(edks: &seq16) -> Sequence { let mut _accumulator: Sequence = seq![] as Sequence; let mut _r0 = edks.clone(); 'TAIL_CALL_START: loop { let edks = _r0; - if edks.cardinality() == int!(0) { + if truncate!(edks.cardinality(), u64) == 0 { return (seq![] as Sequence).concat(&_accumulator); } else { _accumulator = _default::WriteEncryptedDataKey(&crate::implementation_from_dafny::_Seq_Compile::_default::Last::(&edks)).concat(&_accumulator); @@ -73143,11 +73221,11 @@ pub mod _EncryptedDataKeys_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(42,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(44,3) pub fn WriteEncryptedDataKeysSection(edks: &seq16) -> Sequence { crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(truncate!(edks.cardinality(), u16)).concat(&_default::WriteEncryptedDataKeys(edks)) } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(50,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(52,3) pub fn ReadEncryptedDataKey(buffer: &Arc) -> Arc>, Arc>> { let mut valueOrError0: Arc>>, Arc>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(buffer); if valueOrError0.IsFailure() { @@ -73192,7 +73270,7 @@ pub mod _EncryptedDataKeys_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(72,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(74,3) pub fn ReadEncryptedDataKeys(buffer: &Arc, accumulator: &seq16, count: u16, nextEdkStart: &Arc) -> Arc>>, Arc>> { let mut _r0 = buffer.clone(); let mut _r1 = accumulator.clone(); @@ -73203,7 +73281,7 @@ pub mod _EncryptedDataKeys_Compile { let accumulator = _r1; let count = _r2; let nextEdkStart = _r3; - if accumulator.cardinality() < int!(count) { + if truncate!(accumulator.cardinality(), u64) < count as u64 { let mut valueOrError0: Arc>, Arc>> = _default::ReadEncryptedDataKey(&nextEdkStart); if valueOrError0.IsFailure() { return valueOrError0.PropagateFailure::>>>(); @@ -73232,7 +73310,7 @@ pub mod _EncryptedDataKeys_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(96,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(98,3) pub fn ReadEncryptedDataKeysSection(buffer: &Arc, maxEdks: &Arc>) -> Arc>>, Arc>> { let mut valueOrError0: Arc>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(buffer); if valueOrError0.IsFailure() { @@ -73241,7 +73319,7 @@ pub mod _EncryptedDataKeys_Compile { let mut __let_tmp_rhs0: Arc> = valueOrError0.Extract(); let mut count: u16 = __let_tmp_rhs0.data().clone(); let mut edkStart: Arc = __let_tmp_rhs0.tail().clone(); - if matches!(maxEdks.as_ref(), Some{ .. }) && int!(maxEdks.value().clone()) < int!(count) { + if matches!(maxEdks.as_ref(), Some{ .. }) && maxEdks.value().clone() < count as i64 { Arc::new(Result::>>, Arc>::Failure { error: Arc::new(ReadProblems::Error { message: string_utf16_of("Ciphertext encrypted data keys exceed maxEncryptedDataKeys") @@ -73280,6 +73358,8 @@ pub mod _EncryptionContext_Compile { pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::seq; + pub use ::dafny_runtime::MaybePlacebo; + pub use ::std::convert::Into; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead; @@ -73296,11 +73376,11 @@ pub mod _EncryptionContext_Compile { pub struct _default {} impl _default { - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(54,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(55,3) pub fn GetCanonicalEncryptionContext(encryptionContext: &ESDKEncryptionContext) -> ESDKCanonicalEncryptionContext { crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetCanonicalLinearPairs(encryptionContext) } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(64,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(65,3) pub fn GetEncryptionContext(canonicalEncryptionContext: &ESDKCanonicalEncryptionContext) -> Map { (&({ let mut canonicalEncryptionContext = canonicalEncryptionContext.clone(); @@ -73316,48 +73396,43 @@ pub mod _EncryptionContext_Compile { }) }))() } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(289,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(291,3) pub fn WriteAADSection(ec: &ESDKCanonicalEncryptionContext) -> Sequence { - if ec.cardinality() == int!(0) { + if truncate!(ec.cardinality(), u64) == 0 { crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint16(0) } else { let mut aad: Sequence = _default::WriteAAD(ec); crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint16(truncate!(aad.cardinality(), u16)).concat(&aad) } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(339,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(342,3) pub fn WriteEmptyEcOrWriteAAD(ec: &ESDKCanonicalEncryptionContext) -> Sequence { - if ec.cardinality() == int!(0) { + if truncate!(ec.cardinality(), u64) == 0 { seq![] as Sequence } else { _default::WriteAAD(ec) } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(372,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(376,3) pub fn WriteAAD(ec: &ESDKCanonicalEncryptionContext) -> Sequence { crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint16(truncate!(ec.cardinality(), u16)).concat(&_default::WriteAADPairs(ec)) } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(390,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(394,3) pub fn WriteAADPairs(ec: &ESDKCanonicalEncryptionContext) -> Sequence { - let mut _accumulator: Sequence = seq![] as Sequence; - let mut _r0 = ec.clone(); - 'TAIL_CALL_START: loop { - let ec = _r0; - if ec.cardinality() == int!(0) { - return (seq![] as Sequence).concat(&_accumulator); - } else { - _accumulator = _default::WriteAADPair(&crate::implementation_from_dafny::_Seq_Compile::_default::Last::(&ec)).concat(&_accumulator); - let mut _in0: Sequence = crate::implementation_from_dafny::_Seq_Compile::_default::DropLast::(&ec); - _r0 = _in0.clone(); - continue 'TAIL_CALL_START; - } + let mut ret = MaybePlacebo::>::new(); + let mut result: Sequence = seq![] as Sequence; + let mut _hi0: u64 = truncate!(ec.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + result = result.concat(&_default::WriteAADPair(&ec.get(&int!((&i).clone())))); } + ret = MaybePlacebo::from(result.clone()); + return ret.read(); } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(430,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(457,3) pub fn WriteAADPair(pair: &ESDKEncryptionContextPair) -> Sequence { crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(pair.key()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(pair.value())) } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(439,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(466,3) pub fn ReadAADPair(buffer: &Arc) -> Arc>, Arc>> { let mut valueOrError0: Arc>>, Arc>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(buffer); if valueOrError0.IsFailure() { @@ -73400,7 +73475,7 @@ pub mod _EncryptionContext_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(462,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(489,3) pub fn ReadAADPairs(buffer: &Arc, accumulator: &ESDKCanonicalEncryptionContext, keys: &Set, count: u16, nextPair: &Arc) -> Arc>, Arc>> { let mut _r0 = buffer.clone(); let mut _r1 = accumulator.clone(); @@ -73413,7 +73488,7 @@ pub mod _EncryptionContext_Compile { let keys = _r2; let count = _r3; let nextPair = _r4; - if accumulator.cardinality() < int!(count) { + if truncate!(accumulator.cardinality(), u16) < count { let mut valueOrError0: Arc>, Arc>> = _default::ReadAADPair(&nextPair); if valueOrError0.IsFailure() { return valueOrError0.PropagateFailure::>>(); @@ -73427,7 +73502,7 @@ pub mod _EncryptionContext_Compile { if valueOrError1.IsFailure() { return valueOrError1.PropagateFailure::>>(); } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(newPos.start().clone() - buffer.start().clone() < crate::implementation_from_dafny::_SerializableTypes_Compile::_default::ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH(), &Arc::new(ReadProblems::Error { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(newPos.start().clone() >= buffer.start().clone() && newPos.start().clone() - buffer.start().clone() < crate::implementation_from_dafny::_SerializableTypes_Compile::_default::ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH(), &Arc::new(ReadProblems::Error { message: string_utf16_of("Encryption Context exceeds maximum length.") })); if valueOrError2.IsFailure() { @@ -73459,7 +73534,7 @@ pub mod _EncryptionContext_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(510,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(537,3) pub fn ReadAAD(buffer: &Arc) -> Arc>, Arc>> { let mut valueOrError0: Arc>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(buffer); if valueOrError0.IsFailure() { @@ -73496,7 +73571,7 @@ pub mod _EncryptionContext_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(529,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(556,3) pub fn ReadAADSection(buffer: &Arc) -> Arc>, Arc>> { let mut valueOrError0: Arc>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(buffer); if valueOrError0.IsFailure() { @@ -73512,8 +73587,8 @@ pub mod _EncryptionContext_Compile { }) }) } else { - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(length.tail().start().clone() + int!(length.data().clone()) <= length.tail().bytes().cardinality(), &Arc::new(ReadProblems::MoreNeeded { - pos: length.tail().start().clone() + int!(length.data().clone()) + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(length.tail().start().clone(), length.data().clone() as u64) <= truncate!(length.tail().bytes().cardinality(), u64), &Arc::new(ReadProblems::MoreNeeded { + pos: crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(length.tail().start().clone(), length.data().clone() as u64) })); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>>() @@ -73550,7 +73625,7 @@ pub mod _EncryptionContext_Compile { valueOrError5.PropagateFailure::>>() } else { let mut aad: Arc> = valueOrError5.Extract(); - let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(aad.tail().start().clone() - length.tail().start().clone() == int!(length.data().clone()), &Arc::new(ReadProblems::Error { + let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(aad.tail().start().clone() >= length.tail().start().clone() && aad.tail().start().clone() - length.tail().start().clone() == length.data().clone() as u64, &Arc::new(ReadProblems::Error { message: string_utf16_of("AAD Length did not match stored length.") })); if valueOrError6.IsFailure() { @@ -73568,7 +73643,7 @@ pub mod _EncryptionContext_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(582,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(610,3) pub fn KeysToSet<_K: DafnyTypeEq, _V: DafnyTypeEq>(pairs: &Sequence>>) -> Set<_K> { (&({ let mut pairs = pairs.clone(); @@ -73586,10 +73661,10 @@ pub mod _EncryptionContext_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(24,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(25,3) pub type ESDKEncryptionContextPair = Arc>; - /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(30,3) + /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(31,3) pub type ESDKCanonicalEncryptionContext = Sequence; } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(6,1) @@ -73602,18 +73677,18 @@ pub mod _ErrorMessages_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; - pub use ::dafny_runtime::DafnyInt; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(21,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(23,3) pub fn IncorrectRawDataKeys(datakey: &Sequence, keyringName: &Sequence, keyProviderId: &Sequence) -> Sequence { string_utf16_of("EncryptedDataKey ").concat(datakey).concat(&string_utf16_of(" did not match ")).concat(keyringName).concat(&string_utf16_of(". ")).concat(&string_utf16_of("Expected: keyProviderId: ")).concat(keyProviderId).concat(&string_utf16_of(".\n")) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(31,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(33,3) pub fn IncorrectDataKeys(encryptedDataKeys: &Sequence>, material: &Arc, errMsg: &Sequence) -> Arc, Arc>> { let mut valueOrError0: Arc, Arc>> = _default::IncorrectDataKeysExpectedValues(encryptedDataKeys, material, errMsg); if valueOrError0.IsFailure() { @@ -73625,7 +73700,7 @@ pub mod _ErrorMessages_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(38,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(40,3) pub fn IncorrectDataKeysExpectedValues(encryptedDataKeys: &Sequence>, material: &Arc, errMsg: &Sequence) -> Arc, Arc>> { let mut _r0 = encryptedDataKeys.clone(); let mut _r1 = material.clone(); @@ -73634,12 +73709,12 @@ pub mod _ErrorMessages_Compile { let encryptedDataKeys = _r0; let material = _r1; let errMsg = _r2; - if encryptedDataKeys.cardinality() == int!(0) { + if truncate!(encryptedDataKeys.cardinality(), u64) == 0 { return Arc::new(Result::, Arc>::Success { value: errMsg.clone() }); } else { - let mut encryptedDataKey: Arc = encryptedDataKeys.get(&int!(0)); + let mut encryptedDataKey: Arc = encryptedDataKeys.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())); let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(encryptedDataKey.keyProviderId()).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -73663,7 +73738,7 @@ pub mod _ErrorMessages_Compile { } else { let mut extractedKeyProviderInfo: Sequence = valueOrError1.Extract(); if extractedKeyProviderId.clone() != string_utf16_of("aws-kms-hierarchy") { - let mut _in0: Sequence> = encryptedDataKeys.drop(&int!(1)); + let mut _in0: Sequence> = encryptedDataKeys.drop(&int!((&truncate!((&int!(1)).clone(), u32)).clone())); let mut _in1: Arc = material.clone(); let mut _in2: Sequence = errMsg.concat(&string_utf16_of("KeyProviderId: ")).concat(&extractedKeyProviderId).concat(&string_utf16_of(", KeyProviderInfo: ")).concat(&extractedKeyProviderInfo).concat(&string_utf16_of("\n")); _r0 = _in0.clone(); @@ -73676,21 +73751,21 @@ pub mod _ErrorMessages_Compile { return valueOrError2.PropagateFailure::>(); } else { let mut providerWrappedMaterial: Sequence = valueOrError2.Extract(); - let mut EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX: DafnyInt = _default::SALT_LENGTH() + _default::IV_LENGTH(); - let mut EDK_CIPHERTEXT_VERSION_INDEX: DafnyInt = EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX.clone() + _default::VERSION_LENGTH(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX.clone() < EDK_CIPHERTEXT_VERSION_INDEX.clone(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX: u64 = _default::SALT_LENGTH() + _default::IV_LENGTH(); + let mut EDK_CIPHERTEXT_VERSION_INDEX: u64 = EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX + _default::VERSION_LENGTH(); + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX < EDK_CIPHERTEXT_VERSION_INDEX, &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Wrong branch key version index.") })); if valueOrError3.IsFailure() { return valueOrError3.PropagateFailure::>(); } else { - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerWrappedMaterial.cardinality() >= EDK_CIPHERTEXT_VERSION_INDEX.clone(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerWrappedMaterial.cardinality(), u64) >= EDK_CIPHERTEXT_VERSION_INDEX, &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Incorrect ciphertext structure.") })); if valueOrError4.IsFailure() { return valueOrError4.PropagateFailure::>(); } else { - let mut branchKeyVersionUuid: Sequence = providerWrappedMaterial.slice(&EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX, &EDK_CIPHERTEXT_VERSION_INDEX); + let mut branchKeyVersionUuid: Sequence = providerWrappedMaterial.slice(&int!((&EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX).clone()), &int!((&EDK_CIPHERTEXT_VERSION_INDEX).clone())); let mut valueOrError5: Arc, Arc>> = crate::implementation_from_dafny::UUID::_default::FromByteArray(&branchKeyVersionUuid).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -73702,7 +73777,7 @@ pub mod _ErrorMessages_Compile { return valueOrError5.PropagateFailure::>(); } else { let mut branchVersion: Sequence = valueOrError5.Extract(); - let mut _in3: Sequence> = encryptedDataKeys.drop(&int!(1)); + let mut _in3: Sequence> = encryptedDataKeys.drop(&int!((&truncate!((&int!(1)).clone(), u32)).clone())); let mut _in4: Arc = material.clone(); let mut _in5: Sequence = errMsg.concat(&string_utf16_of("KeyProviderId: ")).concat(&extractedKeyProviderId).concat(&string_utf16_of(", KeyProviderInfo: ")).concat(&extractedKeyProviderInfo).concat(&string_utf16_of(", BranchKeyVersion: ")).concat(&branchVersion).concat(&string_utf16_of("\n")); _r0 = _in3.clone(); @@ -73719,33 +73794,33 @@ pub mod _ErrorMessages_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(13,3) - pub fn SALT_LENGTH() -> DafnyInt { - int!(16) - } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(14,3) - pub fn IV_LENGTH() -> DafnyInt { - int!(12) - } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(15,3) - pub fn VERSION_LENGTH() -> DafnyInt { - int!(16) + pub fn SALT_LENGTH() -> u64 { + 16 + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(16,3) + pub fn IV_LENGTH() -> u64 { + 12 } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(17,3) + pub fn VERSION_LENGTH() -> u64 { + 16 + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(19,3) pub fn KMS_ECDH_DISCOVERY_ENCRYPT_ERROR() -> Sequence { string_utf16_of("KmsPublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt.") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(18,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(20,3) pub fn RAW_ECDH_DISCOVERY_ENCRYPT_ERROR() -> Sequence { string_utf16_of("PublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt.") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(19,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(21,3) pub fn RAW_ECDH_EPHEMERAL_DECRYPT_ERROR() -> Sequence { string_utf16_of("EphemeralPrivateKeyToStaticPublicKey Key Agreement Scheme is forbidden on decrypt.") } } } -/// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(35,1) +/// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(37,1) pub mod ExternDigest { pub use ::dafny_runtime::Sequence; pub use ::std::sync::Arc; @@ -73755,13 +73830,13 @@ pub mod ExternDigest { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(48,3) + /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(50,3) pub fn CreateDigestSuccess(bytes: &Sequence) -> Arc, Arc>> { Arc::new(Result::, Arc>::Success { value: bytes.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(52,3) + /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(54,3) pub fn CreateDigestFailure(error: &Arc) -> Arc, Arc>> { Arc::new(Result::, Arc>::Failure { error: error.clone() @@ -73769,7 +73844,7 @@ pub mod ExternDigest { } } } -/// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(27,1) +/// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(29,1) pub mod ExternRandom { pub use ::dafny_runtime::Sequence; pub use ::std::sync::Arc; @@ -73779,13 +73854,13 @@ pub mod ExternRandom { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(39,3) + /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(41,3) pub fn CreateGenerateBytesSuccess(bytes: &Sequence) -> Arc, Arc>> { Arc::new(Result::, Arc>::Success { value: bytes.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(43,3) + /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(45,3) pub fn CreateGenerateBytesFailure(error: &Arc) -> Arc, Arc>> { Arc::new(Result::, Arc>::Failure { error: error.clone() @@ -73801,7 +73876,7 @@ pub mod ExternRandom { /// non-ASCII Unicode codepoints may cause different language- or platform-specific behavior. /// /// File path symbols including . and .. are allowed. -/// ../mpl/libraries/src/FileIO/FileIO.dfy(20,1) +/// ../mpl/libraries/src/FileIO/FileIO.dfy(21,1) pub mod _FileIO_Compile { pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::DafnyCharUTF16; @@ -73817,7 +73892,7 @@ pub mod _FileIO_Compile { /// error message (which may also contain a stack trace). /// /// NOTE: See the module description for limitations on the path argument. - /// ../mpl/libraries/src/FileIO/FileIO.dfy(36,3) + /// ../mpl/libraries/src/FileIO/FileIO.dfy(38,3) pub fn ReadBytesFromFile(path: &Sequence) -> Arc, Sequence>> { let mut res: Arc, Sequence>>; let mut isError: bool; @@ -73850,7 +73925,7 @@ pub mod _FileIO_Compile { /// error message (which may also contain a stack trace). /// /// NOTE: See the module description for limitations on the path argument. - /// ../mpl/libraries/src/FileIO/FileIO.dfy(49,3) + /// ../mpl/libraries/src/FileIO/FileIO.dfy(51,3) pub fn WriteBytesToFile(path: &Sequence, bytes: &Sequence) -> Arc>> { let mut res: Arc>>; let mut isError: bool; @@ -73879,7 +73954,7 @@ pub mod _FileIO_Compile { /// error message (which may also contain a stack trace). /// /// NOTE: See the module description for limitations on the path argument. - /// ../mpl/libraries/src/FileIO/FileIO.dfy(63,3) + /// ../mpl/libraries/src/FileIO/FileIO.dfy(65,3) pub fn AppendBytesToFile(path: &Sequence, bytes: &Sequence) -> Arc>> { let mut res: Arc>>; let mut isError: bool; @@ -74214,7 +74289,7 @@ pub mod _Fixtures_Compile { } /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(23,3) pub fn branchKeyId() -> Sequence { - string_utf16_of("75789115-1deb-4fe3-a2ec-be9e885d1945") + string_utf16_of("3f43a9af-08c5-4317-b694-3d3e883dcaef") } /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(26,3) pub fn RESERVED_ENCRYPTION_CONTEXT() -> ValidUTF8Bytes { @@ -74746,10 +74821,8 @@ pub mod _Frames_Compile { pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use ::dafny_runtime::string_utf16_of; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq32; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64; - pub use ::dafny_runtime::DafnyInt; pub use crate::implementation_from_dafny::_Header_Compile::HeaderInfo; pub use crate::implementation_from_dafny::_Header_Compile::Header; pub use ::std::fmt::Debug; @@ -74781,17 +74854,17 @@ pub mod _Frames_Compile { if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>>() } else { - let mut valueOrError2: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(sequenceNumber.tail(), &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite())).clone())); + let mut valueOrError2: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(sequenceNumber.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite()) as u64); if valueOrError2.IsFailure() { valueOrError2.PropagateFailure::>>() } else { let mut iv: Arc>> = valueOrError2.Extract(); - let mut valueOrError3: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(iv.tail(), &int!(header.body().frameLength().clone())); + let mut valueOrError3: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(iv.tail(), header.body().frameLength().clone() as u64); if valueOrError3.IsFailure() { valueOrError3.PropagateFailure::>>() } else { let mut encContent: Arc>> = valueOrError3.Extract(); - let mut valueOrError4: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite())).clone())); + let mut valueOrError4: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite()) as u64); if valueOrError4.IsFailure() { valueOrError4.PropagateFailure::>>() } else { @@ -74837,7 +74910,7 @@ pub mod _Frames_Compile { valueOrError2.PropagateFailure::>>() } else { let mut sequenceNumber: Arc> = valueOrError2.Extract(); - let mut valueOrError3: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(sequenceNumber.tail(), &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite())).clone())); + let mut valueOrError3: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(sequenceNumber.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite()) as u64); if valueOrError3.IsFailure() { valueOrError3.PropagateFailure::>>() } else { @@ -74858,7 +74931,7 @@ pub mod _Frames_Compile { valueOrError6.PropagateFailure::>>() } else { let mut encContent: Arc>> = valueOrError6.Extract(); - let mut valueOrError7: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite())).clone())); + let mut valueOrError7: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite()) as u64); if valueOrError7.IsFailure() { valueOrError7.PropagateFailure::>>() } else { @@ -74887,7 +74960,7 @@ pub mod _Frames_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(291,3) pub fn ReadNonFrame(buffer: &Arc, header: &NonFramedHeader) -> Arc>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite())).clone())); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite()) as u64); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -74897,7 +74970,7 @@ pub mod _Frames_Compile { valueOrError1.PropagateFailure::>>() } else { let mut contentLength: Arc> = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(contentLength.data().clone()) < _default::SAFE_MAX_ENCRYPT(), &Arc::new(ReadProblems::Error { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(contentLength.data().clone() < _default::SAFE_MAX_ENCRYPT(), &Arc::new(ReadProblems::Error { message: string_utf16_of("Frame exceeds AES-GCM cryptographic safety for a single key/iv.") })); if valueOrError2.IsFailure() { @@ -74908,7 +74981,7 @@ pub mod _Frames_Compile { valueOrError3.PropagateFailure::>>() } else { let mut encContent: Arc>> = valueOrError3.Extract(); - let mut valueOrError4: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite())).clone())); + let mut valueOrError4: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite()) as u64); if valueOrError4.IsFailure() { valueOrError4.PropagateFailure::>>() } else { @@ -74937,8 +75010,8 @@ pub mod _Frames_Compile { } /// 2^36 - 32 /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(138,3) - pub fn SAFE_MAX_ENCRYPT() -> DafnyInt { - int!(b"68719476704") + pub fn SAFE_MAX_ENCRYPT() -> u64 { + 68719476704 } /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(27,3) pub fn START_SEQUENCE_NUMBER() -> u32 { @@ -76219,19 +76292,19 @@ pub mod _GetOpt_Compile { let mut sub: Arc = valueOrError1.Extract(); Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Sequence>::Success { value: { - let __pat_let5_0: Arc = args.clone(); + let __pat_let7_0: Arc = args.clone(); { - let _dt__update__tmp_h0: Arc = __pat_let5_0.clone(); + let _dt__update__tmp_h0: Arc = __pat_let7_0.clone(); { - let __pat_let6_0: Arc>> = Arc::new(Option::>::Some { + let __pat_let8_0: Arc>> = Arc::new(Option::>::Some { value: sub.clone() }); { - let _dt__update_hsubcommand_h0: Arc>> = __pat_let6_0.clone(); + let _dt__update_hsubcommand_h0: Arc>> = __pat_let8_0.clone(); { - let __pat_let7_0: Sequence> = args.params().concat(&newParams); + let __pat_let9_0: Sequence> = args.params().concat(&newParams); { - let _dt__update_hparams_h0: Sequence> = __pat_let7_0.clone(); + let _dt__update_hparams_h0: Sequence> = __pat_let9_0.clone(); Arc::new(Parsed::Parsed { command: _dt__update__tmp_h0.command().clone(), params: _dt__update_hparams_h0.clone(), @@ -76254,13 +76327,13 @@ pub mod _GetOpt_Compile { } else { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Sequence>::Success { value: { - let __pat_let8_0: Arc = args.clone(); + let __pat_let10_0: Arc = args.clone(); { - let _dt__update__tmp_h1: Arc = __pat_let8_0.clone(); + let _dt__update__tmp_h1: Arc = __pat_let10_0.clone(); { - let __pat_let9_0: Sequence> = args.params().concat(&newParams); + let __pat_let11_0: Sequence> = args.params().concat(&newParams); { - let _dt__update_hparams_h1: Sequence> = __pat_let9_0.clone(); + let _dt__update_hparams_h1: Sequence> = __pat_let11_0.clone(); Arc::new(Parsed::Parsed { command: _dt__update__tmp_h1.command().clone(), params: _dt__update_hparams_h1.clone(), @@ -77723,24 +77796,21 @@ pub mod _HKDF_Compile { pub use crate::implementation_from_dafny::HMAC::HMac; pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::rd; - pub use ::dafny_runtime::DafnyInt; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm; pub use ::dafny_runtime::MaybePlacebo; - pub use ::dafny_runtime::euclidian_division; - pub use ::dafny_runtime::int; pub use ::dafny_runtime::seq; pub use ::dafny_runtime::truncate; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(38,3) + /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(39,3) pub fn Extract(hmac: &Object, salt: &Sequence, ikm: &Sequence) -> Sequence { let mut prk: Sequence; rd!(hmac).Init(salt); @@ -77750,34 +77820,34 @@ pub mod _HKDF_Compile { prk = prk.clone(); return prk.clone(); } - /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(128,3) - pub fn Expand(hmac: &Object, prk: &Sequence, info: &Sequence, expectedLength: &DafnyInt, digest: &Arc) -> Sequence { + /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(129,3) + pub fn Expand(hmac: &Object, prk: &Sequence, info: &Sequence, expectedLength: u64, digest: &Arc) -> Sequence { let mut okm = MaybePlacebo::>::new(); - let mut hashLength: DafnyInt = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digest); - let mut n: DafnyInt = euclidian_division(hashLength.clone() + expectedLength.clone() - int!(1), hashLength.clone()); + let mut hashLength: u64 = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digest); + let mut n: u64 = (hashLength + expectedLength - 1) / hashLength; rd!(hmac).Init(prk); let mut t_prev: Sequence = seq![] as Sequence; let mut t_n: Sequence = t_prev.clone(); - let mut i: DafnyInt = int!(1); - while i.clone() <= n.clone() { + let mut i: u64 = 1; + while i <= n { rd!(hmac).BlockUpdate(&t_prev); rd!(hmac).BlockUpdate(info); - rd!(hmac).BlockUpdate(&seq![truncate!(i.clone(), u8)]); + rd!(hmac).BlockUpdate(&seq![i as u8]); let mut _out0: Sequence = rd!(hmac).GetResult(); t_prev = _out0.clone(); t_n = t_n.concat(&t_prev); - i = i.clone() + int!(1); + i = i + 1; }; okm = MaybePlacebo::from(t_n.clone()); - if expectedLength.clone() < okm.read().cardinality() { - okm = MaybePlacebo::from(okm.read().take(expectedLength)); + if expectedLength < truncate!(okm.read().cardinality(), u64) { + okm = MaybePlacebo::from(okm.read().take(&int!((&expectedLength).clone()))); }; return okm.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(206,3) - pub fn Hkdf(digest: &Arc, salt: &Arc>>, ikm: &Sequence, info: &Sequence, L: &DafnyInt) -> Sequence { + /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(208,3) + pub fn Hkdf(digest: &Arc, salt: &Arc>>, ikm: &Sequence, info: &Sequence, L: u64) -> Sequence { let mut okm = MaybePlacebo::>::new(); - if L.clone() == int!(0) { + if L == 0 { okm = MaybePlacebo::from(seq![] as Sequence); return okm.read(); }; @@ -77788,11 +77858,11 @@ pub mod _HKDF_Compile { panic!("Halt") }; let mut hmac: Object = valueOrError0.Extract(); - let mut hashLength: nat = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digest); + let mut hashLength: u64 = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digest); let mut nonEmptySalt: Sequence; let mut _source0: Arc>> = salt.clone(); if matches!((&_source0).as_ref(), None{ .. }) { - nonEmptySalt = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Fill::(&truncate!((&int!(0)).clone(), u8), &hashLength); + nonEmptySalt = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Fill::(&truncate!((&int!(0)).clone(), u8), &int!((&hashLength).clone())); } else { let mut ___mcc_h0: Sequence = _source0.value().clone(); let mut s: Sequence = ___mcc_h0.clone(); @@ -77851,7 +77921,7 @@ pub mod _Header_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers; @@ -77873,7 +77943,6 @@ pub mod _Header_Compile { pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16; pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptionContext; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderAuth; pub use ::std::fmt::Debug; @@ -77888,11 +77957,11 @@ pub mod _Header_Compile { pub struct _default {} impl _default { - /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(81,3) + /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(82,3) pub fn _HeaderVersionSupportsCommitment_q(suite: &Arc, body: &Arc) -> bool { - (!matches!(suite.commitment().as_ref(), HKDF{ .. }) || matches!(body.as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V2HeaderBody{ .. }) && body.suiteData().cardinality() == int!(suite.commitment().HKDF().outputKeyLength().clone())) && (!(!matches!(suite.commitment().as_ref(), HKDF{ .. })) || true && matches!(body.as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V1HeaderBody{ .. })) + (!matches!(suite.commitment().as_ref(), HKDF{ .. }) || matches!(body.as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V2HeaderBody{ .. }) && truncate!(body.suiteData().cardinality(), u64) == suite.commitment().HKDF().outputKeyLength().clone() as u64) && (!(!matches!(suite.commitment().as_ref(), HKDF{ .. })) || true && matches!(body.as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V1HeaderBody{ .. })) } - /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(111,3) + /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(117,3) pub fn ReadHeaderBody(buffer: &Arc, maxEdks: &Arc>, mpl: &Object) -> Arc>>, Arc>> { let mut valueOrError0: Arc>>, Arc>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadMessageFormatVersion(buffer); if valueOrError0.IsFailure() { @@ -77964,7 +78033,7 @@ pub mod _Header_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(161,3) + /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(167,3) pub fn WriteHeaderBody(body: &Arc) -> Sequence { let mut _source0: Arc = body.clone(); if matches!((&_source0).as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V1HeaderBody{ .. }) { @@ -77974,7 +78043,7 @@ pub mod _Header_Compile { let mut ___mcc_h3: ESDKCanonicalEncryptionContext = _source0.encryptionContext().clone(); let mut ___mcc_h4: seq16 = _source0.encryptedDataKeys().clone(); let mut ___mcc_h5: Arc = _source0.contentType().clone(); - let mut ___mcc_h6: nat = _source0.headerIvLength().clone(); + let mut ___mcc_h6: u64 = _source0.headerIvLength().clone(); let mut ___mcc_h7: u32 = _source0.frameLength().clone(); crate::implementation_from_dafny::_V1HeaderBody_Compile::_default::WriteV1HeaderBody(body) } else { @@ -77990,7 +78059,7 @@ pub mod _Header_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(34,3) + /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(35,3) #[derive(PartialEq, Clone)] pub enum HeaderInfo { HeaderInfo { @@ -78102,7 +78171,7 @@ pub mod _Header_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(95,3) + /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(101,3) pub type Header = Arc; } /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(11,1) @@ -78117,11 +78186,7 @@ pub mod _HeaderAuth_Compile { pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderAuth; - pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::integer_range; - pub use ::dafny_runtime::Zero; pub struct _default {} @@ -78156,12 +78221,12 @@ pub mod _HeaderAuth_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(84,3) pub fn ReadHeaderAuthTagV1(buffer: &Arc, suite: &Arc) -> Arc>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite)).clone())); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite) as u64); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { let mut headerIv: Arc>> = valueOrError0.Extract(); - let mut valueOrError1: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(headerIv.tail(), &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(suite)).clone())); + let mut valueOrError1: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(headerIv.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(suite) as u64); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>>() } else { @@ -78181,15 +78246,8 @@ pub mod _HeaderAuth_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(110,3) pub fn ReadHeaderAuthTagV2(buffer: &Arc, suite: &Arc) -> Arc>, Arc>> { - let mut headerIv: Sequence = { - let _initializer = { - Arc::new(move |_v1: &DafnyInt| -> u8{ - 0 - }) - }; - integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite))).map(move |i| _initializer(&i)).collect::>() - }; - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!((&crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(suite)).clone())); + let mut headerIv: Sequence = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLengthZeros(suite); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(suite) as u64); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -78229,8 +78287,6 @@ pub mod _HeaderAuth_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(9,1) pub mod _HeaderTypes_Compile { - pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::int; pub use ::std::sync::Arc; pub use ::dafny_runtime::Sequence; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion::V1; @@ -78238,6 +78294,8 @@ pub mod _HeaderTypes_Compile { pub use ::dafny_runtime::DafnyCharUTF16; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use ::dafny_runtime::string_utf16_of; + pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::std::fmt::Debug; pub use ::std::fmt::Formatter; pub use ::dafny_runtime::DafnyPrint; @@ -78251,19 +78309,18 @@ pub mod _HeaderTypes_Compile { pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16; pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType::NonFramed; pub struct _default {} impl _default { /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(161,3) - pub fn MESSAGE_ID_LEN_V1() -> DafnyInt { - int!(16) + pub fn MESSAGE_ID_LEN_V1() -> u64 { + 16 } /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(162,3) - pub fn MESSAGE_ID_LEN_V2() -> DafnyInt { - int!(32) + pub fn MESSAGE_ID_LEN_V2() -> u64 { + 32 } } @@ -78291,7 +78348,7 @@ pub mod _HeaderTypes_Compile { valueOrError0.PropagateFailure::>() } else { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Sequence>::Success { - value: if x.get(&int!(0)) == 1 { + value: if x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) == 1 { Arc::new(MessageFormatVersion::V1 {}) } else { Arc::new(MessageFormatVersion::V2 {}) @@ -78375,7 +78432,7 @@ pub mod _HeaderTypes_Compile { encryptionContext: ESDKCanonicalEncryptionContext, encryptedDataKeys: seq16, contentType: Arc, - headerIvLength: nat, + headerIvLength: u64, frameLength: u32 }, V2HeaderBody { @@ -78433,7 +78490,7 @@ pub mod _HeaderTypes_Compile { } } /// Gets the field headerIvLength for all enum members which have it - pub fn headerIvLength(&self) -> &nat { + pub fn headerIvLength(&self) -> &u64 { match self { HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => headerIvLength, HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => panic!("field does not exist on this variant"), @@ -78941,11 +78998,16 @@ pub mod _HexStrings_Compile { } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(9,1) pub mod _IntermediateKeyWrapping_Compile { + pub use ::dafny_runtime::Sequence; + pub use ::dafny_runtime::seq; + pub use ::std::sync::Arc; + pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::integer_range; + pub use ::dafny_runtime::Zero; + pub use ::dafny_runtime::int; pub use ::dafny_runtime::DafnyType; pub use ::dafny_runtime::Object; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial; - pub use ::dafny_runtime::Sequence; - pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; @@ -78958,19 +79020,16 @@ pub mod _IntermediateKeyWrapping_Compile { pub use crate::implementation_from_dafny::_Actions_Compile::Action; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput; pub use ::dafny_runtime::rd; - pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::integer_range; - pub use ::dafny_runtime::Zero; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput; - pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput; + pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput; @@ -78986,7 +79045,22 @@ pub mod _IntermediateKeyWrapping_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(49,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(57,3) + pub fn GetIvLengthZeros(len: i32) -> Sequence { + if len == 12 { + seq![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + } else { + { + let _initializer = { + Arc::new(move |_v0: &DafnyInt| -> u8{ + 0 + }) + }; + integer_range(Zero::zero(), int!(len)).map(move |i| _initializer(&i)).collect::>() + } + } + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(69,3) pub fn IntermediateUnwrap<_T: DafnyType>(unwrap: &Object>, wrappedMaterial: &Sequence, algorithmSuite: &Arc, encryptionContext: &Map) -> Arc>, Arc>> { let mut res = MaybePlacebo::>, Arc>>>::new(); let mut maybeCrypto: Arc, Arc>>; @@ -79014,11 +79088,13 @@ pub mod _IntermediateKeyWrapping_Compile { let mut __let_tmp_rhs0: Arc = deserializedWrapped.clone(); let mut encryptedPdk: Sequence = __let_tmp_rhs0.encryptedPdk().clone(); let mut providerWrappedIkm: Sequence = __let_tmp_rhs0.providerWrappedIkm().clone(); + let mut serializedEC: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext); let mut valueOrError2: Arc>, Arc>>; let mut _out1: Arc>, Arc>> = Action::, Arc>, Arc>>>::Invoke(rd!(unwrap.clone()), &Arc::new(UnwrapInput::UnwrapInput { wrappedMaterial: providerWrappedIkm.clone(), algorithmSuite: algorithmSuite.clone(), - encryptionContext: encryptionContext.clone() + encryptionContext: encryptionContext.clone(), + serializedEC: serializedEC.clone() })); valueOrError2 = _out1.clone(); if valueOrError2.IsFailure() { @@ -79040,16 +79116,9 @@ pub mod _IntermediateKeyWrapping_Compile { let mut __let_tmp_rhs2: Arc = derivedKeys.clone(); let mut pdkEncryptionKey: Sequence = __let_tmp_rhs2.pdkEncryptionKey().clone(); let mut symmetricSigningKey: Sequence = __let_tmp_rhs2.symmetricSigningKey().clone(); - let mut iv: Sequence = { - let _initializer = { - Arc::new(move |_v0: &DafnyInt| -> u8{ - 0 - }) - }; - integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptIvLength(algorithmSuite))).map(move |i| _initializer(&i)).collect::>() - }; - let mut tagIndex: DafnyInt = encryptedPdk.cardinality() - int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algorithmSuite)); - let mut valueOrError4: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext); + let mut iv: Sequence = _default::GetIvLengthZeros(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptIvLength(algorithmSuite)); + let mut tagIndex: u64 = truncate!(encryptedPdk.cardinality(), u64) - crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algorithmSuite) as u64; + let mut valueOrError4: Arc, Arc>> = serializedEC.clone(); if valueOrError4.IsFailure() { res = MaybePlacebo::from(valueOrError4.PropagateFailure::>>()); return res.read(); @@ -79058,8 +79127,8 @@ pub mod _IntermediateKeyWrapping_Compile { let mut decInput: Arc = Arc::new(AESDecryptInput::AESDecryptInput { encAlg: algorithmSuite.encrypt().AES_GCM().clone(), key: pdkEncryptionKey.clone(), - cipherTxt: encryptedPdk.take(&tagIndex), - authTag: encryptedPdk.drop(&tagIndex), + cipherTxt: encryptedPdk.take(&int!((&tagIndex).clone())), + authTag: encryptedPdk.drop(&int!((&tagIndex).clone())), iv: iv.clone(), aad: aad.clone() }); @@ -79078,13 +79147,6 @@ pub mod _IntermediateKeyWrapping_Compile { return res.read(); }; let mut plaintextDataKey: Sequence = valueOrError5.Extract(); - let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(plaintextDataKey.cardinality() == int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algorithmSuite)), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Unexpected AES_GCM Decrypt length") - })); - if valueOrError6.IsFailure() { - res = MaybePlacebo::from(valueOrError6.PropagateFailure::>>()); - return res.read(); - }; res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>, Arc>::Success { value: Arc::new(IntermediateUnwrapOutput::<_T>::IntermediateUnwrapOutput { plaintextDataKey: plaintextDataKey.clone(), @@ -79094,7 +79156,7 @@ pub mod _IntermediateKeyWrapping_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(130,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(152,3) pub fn IntermediateWrap<_T: DafnyType>(generateAndWrap: &Object>, plaintextDataKey: &Sequence, algorithmSuite: &Arc, encryptionContext: &Map) -> Arc>, Arc>> { let mut res = MaybePlacebo::>, Arc>>>::new(); let mut maybeCrypto: Arc, Arc>>; @@ -79116,7 +79178,8 @@ pub mod _IntermediateKeyWrapping_Compile { let mut valueOrError1: Arc>, Arc>>; let mut _out1: Arc>, Arc>> = Action::, Arc>, Arc>>>::Invoke(rd!(generateAndWrap.clone()), &Arc::new(GenerateAndWrapInput::GenerateAndWrapInput { algorithmSuite: algorithmSuite.clone(), - encryptionContext: encryptionContext.clone() + encryptionContext: encryptionContext.clone(), + serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext) })); valueOrError1 = _out1.clone(); if valueOrError1.IsFailure() { @@ -79139,14 +79202,7 @@ pub mod _IntermediateKeyWrapping_Compile { let mut __let_tmp_rhs1: Arc = derivedKeys.clone(); let mut pdkEncryptionKey: Sequence = __let_tmp_rhs1.pdkEncryptionKey().clone(); let mut symmetricSigningKey: Sequence = __let_tmp_rhs1.symmetricSigningKey().clone(); - let mut iv: Sequence = { - let _initializer = { - Arc::new(move |_v1: &DafnyInt| -> u8{ - 0 - }) - }; - integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptIvLength(algorithmSuite))).map(move |i| _initializer(&i)).collect::>() - }; + let mut iv: Sequence = _default::GetIvLengthZeros(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptIvLength(algorithmSuite)); let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::>>()); @@ -79175,13 +79231,6 @@ pub mod _IntermediateKeyWrapping_Compile { return res.read(); }; let mut encryptedPdk: Arc = valueOrError4.Extract(); - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(encryptedPdk.cipherText().concat(encryptedPdk.authTag()).cardinality() == int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algorithmSuite) + crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algorithmSuite)), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Unexpected AES_GCM Encrypt length") - })); - if valueOrError5.IsFailure() { - res = MaybePlacebo::from(valueOrError5.PropagateFailure::>>()); - return res.read(); - }; let mut serializedMaterial: Sequence = encryptedPdk.cipherText().concat(encryptedPdk.authTag()).concat(&providerWrappedIkm); res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>, Arc>::Success { value: Arc::new(IntermediateWrapOutput::<_T>::IntermediateWrapOutput { @@ -79192,7 +79241,7 @@ pub mod _IntermediateKeyWrapping_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(232,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(255,3) pub fn IntermediateGenerateAndWrap<_T: DafnyType>(generateAndWrap: &Object>, algorithmSuite: &Arc, encryptionContext: &Map) -> Arc>, Arc>> { let mut res = MaybePlacebo::>, Arc>>>::new(); let mut maybeCrypto: Arc, Arc>>; @@ -79245,9 +79294,9 @@ pub mod _IntermediateKeyWrapping_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(286,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(310,3) pub fn DeserializeIntermediateWrappedMaterial(material: &Sequence, algSuite: &Arc) -> Arc, Arc>> { - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(material.cardinality() >= int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algSuite) + crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algSuite)), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(material.cardinality(), u64) >= (crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algSuite) + crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algSuite)) as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Unable to deserialize Intermediate Key Wrapped material: too short.") })); if valueOrError0.IsFailure() { @@ -79262,7 +79311,7 @@ pub mod _IntermediateKeyWrapping_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(304,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(329,3) pub fn DeriveKeysFromIntermediateMaterial(intermediateMaterial: &Sequence, algorithmSuite: &Arc, encryptionContext: &Map, cryptoPrimitives: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut hkdfExtractInput: Arc = Arc::new(HkdfExtractInput::HkdfExtractInput { @@ -79338,17 +79387,19 @@ pub mod _IntermediateKeyWrapping_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(24,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(25,3) pub fn KEYWRAP_MAC_INFO() -> ValidUTF8Bytes { - crate::implementation_from_dafny::UTF8::_default::EncodeAscii(&string_utf16_of("AWS_MPL_INTERMEDIATE_KEYWRAP_MAC")) + let mut s: Sequence = seq![65, 87, 83, 95, 77, 80, 76, 95, 73, 78, 84, 69, 82, 77, 69, 68, 73, 65, 84, 69, 95, 75, 69, 89, 87, 82, 65, 80, 95, 77, 65, 67]; + s.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(25,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(30,3) pub fn KEYWRAP_ENC_INFO() -> ValidUTF8Bytes { - crate::implementation_from_dafny::UTF8::_default::EncodeAscii(&string_utf16_of("AWS_MPL_INTERMEDIATE_KEYWRAP_ENC")) + let mut s: Sequence = seq![65, 87, 83, 95, 77, 80, 76, 95, 73, 78, 84, 69, 82, 77, 69, 68, 73, 65, 84, 69, 95, 75, 69, 89, 87, 82, 65, 80, 95, 69, 78, 67]; + s.clone() } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(27,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(35,3) #[derive(PartialEq, Clone)] pub enum IntermediateUnwrapOutput { IntermediateUnwrapOutput { @@ -79438,7 +79489,7 @@ pub mod _IntermediateKeyWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(34,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(42,3) #[derive(PartialEq, Clone)] pub enum IntermediateGenerateAndWrapOutput { IntermediateGenerateAndWrapOutput { @@ -79539,7 +79590,7 @@ pub mod _IntermediateKeyWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(42,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(50,3) #[derive(PartialEq, Clone)] pub enum IntermediateWrapOutput { IntermediateWrapOutput { @@ -79629,7 +79680,7 @@ pub mod _IntermediateKeyWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(279,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(303,3) #[derive(PartialEq, Clone)] pub enum DeserializedIntermediateWrappedMaterial { DeserializedIntermediateWrappedMaterial { @@ -79708,7 +79759,7 @@ pub mod _IntermediateKeyWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(299,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(324,3) #[derive(PartialEq, Clone)] pub enum PdkEncryptionAndSymmetricSigningKeys { PdkEncryptionAndSymmetricSigningKeys { @@ -82506,24 +82557,24 @@ pub mod _JSON_Compile { }) } else { { - let __pat_let10_0: View = View_::OfBytes(&seq![DafnyCharUTF16(101 as u16).0 as u8]); + let __pat_let12_0: View = View_::OfBytes(&seq![DafnyCharUTF16(101 as u16).0 as u8]); { - let e: je = __pat_let10_0.clone(); + let e: je = __pat_let12_0.clone(); { - let __pat_let11_0: jminus = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Sign(dec.e10()); + let __pat_let13_0: jminus = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Sign(dec.e10()); { - let sign: jsign = __pat_let11_0.clone(); + let sign: jsign = __pat_let13_0.clone(); { - let __pat_let12_0: Arc>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Int(&crate::implementation_from_dafny::_Math_Compile::_default::Abs(dec.e10())); + let __pat_let14_0: Arc>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Int(&crate::implementation_from_dafny::_Math_Compile::_default::Abs(dec.e10())); { - let valueOrError2: Arc>> = __pat_let12_0.clone(); + let valueOrError2: Arc>> = __pat_let14_0.clone(); if valueOrError2.IsFailure() { valueOrError2.PropagateFailure::>>>() } else { { - let __pat_let13_0: View = valueOrError2.Extract(); + let __pat_let15_0: View = valueOrError2.Extract(); { - let num: jnum = __pat_let13_0.clone(); + let num: jnum = __pat_let15_0.clone(); Arc::new(Result::>>, Arc>::Success { value: Arc::new(Maybe::>::NonEmpty { t: Arc::new(jexp::JExp { @@ -82957,9 +83008,9 @@ pub mod _JSON_Compile { crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\t")) } else { { - let __pat_let14_0: u16 = str.get(&start); + let __pat_let16_0: u16 = str.get(&start); { - let c: u16 = __pat_let14_0; + let c: u16 = __pat_let16_0; if c < truncate!(int!(31), u16) { crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\u")).concat(&crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::EscapeUnicode(c)) } else { @@ -87658,12 +87709,12 @@ pub mod _KMSKeystoreOperations_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptRequest; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(23,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(24,3) pub fn replaceRegion(arn: &Sequence, region: &Sequence) -> Sequence { let mut parsed: Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(arn); if matches!((&parsed).as_ref(), Failure{ .. }) { @@ -87683,7 +87734,7 @@ pub mod _KMSKeystoreOperations_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(38,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(39,3) pub fn GetArn(kmsConfiguration: &Arc, discoverdArn: &Sequence) -> Sequence { let mut _source0: Arc = kmsConfiguration.clone(); if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) { @@ -87708,7 +87759,7 @@ pub mod _KMSKeystoreOperations_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(48,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(49,3) pub fn _AttemptKmsOperation_q(kmsConfiguration: &Arc, encryptionContext: &BranchKeyContext) -> bool { let mut _source0: Arc = kmsConfiguration.clone(); if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) { @@ -87733,7 +87784,7 @@ pub mod _KMSKeystoreOperations_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(59,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(60,3) pub fn _Compatible_q(kmsConfiguration: &Arc, keyId: &Sequence) -> bool { let mut _source0: Arc = kmsConfiguration.clone(); if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) { @@ -87746,11 +87797,11 @@ pub mod _KMSKeystoreOperations_Compile { _default::MrkMatch(&arn, keyId) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(67,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(68,3) pub fn _OptCompatible_q(kmsConfiguration: &Arc, keyId: &Arc>>) -> bool { matches!(keyId.as_ref(), Some{ .. }) && _default::_Compatible_q(kmsConfiguration, keyId.value()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(73,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(74,3) pub fn MrkMatch(x: &Sequence, y: &Sequence) -> bool { let mut xArn: Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(x); let mut yArn: Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(y); @@ -87764,11 +87815,11 @@ pub mod _KMSKeystoreOperations_Compile { })) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(83,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(84,3) pub fn HasKeyId(kmsConfiguration: &Arc) -> bool { matches!(kmsConfiguration.as_ref(), kmsKeyArn{ .. }) || matches!(kmsConfiguration.as_ref(), kmsMRKeyArn{ .. }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(88,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(89,3) pub fn GetKeyId(kmsConfiguration: &Arc) -> Sequence { let mut _source0: Arc = kmsConfiguration.clone(); if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) { @@ -87781,7 +87832,7 @@ pub mod _KMSKeystoreOperations_Compile { arn.clone() } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(96,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(97,3) pub fn GenerateKey(encryptionContext: &BranchKeyContext, kmsConfiguration: &Arc, grantTokens: &GrantTokenList, kmsClient: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut kmsKeyArn: Sequence = _default::GetKeyId(kmsConfiguration); @@ -87833,7 +87884,7 @@ pub mod _KMSKeystoreOperations_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(159,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(160,3) pub fn ReEncryptKey(ciphertext: &Sequence, sourceEncryptionContext: &BranchKeyContext, destinationEncryptionContext: &BranchKeyContext, kmsConfiguration: &Arc, grantTokens: &GrantTokenList, kmsClient: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut kmsKeyArn: Sequence = _default::GetKeyId(kmsConfiguration); @@ -87890,7 +87941,7 @@ pub mod _KMSKeystoreOperations_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(247,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(248,3) pub fn DecryptKey(encryptionContext: &BranchKeyContext, item: &BranchKeyItem, kmsConfiguration: &Arc, grantTokens: &GrantTokenList, kmsClient: &Object) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut kmsKeyArn: Sequence = _default::GetArn(kmsConfiguration, &encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD())); @@ -87923,7 +87974,7 @@ pub mod _KMSKeystoreOperations_Compile { return output.read(); }; let mut decryptResponse: Arc = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }) && int!(32) == decryptResponse.Plaintext().value().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }) && 32 == truncate!(decryptResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException { message: string_utf16_of("Invalid response from AWS KMS Decrypt: Key is not 32 bytes.") })); if valueOrError1.IsFailure() { @@ -87947,25 +87998,25 @@ pub mod _KdfCtr_Compile { pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; pub use ::dafny_runtime::string_utf16_of; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::Object; pub use crate::implementation_from_dafny::HMAC::HMac; pub use ::dafny_runtime::rd; pub use ::dafny_runtime::euclidian_division; + pub use ::dafny_runtime::int; pub use ::dafny_runtime::integer_range; pub use ::std::convert::Into; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(27,3) + /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(28,3) pub fn KdfCounterMode(input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>((input.digestAlgorithm().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) || input.digestAlgorithm().clone() == Arc::new(DigestAlgorithm::SHA_384 {})) && (input.ikm().cardinality() == int!(32) || input.ikm().cardinality() == int!(48) || input.ikm().cardinality() == int!(66)) && matches!(input.nonce().as_ref(), Some{ .. }) && (input.nonce().value().cardinality() == int!(16) || input.nonce().value().cardinality() == int!(32)) && (input.expectedLength().clone() == 32 || input.expectedLength().clone() == 64) && (int!(0) < int!(input.expectedLength().clone()) * int!(8) && int!(input.expectedLength().clone()) * int!(8) < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT()), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>((input.digestAlgorithm().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) || input.digestAlgorithm().clone() == Arc::new(DigestAlgorithm::SHA_384 {})) && (truncate!(input.ikm().cardinality(), u64) == 32 || truncate!(input.ikm().cardinality(), u64) == 48 || truncate!(input.ikm().cardinality(), u64) == 66) && matches!(input.nonce().as_ref(), Some{ .. }) && (truncate!(input.nonce().value().cardinality(), u64) == 16 || truncate!(input.nonce().value().cardinality(), u64) == 32) && (input.expectedLength().clone() == 32 || input.expectedLength().clone() == 64) && (0 < (input.expectedLength().clone() * 8) as u64 && ((input.expectedLength().clone() * 8) as u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64)), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Kdf in Counter Mode input is invalid.") })); if valueOrError0.IsFailure() { @@ -87976,8 +88027,8 @@ pub mod _KdfCtr_Compile { let mut label_: Sequence = input.purpose().UnwrapOr(&(seq![] as Sequence)); let mut info: Sequence = input.nonce().UnwrapOr(&(seq![] as Sequence)); let mut okm: Sequence = seq![] as Sequence; - let mut internalLength: u32 = truncate!(int!(4) + _default::SEPARATION_INDICATOR().cardinality() + int!(4), u32); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(true && int!(internalLength) + label_.cardinality() + info.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut internalLength: u32 = (4 + truncate!(_default::SEPARATION_INDICATOR().cardinality(), u64) + 4) as u32; + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(true && crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add3(internalLength as u64, truncate!(label_.cardinality(), u64), truncate!(info.cardinality(), u64)) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Input Length exceeds INT32_MAX_LIMIT") })); if valueOrError1.IsFailure() { @@ -87986,7 +88037,7 @@ pub mod _KdfCtr_Compile { }; let mut lengthBits: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq((input.expectedLength().clone() * 8) as u32); let mut explicitInfo: Sequence = label_.concat(&_default::SEPARATION_INDICATOR()).concat(&info).concat(&lengthBits); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(4) + explicitInfo.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(4 + truncate!(explicitInfo.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("PRF input length exceeds INT32_MAX_LIMIT.") })); if valueOrError2.IsFailure() { @@ -88006,7 +88057,7 @@ pub mod _KdfCtr_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(68,3) + /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(74,3) pub fn RawDerive(ikm: &Sequence, explicitInfo: &Sequence, length: i32, offset: i32, digestAlgorithm: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, Arc>>; @@ -88018,12 +88069,12 @@ pub mod _KdfCtr_Compile { }; let mut hmac: Object = valueOrError0.Extract(); rd!(hmac).Init(ikm); - let mut macLengthBytes: i32 = truncate!(crate::implementation_from_dafny::_Digest_Compile::_default::Length(digestAlgorithm), i32); + let mut macLengthBytes: i32 = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digestAlgorithm) as i32; let mut iterations: i32 = truncate!(euclidian_division(int!(length + macLengthBytes - 1), int!(macLengthBytes)), i32); let mut buffer: Sequence = seq![] as Sequence; let mut i: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(_default::COUNTER_START_VALUE()); - let mut _hi0: i32 = iterations + 1; - for iteration in integer_range(1, _hi0).map(Into::::into) { + let mut _hi0: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(iterations as u64, 1); + for iteration in integer_range(1, _hi0).map(Into::::into) { rd!(hmac).BlockUpdate(&i); rd!(hmac).BlockUpdate(explicitInfo); let mut tmp: Sequence; @@ -88037,7 +88088,7 @@ pub mod _KdfCtr_Compile { }; i = valueOrError1.Extract(); } - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(buffer.cardinality() >= int!(length), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(buffer.cardinality(), u64) >= length as u64, &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Failed to derive key of requested length") })); if valueOrError2.IsFailure() { @@ -88049,26 +88100,26 @@ pub mod _KdfCtr_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(114,3) + /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(121,3) pub fn Increment(x: &Sequence) -> Arc, Arc>> { - if x.get(&int!(3)) < 255 { + if x.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) < 255 { Arc::new(Result::, Arc>::Success { - value: seq![x.get(&int!(0)), x.get(&int!(1)), x.get(&int!(2)), x.get(&int!(3)) + 1] + value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) + 1] }) } else { - if x.get(&int!(2)) < 255 { + if x.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) < 255 { Arc::new(Result::, Arc>::Success { - value: seq![x.get(&int!(0)), x.get(&int!(1)), x.get(&int!(2)) + 1, 0] + value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) + 1, 0] }) } else { - if x.get(&int!(1)) < 255 { + if x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) < 255 { Arc::new(Result::, Arc>::Success { - value: seq![x.get(&int!(0)), x.get(&int!(1)) + 1, 0, 0] + value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) + 1, 0, 0] }) } else { - if x.get(&int!(0)) < 255 { + if x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) < 255 { Arc::new(Result::, Arc>::Success { - value: seq![x.get(&int!(0)) + 1, 0, 0, 0] + value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) + 1, 0, 0, 0] }) } else { Arc::new(Result::, Arc>::Failure { @@ -88081,11 +88132,11 @@ pub mod _KdfCtr_Compile { } } } - /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(21,3) + /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(22,3) pub fn SEPARATION_INDICATOR() -> Sequence { seq![0] } - /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(22,3) + /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(23,3) pub fn COUNTER_START_VALUE() -> u32 { 1 } @@ -88112,7 +88163,7 @@ pub mod _KeyDerivation_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger; pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; pub use ::dafny_runtime::seq; pub use ::std::fmt::Debug; @@ -88293,7 +88344,7 @@ pub mod _KeyDerivation_Compile { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); return res.read(); }; - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(suite) == suite.kdf().HKDF().outputKeyLength().clone() && plaintextKey.cardinality() == int!(suite.kdf().HKDF().inputKeyLength().clone()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(suite) == suite.kdf().HKDF().outputKeyLength().clone() && truncate!(plaintextKey.cardinality(), i32) == suite.kdf().HKDF().inputKeyLength().clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("Invalid Materials") })); if valueOrError1.IsFailure() { @@ -88324,12 +88375,12 @@ pub mod _KeyDerivation_Compile { if matches!(_source0.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) { let mut ___mcc_h0: Arc = _source0.HKDF().clone(); let mut hkdf: Arc = ___mcc_h0.clone(); - plaintextKey.cardinality() == int!(suite.kdf().HKDF().inputKeyLength().clone()) && suite.kdf().HKDF().outputKeyLength().clone() == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(&suite) + truncate!(plaintextKey.cardinality(), i32) == suite.kdf().HKDF().inputKeyLength().clone() && suite.kdf().HKDF().outputKeyLength().clone() == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(&suite) } else { if matches!(_source0.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. }) { let mut ___mcc_h2: Arc = _source0.IDENTITY().clone(); let mut i: Arc = ___mcc_h2.clone(); - plaintextKey.cardinality() == int!(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(&suite)) + truncate!(plaintextKey.cardinality(), i32) == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(&suite) } else { let mut ___mcc_h4: Arc = _source0._None().clone(); let mut _None: Arc = suite.kdf().clone(); @@ -88552,9 +88603,9 @@ pub mod _KmsArn_Compile { /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KmsArn.dfy(16,3) pub fn _ValidKmsArn_q(input: &Sequence) -> bool { crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(input) && ({ - let __pat_let15_0: Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(input); + let __pat_let17_0: Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(input); { - let maybeParsed: Arc>> = __pat_let15_0.clone(); + let maybeParsed: Arc>> = __pat_let17_0.clone(); matches!((&maybeParsed).as_ref(), Success{ .. }) && maybeParsed.value().resource().resourceType().clone() == string_utf16_of("key") } }) @@ -88625,7 +88676,6 @@ pub mod _LocalCMC_Compile { pub use ::dafny_runtime::modify_field; pub use ::dafny_runtime::rd; pub use crate::implementation_from_dafny::_LocalCMC_Compile::Ref::Null; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::DafnyLibraries::MutableMap; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput; @@ -88636,34 +88686,35 @@ pub mod _LocalCMC_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DeleteCacheEntryInput; pub use ::dafny_runtime::string_utf16_of; pub use ::dafny_runtime::integer_range; - pub use ::dafny_runtime::int; + pub use ::std::convert::Into; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput; pub use ::dafny_runtime::truncate; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::UpdateUsageMetadataInput; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(300,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(301,3) pub fn RemoveValue<_K: DafnyTypeEq, _V: DafnyTypeEq>(k0: &_K, m: &Map<_K, _V>) -> () { let mut _m_k: Map<_K, _V> = m.subtract(&set!{k0.clone()}); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(57,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(58,3) pub fn NULL() -> Arc>> { Arc::new(Ref::>::Null {}) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(58,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(59,3) pub fn INT32_MAX_VALUE() -> i32 { 2040109465 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(59,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(60,3) pub fn INT64_MAX_VALUE() -> i64 { 8762203435012037017 } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(52,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(53,3) #[derive(PartialEq, Clone)] pub enum Ref { Ptr { @@ -88740,7 +88791,7 @@ pub mod _LocalCMC_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(61,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(62,3) pub struct CacheEntry { pub prev: ::dafny_runtime::Field>>>, pub next: ::dafny_runtime::Field>>>, @@ -88757,7 +88808,7 @@ pub mod _LocalCMC_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(72,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(73,5) pub fn _ctor(this: &Object, _materials_k: &Arc, _identifier_k: &Sequence, _creationTime_k: PositiveLong, _expiryTime_k: PositiveLong, _messagesUsed_k: PositiveInteger, _bytesUsed_k: PositiveInteger) -> () { let mut _set_prev: bool = false; let mut _set_next: bool = false; @@ -88777,19 +88828,19 @@ pub mod _LocalCMC_Compile { update_field_mut_uninit_object!(this.clone(), next, _set_next, _default::NULL()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(66,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(67,5) pub fn identifier(&self) -> Sequence { self.__i_identifier.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(65,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(66,5) pub fn materials(&self) -> Arc { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(67,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(68,5) pub fn creationTime(&self) -> PositiveLong { self.__i_creationTime.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(68,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(69,5) pub fn expiryTime(&self) -> PositiveLong { self.__i_expiryTime.clone() } @@ -88800,7 +88851,7 @@ pub mod _LocalCMC_Compile { UpcastObjectFn!(DynAny); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(102,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(103,3) pub struct DoublyLinkedCacheEntryList { pub head: ::dafny_runtime::Field>>>, pub tail: ::dafny_runtime::Field>>> @@ -88811,7 +88862,7 @@ pub mod _LocalCMC_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(160,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(161,5) pub fn _ctor(this: &Object) -> () { let mut _set_head: bool = false; let mut _set_tail: bool = false; @@ -88819,7 +88870,7 @@ pub mod _LocalCMC_Compile { update_field_mut_uninit_object!(this.clone(), tail, _set_tail, Arc::new(Ref::>::Null {})); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(172,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(173,5) pub fn pushCell(&self, toPush: &Object) -> () { let mut cRef: Arc>> = Arc::new(Ref::>::Ptr { deref: toPush.clone() @@ -88835,7 +88886,7 @@ pub mod _LocalCMC_Compile { }; return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(192,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(193,5) pub fn moveToFront(&self, c: &Object) -> () { if read_field!(self.head).deref().clone() != c.clone() { let mut toPush: Arc>> = Arc::new(Ref::>::Ptr { @@ -88855,7 +88906,7 @@ pub mod _LocalCMC_Compile { }; return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(221,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(222,5) pub fn remove(&self, toRemove: &Object) -> () { if matches!((&read_field!(rd!(toRemove.clone()).prev)).as_ref(), Null{ .. }) { modify_field!(self.head, read_field!(rd!(toRemove.clone()).next)) @@ -88883,12 +88934,12 @@ pub mod _LocalCMC_Compile { UpcastObjectFn!(DynAny); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(315,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(316,3) pub struct LocalCMC { pub queue: ::dafny_runtime::Field>, pub cache: ::dafny_runtime::Field, Object>>>, - pub __i_entryCapacity: nat, - pub __i_entryPruningTailSize: nat + pub __i_entryCapacity: u64, + pub __i_entryPruningTailSize: u64 } impl LocalCMC { @@ -88896,14 +88947,14 @@ pub mod _LocalCMC_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(381,5) - pub fn _ctor(this: &Object, _entryCapacity_k: &nat, _entryPruningTailSize_k: &nat) -> () { + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(382,5) + pub fn _ctor(this: &Object, _entryCapacity_k: u64, _entryPruningTailSize_k: u64) -> () { let mut _set_queue: bool = false; let mut _set_cache: bool = false; let mut _set___i_entryCapacity: bool = false; let mut _set___i_entryPruningTailSize: bool = false; - update_field_uninit_object!(this.clone(), __i_entryCapacity, _set___i_entryCapacity, _entryCapacity_k.clone()); - update_field_uninit_object!(this.clone(), __i_entryPruningTailSize, _set___i_entryPruningTailSize, _entryPruningTailSize_k.clone()); + update_field_uninit_object!(this.clone(), __i_entryCapacity, _set___i_entryCapacity, _entryCapacity_k); + update_field_uninit_object!(this.clone(), __i_entryPruningTailSize, _set___i_entryPruningTailSize, _entryPruningTailSize_k); let mut _nw0: Object, Object>> = MutableMap::, Object>::_allocate_object(); update_field_mut_uninit_object!(this.clone(), cache, _set_cache, _nw0.clone()); let mut _nw1: Object = DoublyLinkedCacheEntryList::_allocate_object(); @@ -88911,7 +88962,7 @@ pub mod _LocalCMC_Compile { update_field_mut_uninit_object!(this.clone(), queue, _set_queue, _nw1.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(423,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(424,5) pub fn GetCacheEntryWithTime(&self, input: &Arc, now: PositiveLong) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); if MutableMapTrait::, Object>::HasKey(rd!(read_field!(self.cache)), input.identifier()) { @@ -88961,11 +89012,11 @@ pub mod _LocalCMC_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(652,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(654,5) pub fn pruning(&self, now: PositiveLong) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); - let mut _hi0: nat = self.entryPruningTailSize().clone(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = self.entryPruningTailSize().clone(); + for i in integer_range(0, _hi0).map(Into::::into) { if matches!((&read_field!(rd!(read_field!(self.queue).clone()).tail)).as_ref(), Ptr{ .. }) { if rd!(read_field!(rd!(read_field!(self.queue).clone()).tail).deref().clone()).expiryTime().clone() < now { let mut valueOrError0: Arc>>; @@ -88996,12 +89047,12 @@ pub mod _LocalCMC_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(363,5) - pub fn entryCapacity(&self) -> nat { + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(364,5) + pub fn entryCapacity(&self) -> u64 { self.__i_entryCapacity.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(370,5) - pub fn entryPruningTailSize(&self) -> nat { + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(371,5) + pub fn entryPruningTailSize(&self) -> u64 { self.__i_entryPruningTailSize.clone() } } @@ -89013,7 +89064,7 @@ pub mod _LocalCMC_Compile { impl ICryptographicMaterialsCache for LocalCMC { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(409,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(410,5) fn _GetCacheEntry_k(&self, input: &Arc) -> Arc, Arc>> { let mut output: Arc, Arc>>; let mut now: i64; @@ -89023,10 +89074,10 @@ pub mod _LocalCMC_Compile { output = _out1.clone(); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(476,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(477,5) fn _PutCacheEntry_k(&self, input: &Arc) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); - if self.entryCapacity().clone() == int!(0) { + if self.entryCapacity().clone() == 0 { output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc>::Success { value: () })); @@ -89044,7 +89095,7 @@ pub mod _LocalCMC_Compile { }; let mut _v2: () = valueOrError0.Extract(); }; - if self.entryCapacity().clone() == MutableMapTrait::, Object>::Size(rd!(read_field!(self.cache))) { + if self.entryCapacity().clone() == truncate!(MutableMapTrait::, Object>::Size(rd!(read_field!(self.cache))), u64) { let mut valueOrError1: Arc>>; let mut _out1: Arc>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), &Arc::new(DeleteCacheEntryInput::DeleteCacheEntryInput { identifier: rd!(read_field!(rd!(read_field!(self.queue).clone()).tail).deref().clone()).identifier().clone() @@ -89067,7 +89118,7 @@ pub mod _LocalCMC_Compile { })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(567,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(568,5) fn _DeleteCacheEntry_k(&self, input: &Arc) -> Arc>> { let mut output: Arc>>; if MutableMapTrait::, Object>::HasKey(rd!(read_field!(self.cache)), input.identifier()) { @@ -89083,7 +89134,7 @@ pub mod _LocalCMC_Compile { }); return output.clone(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(616,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(618,5) fn _UpdateUsageMetadata_k(&self, input: &Arc) -> Arc>> { let mut output = MaybePlacebo::>>>::new(); if MutableMapTrait::, Object>::HasKey(rd!(read_field!(self.cache)), input.identifier()) { @@ -89152,15 +89203,16 @@ pub mod _Logarithm_Compile { } } } -/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(10,1) +/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(11,1) pub mod _MaterialWrapping_Compile { pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; + pub use ::dafny_runtime::Sequence; + pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; pub use ::std::fmt::Debug; pub use ::std::fmt::Formatter; - pub use ::std::fmt::Result; pub use ::dafny_runtime::DafnyPrint; pub use ::std::cmp::Eq; pub use ::std::hash::Hash; @@ -89168,20 +89220,19 @@ pub mod _MaterialWrapping_Compile { pub use ::std::default::Default; pub use ::std::convert::AsRef; pub use ::dafny_runtime::DafnyType; - pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::Any; pub use ::std::marker::Sync; pub use ::std::marker::Send; pub use ::dafny_runtime::UpcastObject; pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; - pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(20,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(22,3) #[derive(PartialEq, Clone)] pub enum GenerateAndWrapInput { GenerateAndWrapInput { algorithmSuite: Arc, - encryptionContext: Map + encryptionContext: Map, + serializedEC: Arc, Arc>> } } @@ -89189,20 +89240,26 @@ pub mod _MaterialWrapping_Compile { /// Returns a borrow of the field algorithmSuite pub fn algorithmSuite(&self) -> &Arc { match self { - GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, } => algorithmSuite, + GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => algorithmSuite, } } /// Returns a borrow of the field encryptionContext pub fn encryptionContext(&self) -> &Map { match self { - GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, } => encryptionContext, + GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => encryptionContext, + } + } + /// Returns a borrow of the field serializedEC + pub fn serializedEC(&self) -> &Arc, Arc>> { + match self { + GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => serializedEC, } } } impl Debug for GenerateAndWrapInput { - fn fmt(&self, f: &mut Formatter) -> Result { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { DafnyPrint::fmt_print(self, f, true) } } @@ -89211,11 +89268,13 @@ pub mod _MaterialWrapping_Compile { for GenerateAndWrapInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, } => { + GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => { write!(_formatter, "MaterialWrapping_Compile.GenerateAndWrapInput.GenerateAndWrapInput(")?; DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(encryptionContext, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(serializedEC, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -89230,9 +89289,10 @@ pub mod _MaterialWrapping_Compile { for GenerateAndWrapInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, } => { + GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => { Hash::hash(algorithmSuite, _state); - Hash::hash(encryptionContext, _state) + Hash::hash(encryptionContext, _state); + Hash::hash(serializedEC, _state) }, } } @@ -89243,7 +89303,8 @@ pub mod _MaterialWrapping_Compile { fn default() -> GenerateAndWrapInput { GenerateAndWrapInput::GenerateAndWrapInput { algorithmSuite: Default::default(), - encryptionContext: Default::default() + encryptionContext: Default::default(), + serializedEC: Default::default() } } } @@ -89255,7 +89316,7 @@ pub mod _MaterialWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(25,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(28,3) #[derive(PartialEq, Clone)] pub enum GenerateAndWrapOutput { GenerateAndWrapOutput { @@ -89288,7 +89349,7 @@ pub mod _MaterialWrapping_Compile { impl Debug for GenerateAndWrapOutput { - fn fmt(&self, f: &mut Formatter) -> Result { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { DafnyPrint::fmt_print(self, f, true) } } @@ -89345,13 +89406,14 @@ pub mod _MaterialWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(31,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(34,3) #[derive(PartialEq, Clone)] pub enum WrapInput { WrapInput { plaintextMaterial: Sequence, algorithmSuite: Arc, - encryptionContext: Map + encryptionContext: Map, + serializedEC: Arc, Arc>> } } @@ -89359,26 +89421,32 @@ pub mod _MaterialWrapping_Compile { /// Returns a borrow of the field plaintextMaterial pub fn plaintextMaterial(&self) -> &Sequence { match self { - WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, } => plaintextMaterial, + WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => plaintextMaterial, } } /// Returns a borrow of the field algorithmSuite pub fn algorithmSuite(&self) -> &Arc { match self { - WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, } => algorithmSuite, + WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => algorithmSuite, } } /// Returns a borrow of the field encryptionContext pub fn encryptionContext(&self) -> &Map { match self { - WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, } => encryptionContext, + WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => encryptionContext, + } + } + /// Returns a borrow of the field serializedEC + pub fn serializedEC(&self) -> &Arc, Arc>> { + match self { + WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => serializedEC, } } } impl Debug for WrapInput { - fn fmt(&self, f: &mut Formatter) -> Result { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { DafnyPrint::fmt_print(self, f, true) } } @@ -89387,13 +89455,15 @@ pub mod _MaterialWrapping_Compile { for WrapInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, } => { + WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => { write!(_formatter, "MaterialWrapping_Compile.WrapInput.WrapInput(")?; DafnyPrint::fmt_print(plaintextMaterial, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(encryptionContext, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(serializedEC, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -89408,10 +89478,11 @@ pub mod _MaterialWrapping_Compile { for WrapInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, } => { + WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => { Hash::hash(plaintextMaterial, _state); Hash::hash(algorithmSuite, _state); - Hash::hash(encryptionContext, _state) + Hash::hash(encryptionContext, _state); + Hash::hash(serializedEC, _state) }, } } @@ -89423,7 +89494,8 @@ pub mod _MaterialWrapping_Compile { WrapInput::WrapInput { plaintextMaterial: Default::default(), algorithmSuite: Default::default(), - encryptionContext: Default::default() + encryptionContext: Default::default(), + serializedEC: Default::default() } } } @@ -89435,7 +89507,7 @@ pub mod _MaterialWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(37,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(41,3) #[derive(PartialEq, Clone)] pub enum WrapOutput { WrapOutput { @@ -89461,7 +89533,7 @@ pub mod _MaterialWrapping_Compile { impl Debug for WrapOutput { - fn fmt(&self, f: &mut Formatter) -> Result { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { DafnyPrint::fmt_print(self, f, true) } } @@ -89514,13 +89586,14 @@ pub mod _MaterialWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(42,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(46,3) #[derive(PartialEq, Clone)] pub enum UnwrapInput { UnwrapInput { wrappedMaterial: Sequence, algorithmSuite: Arc, - encryptionContext: Map + encryptionContext: Map, + serializedEC: Arc, Arc>> } } @@ -89528,26 +89601,32 @@ pub mod _MaterialWrapping_Compile { /// Returns a borrow of the field wrappedMaterial pub fn wrappedMaterial(&self) -> &Sequence { match self { - UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, } => wrappedMaterial, + UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => wrappedMaterial, } } /// Returns a borrow of the field algorithmSuite pub fn algorithmSuite(&self) -> &Arc { match self { - UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, } => algorithmSuite, + UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => algorithmSuite, } } /// Returns a borrow of the field encryptionContext pub fn encryptionContext(&self) -> &Map { match self { - UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, } => encryptionContext, + UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => encryptionContext, + } + } + /// Returns a borrow of the field serializedEC + pub fn serializedEC(&self) -> &Arc, Arc>> { + match self { + UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => serializedEC, } } } impl Debug for UnwrapInput { - fn fmt(&self, f: &mut Formatter) -> Result { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { DafnyPrint::fmt_print(self, f, true) } } @@ -89556,13 +89635,15 @@ pub mod _MaterialWrapping_Compile { for UnwrapInput { fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result { match self { - UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, } => { + UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => { write!(_formatter, "MaterialWrapping_Compile.UnwrapInput.UnwrapInput(")?; DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?; write!(_formatter, ", ")?; DafnyPrint::fmt_print(encryptionContext, _formatter, false)?; + write!(_formatter, ", ")?; + DafnyPrint::fmt_print(serializedEC, _formatter, false)?; write!(_formatter, ")")?; Ok(()) }, @@ -89577,10 +89658,11 @@ pub mod _MaterialWrapping_Compile { for UnwrapInput { fn hash<_H: Hasher>(&self, _state: &mut _H) { match self { - UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, } => { + UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => { Hash::hash(wrappedMaterial, _state); Hash::hash(algorithmSuite, _state); - Hash::hash(encryptionContext, _state) + Hash::hash(encryptionContext, _state); + Hash::hash(serializedEC, _state) }, } } @@ -89592,7 +89674,8 @@ pub mod _MaterialWrapping_Compile { UnwrapInput::UnwrapInput { wrappedMaterial: Default::default(), algorithmSuite: Default::default(), - encryptionContext: Default::default() + encryptionContext: Default::default(), + serializedEC: Default::default() } } } @@ -89604,7 +89687,7 @@ pub mod _MaterialWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(48,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(53,3) #[derive(PartialEq, Clone)] pub enum UnwrapOutput { UnwrapOutput { @@ -89630,7 +89713,7 @@ pub mod _MaterialWrapping_Compile { impl Debug for UnwrapOutput { - fn fmt(&self, f: &mut Formatter) -> Result { + fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result { DafnyPrint::fmt_print(self, f, true) } } @@ -89683,17 +89766,17 @@ pub mod _MaterialWrapping_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(72,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(77,3) pub trait GenerateAndWrapMaterial: Any + Sync + Send + UpcastObject + ActionWithResult, Arc>, Arc> + UpcastObject, Arc>, Arc>> where T: DafnyType {} - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(85,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(98,3) pub trait WrapMaterial: Any + Sync + Send + UpcastObject + ActionWithResult, Arc>, Arc> + UpcastObject, Arc>, Arc>> where T: DafnyType {} - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(97,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(117,3) pub trait UnwrapMaterial: Any + Sync + Send + UpcastObject + ActionWithResult, Arc>, Arc> + UpcastObject, Arc>, Arc>> where T: DafnyType {} @@ -89720,8 +89803,8 @@ pub mod _Materials_Compile { pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::HMAC; pub use ::dafny_runtime::Set; pub use ::dafny_runtime::set; @@ -89729,7 +89812,7 @@ pub mod _Materials_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(29,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(30,3) pub fn InitializeEncryptionMaterials(input: &Arc) -> Arc, Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(!input.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Encryption Context ") @@ -89827,7 +89910,7 @@ pub mod _Materials_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(92,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(93,3) pub fn InitializeDecryptionMaterials(input: &Arc) -> Arc, Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(Itertools::unique(input.requiredEncryptionContextKeys().iter()).all(({ let mut input = input.clone(); @@ -89843,7 +89926,7 @@ pub mod _Materials_Compile { } }) }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Reporoduced encryption context key did not exist in provided encryption context.") + message: string_utf16_of("Reproduced encryption context key did not exist in provided encryption context.") })); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() @@ -89881,7 +89964,7 @@ pub mod _Materials_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(141,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(142,3) pub fn DecodeVerificationKey(encryptionContext: &Map) -> Arc>>, Arc>> { if encryptionContext.contains(&_default::EC_PUBLIC_KEY_FIELD()) { let mut utf8Key: ValidUTF8Bytes = encryptionContext.get(&_default::EC_PUBLIC_KEY_FIELD()); @@ -89920,17 +90003,17 @@ pub mod _Materials_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(166,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(167,3) pub fn ValidEncryptionMaterialsTransition(oldMat: &Arc, newMat: &Arc) -> bool { - newMat.algorithmSuite().clone() == oldMat.algorithmSuite().clone() && newMat.encryptionContext().clone() == oldMat.encryptionContext().clone() && newMat.requiredEncryptionContextKeys().clone() == oldMat.requiredEncryptionContextKeys().clone() && newMat.signingKey().clone() == oldMat.signingKey().clone() && (matches!(oldMat.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) || oldMat.plaintextDataKey().clone() == newMat.plaintextDataKey().clone()) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) && oldMat.encryptedDataKeys().cardinality() <= newMat.encryptedDataKeys().cardinality() && oldMat.encryptedDataKeys().as_dafny_multiset() <= newMat.encryptedDataKeys().as_dafny_multiset() && (!(!matches!(oldMat.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || matches!(newMat.symmetricSigningKeys().as_ref(), Some{ .. }) && matches!(oldMat.symmetricSigningKeys().as_ref(), Some{ .. }) && oldMat.symmetricSigningKeys().value().as_dafny_multiset() <= newMat.symmetricSigningKeys().value().as_dafny_multiset()) && _default::ValidEncryptionMaterials(oldMat) && _default::ValidEncryptionMaterials(newMat) + newMat.algorithmSuite().clone() == oldMat.algorithmSuite().clone() && newMat.encryptionContext().clone() == oldMat.encryptionContext().clone() && newMat.requiredEncryptionContextKeys().clone() == oldMat.requiredEncryptionContextKeys().clone() && newMat.signingKey().clone() == oldMat.signingKey().clone() && (matches!(oldMat.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) || oldMat.plaintextDataKey().clone() == newMat.plaintextDataKey().clone()) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) && truncate!(oldMat.encryptedDataKeys().cardinality(), u64) <= truncate!(newMat.encryptedDataKeys().cardinality(), u64) && oldMat.encryptedDataKeys().as_dafny_multiset() <= newMat.encryptedDataKeys().as_dafny_multiset() && (!(!matches!(oldMat.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || matches!(newMat.symmetricSigningKeys().as_ref(), Some{ .. }) && (matches!(oldMat.symmetricSigningKeys().as_ref(), Some{ .. }) || matches!(oldMat.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && truncate!(oldMat.encryptedDataKeys().cardinality(), u64) == 0) && oldMat.symmetricSigningKeys().UnwrapOr(&(seq![] as Sequence>)).as_dafny_multiset() <= newMat.symmetricSigningKeys().value().as_dafny_multiset()) && _default::ValidEncryptionMaterials(oldMat) && _default::ValidEncryptionMaterials(newMat) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(214,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(217,3) pub fn ValidEncryptionMaterials(encryptionMaterials: &Arc) -> bool { crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::_AlgorithmSuite_q(encryptionMaterials.algorithmSuite()) && ({ - let __pat_let16_0: Arc = encryptionMaterials.algorithmSuite().clone(); + let __pat_let18_0: Arc = encryptionMaterials.algorithmSuite().clone(); { - let suite: Arc = __pat_let16_0.clone(); - matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == matches!(encryptionMaterials.signingKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && (!matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) || int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)) == encryptionMaterials.plaintextDataKey().value().cardinality()) && (!matches!(encryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) || encryptionMaterials.encryptedDataKeys().cardinality() == int!(0)) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == encryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == matches!(encryptionMaterials.signingKey().as_ref(), Some{ .. }) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == encryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && (!(matches!(suite.symmetricSignature().as_ref(), HMAC{ .. }) && matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), Some{ .. })) || encryptionMaterials.symmetricSigningKeys().value().cardinality() == encryptionMaterials.encryptedDataKeys().cardinality()) && (!matches!(suite.symmetricSignature().as_ref(), HMAC{ .. }) || matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), Some{ .. })) && (!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) || matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })) && Itertools::unique(encryptionMaterials.requiredEncryptionContextKeys().iter()).all(({ + let suite: Arc = __pat_let18_0.clone(); + matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == matches!(encryptionMaterials.signingKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && (!matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) || crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(encryptionMaterials.plaintextDataKey().value().cardinality(), u64)) && (!matches!(encryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) || truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64) == 0) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == encryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == matches!(encryptionMaterials.signingKey().as_ref(), Some{ .. }) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == encryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && (!(matches!(suite.symmetricSignature().as_ref(), HMAC{ .. }) && matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), Some{ .. })) || truncate!(encryptionMaterials.symmetricSigningKeys().value().cardinality(), u64) == truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64)) && (!matches!(suite.symmetricSignature().as_ref(), HMAC{ .. }) || (matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), Some{ .. }) || truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64) == 0 && matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }))) && (!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) || matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })) && Itertools::unique(encryptionMaterials.requiredEncryptionContextKeys().iter()).all(({ let mut encryptionMaterials = encryptionMaterials.clone(); Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{ let mut key: ValidUTF8Bytes = __forall_var_0.clone(); @@ -89947,11 +90030,11 @@ pub mod _Materials_Compile { } }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(289,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(297,3) pub fn EncryptionMaterialsHasPlaintextDataKey(encryptionMaterials: &Arc) -> bool { - matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && int!(0) < encryptionMaterials.encryptedDataKeys().cardinality() && _default::ValidEncryptionMaterials(encryptionMaterials) + matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && 0 < truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64) && _default::ValidEncryptionMaterials(encryptionMaterials) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(295,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(304,3) pub fn EncryptionMaterialAddEncryptedDataKeys(encryptionMaterials: &Arc, encryptedDataKeysToAdd: &Sequence>, symmetricSigningKeysToAdd: &Arc>>>) -> Arc, Arc>> { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(_default::ValidEncryptionMaterials(encryptionMaterials), &Arc::new(Error::InvalidEncryptionMaterialsTransition { message: string_utf16_of("Attempt to modify invalid encryption material.") @@ -89981,7 +90064,7 @@ pub mod _Materials_Compile { encryptionMaterials.symmetricSigningKeys().clone() } else { Arc::new(Option::>>::Some { - value: encryptionMaterials.symmetricSigningKeys().value().concat(symmetricSigningKeysToAdd.value()) + value: encryptionMaterials.symmetricSigningKeys().UnwrapOr(&(seq![] as Sequence>)).concat(symmetricSigningKeysToAdd.value()) }) }; Arc::new(Result::, Arc>::Success { @@ -90000,7 +90083,7 @@ pub mod _Materials_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(334,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(343,3) pub fn EncryptionMaterialAddDataKey(encryptionMaterials: &Arc, plaintextDataKey: &Sequence, encryptedDataKeysToAdd: &Sequence>, symmetricSigningKeysToAdd: &Arc>>>) -> Arc, Arc>> { let mut suite: Arc = encryptionMaterials.algorithmSuite().clone(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(_default::ValidEncryptionMaterials(encryptionMaterials), &Arc::new(Error::InvalidEncryptionMaterialsTransition { @@ -90015,7 +90098,7 @@ pub mod _Materials_Compile { if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>() } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)) == plaintextDataKey.cardinality(), &Arc::new(Error::InvalidEncryptionMaterialsTransition { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(plaintextDataKey.cardinality(), u64), &Arc::new(Error::InvalidEncryptionMaterialsTransition { message: string_utf16_of("plaintextDataKey does not match Algorithm Suite specification.") })); if valueOrError2.IsFailure() { @@ -90037,7 +90120,7 @@ pub mod _Materials_Compile { encryptionMaterials.symmetricSigningKeys().clone() } else { Arc::new(Option::>>::Some { - value: encryptionMaterials.symmetricSigningKeys().value().concat(symmetricSigningKeysToAdd.value()) + value: encryptionMaterials.symmetricSigningKeys().UnwrapOr(&(seq![] as Sequence>)).concat(symmetricSigningKeysToAdd.value()) }) }; Arc::new(Result::, Arc>::Success { @@ -90059,17 +90142,17 @@ pub mod _Materials_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(387,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(397,3) pub fn DecryptionMaterialsTransitionIsValid(oldMat: &Arc, newMat: &Arc) -> bool { newMat.algorithmSuite().clone() == oldMat.algorithmSuite().clone() && newMat.encryptionContext().clone() == oldMat.encryptionContext().clone() && newMat.requiredEncryptionContextKeys().clone() == oldMat.requiredEncryptionContextKeys().clone() && newMat.verificationKey().clone() == oldMat.verificationKey().clone() && matches!(oldMat.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) && matches!(oldMat.symmetricSigningKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && _default::ValidDecryptionMaterials(oldMat) && _default::ValidDecryptionMaterials(newMat) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(418,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(428,3) pub fn ValidDecryptionMaterials(decryptionMaterials: &Arc) -> bool { crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::_AlgorithmSuite_q(decryptionMaterials.algorithmSuite()) && ({ - let __pat_let17_0: Arc = decryptionMaterials.algorithmSuite().clone(); + let __pat_let19_0: Arc = decryptionMaterials.algorithmSuite().clone(); { - let suite: Arc = __pat_let17_0.clone(); - (!matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) || int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)) == decryptionMaterials.plaintextDataKey().value().cardinality()) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == decryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == matches!(decryptionMaterials.verificationKey().as_ref(), Some{ .. }) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == decryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && (!(!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) == matches!(decryptionMaterials.symmetricSigningKey().as_ref(), Some{ .. })) && (!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) || matches!(decryptionMaterials.symmetricSigningKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })) && Itertools::unique(decryptionMaterials.requiredEncryptionContextKeys().iter()).all(({ + let suite: Arc = __pat_let19_0.clone(); + (!matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) || crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(decryptionMaterials.plaintextDataKey().value().cardinality(), u64)) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == decryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == matches!(decryptionMaterials.verificationKey().as_ref(), Some{ .. }) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == decryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && (!(!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) == matches!(decryptionMaterials.symmetricSigningKey().as_ref(), Some{ .. })) && (!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) || matches!(decryptionMaterials.symmetricSigningKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })) && Itertools::unique(decryptionMaterials.requiredEncryptionContextKeys().iter()).all(({ let mut decryptionMaterials = decryptionMaterials.clone(); Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{ let mut k: ValidUTF8Bytes = __forall_var_0.clone(); @@ -90086,7 +90169,7 @@ pub mod _Materials_Compile { } }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(471,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(482,3) pub fn DecryptionMaterialsAddDataKey(decryptionMaterials: &Arc, plaintextDataKey: &Sequence, symmetricSigningKey: &Arc>>) -> Arc, Arc>> { let mut suite: Arc = decryptionMaterials.algorithmSuite().clone(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(_default::ValidDecryptionMaterials(decryptionMaterials), &Arc::new(Error::InvalidDecryptionMaterialsTransition { @@ -90101,7 +90184,7 @@ pub mod _Materials_Compile { if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>() } else { - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)) == plaintextDataKey.cardinality(), &Arc::new(Error::InvalidDecryptionMaterialsTransition { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(plaintextDataKey.cardinality(), u64), &Arc::new(Error::InvalidDecryptionMaterialsTransition { message: string_utf16_of("plaintextDataKey does not match Algorithm Suite specification.") })); if valueOrError2.IsFailure() { @@ -90137,29 +90220,29 @@ pub mod _Materials_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(504,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(516,3) pub fn DecryptionMaterialsWithoutPlaintextDataKey(decryptionMaterials: &Arc) -> bool { matches!(decryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && _default::ValidDecryptionMaterials(decryptionMaterials) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(528,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(540,3) pub fn DecryptionMaterialsWithPlaintextDataKey(decryptionMaterials: &Arc) -> bool { matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && _default::ValidDecryptionMaterials(decryptionMaterials) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(17,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(18,3) pub fn EC_PUBLIC_KEY_FIELD() -> ValidUTF8Bytes { let mut s: Sequence = seq![97, 119, 115, 45, 99, 114, 121, 112, 116, 111, 45, 112, 117, 98, 108, 105, 99, 45, 107, 101, 121]; s.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(23,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(24,3) pub fn RESERVED_KEY_VALUES() -> Set { set!{_default::EC_PUBLIC_KEY_FIELD()} } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(538,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(550,3) pub type DecryptionMaterialsPendingPlaintextDataKey = Arc; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(542,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(554,3) pub type SealedDecryptionMaterials = Arc; } /// ***************************************************************************** @@ -90208,6 +90291,7 @@ pub mod _MessageBody_Compile { pub use crate::implementation_from_dafny::_MessageBody_Compile::BodyAADContent::AADRegularFrame; pub use crate::implementation_from_dafny::_MessageBody_Compile::BodyAADContent::AADFinalFrame; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; + pub use ::dafny_runtime::seq; pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::integer_range; pub use ::dafny_runtime::Zero; @@ -90216,14 +90300,14 @@ pub mod _MessageBody_Compile { pub use ::dafny_runtime::Object; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient; pub use ::dafny_runtime::MaybePlacebo; - pub use ::dafny_runtime::seq; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use ::dafny_runtime::string_utf16_of; - pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient; pub use ::dafny_runtime::rd; + pub use ::std::convert::Into; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer; @@ -90246,7 +90330,7 @@ pub mod _MessageBody_Compile { pub struct _default {} impl _default { - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(41,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(42,3) pub fn BodyAADContentTypeString(bc: &Arc) -> Sequence { let mut _source0: Arc = bc.clone(); if matches!((&_source0).as_ref(), AADRegularFrame{ .. }) { @@ -90259,28 +90343,34 @@ pub mod _MessageBody_Compile { } } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(52,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(53,3) pub fn IVSeq(suite: &Arc, sequenceNumber: u32) -> Sequence { - ({ - let _initializer = { - Arc::new(move |_v0: &DafnyInt| -> u8{ - 0 - }) - }; - integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite)) - int!(4)).map(move |i| _initializer(&i)).collect::>() - }).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(sequenceNumber)) + let mut len: u8 = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite); + let mut num: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(sequenceNumber); + if len == 12 { + seq![0, 0, 0, 0, 0, 0, 0, 0].concat(&num) + } else { + ({ + let _initializer = { + Arc::new(move |_v0: &DafnyInt| -> u8{ + 0 + }) + }; + integer_range(Zero::zero(), int!(len) - int!(4)).map(move |i| _initializer(&i)).collect::>() + }).concat(&num) + } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(193,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(222,3) pub fn EncryptMessageBody(plaintext: &Sequence, header: &Header, key: &Sequence, crypto: &Object) -> Arc>> { let mut result = MaybePlacebo::>>>::new(); - let mut n: DafnyInt; + let mut n: u64; let mut sequenceNumber: u32; - let mut _rhs0: DafnyInt = int!(0); + let mut _rhs0: u64 = 0; let mut _rhs1: u32 = _default::START_SEQUENCE_NUMBER(); - n = _rhs0.clone(); + n = _rhs0; sequenceNumber = _rhs1; let mut regularFrames: MessageRegularFrames = seq![] as Sequence; - while n.clone() + int!(header.body().frameLength().clone()) < plaintext.cardinality() { + while crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(n, header.body().frameLength().clone() as u64) < truncate!(plaintext.cardinality(), u64) { let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(sequenceNumber < _default::ENDFRAME_SEQUENCE_NUMBER(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException { message: string_utf16_of("too many frames") })); @@ -90288,7 +90378,7 @@ pub mod _MessageBody_Compile { result = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return result.read(); }; - let mut plaintextFrame: Sequence = plaintext.slice(&n, &(n.clone() + int!(header.body().frameLength().clone()))); + let mut plaintextFrame: Sequence = plaintext.slice(&int!((&n).clone()), &int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(n, header.body().frameLength().clone() as u64)).clone())); let mut valueOrError1: Arc>>; let mut _out0: Arc>> = _default::EncryptRegularFrame(key, header, &plaintextFrame, sequenceNumber, crypto); valueOrError1 = _out0.clone(); @@ -90298,11 +90388,11 @@ pub mod _MessageBody_Compile { }; let mut regularFrame: Arc = valueOrError1.Extract(); regularFrames = regularFrames.concat(&seq![regularFrame.clone()]); - n = n.clone() + int!(header.body().frameLength().clone()); + n = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(n, header.body().frameLength().clone() as u64); sequenceNumber = sequenceNumber + 1; }; let mut valueOrError2: Arc>>; - let mut _out1: Arc>> = _default::EncryptFinalFrame(key, header, &plaintext.drop(&n), sequenceNumber, crypto); + let mut _out1: Arc>> = _default::EncryptFinalFrame(key, header, &plaintext.drop(&int!((&n).clone())), sequenceNumber, crypto); valueOrError2 = _out1.clone(); if valueOrError2.IsFailure() { result = MaybePlacebo::from(valueOrError2.PropagateFailure::()); @@ -90317,7 +90407,7 @@ pub mod _MessageBody_Compile { })); return result.read(); } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(340,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(370,3) pub fn EncryptRegularFrame(key: &Sequence, header: &Header, plaintext: &Sequence, sequenceNumber: u32, crypto: &Object) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut iv: Sequence = _default::IVSeq(header.suite(), sequenceNumber); @@ -90356,7 +90446,7 @@ pub mod _MessageBody_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(494,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(524,3) pub fn EncryptFinalFrame(key: &Sequence, header: &Header, plaintext: &Sequence, sequenceNumber: u32, crypto: &Object) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut iv: Sequence = _default::IVSeq(header.suite(), sequenceNumber); @@ -90395,14 +90485,14 @@ pub mod _MessageBody_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(656,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(686,3) pub fn DecryptFramedMessageBody(body: &FramedMessage, key: &Sequence, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut plaintext: Sequence = seq![] as Sequence; - let mut _hi0: DafnyInt = body.regularFrames().cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(body.regularFrames().cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut valueOrError0: Arc, Arc>>; - let mut _out0: Arc, Arc>> = _default::DecryptFrame(&body.regularFrames().get(&i), key, crypto); + let mut _out0: Arc, Arc>> = _default::DecryptFrame(&body.regularFrames().get(&int!((&i).clone())), key, crypto); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); @@ -90425,7 +90515,7 @@ pub mod _MessageBody_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(729,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(759,3) pub fn DecryptFrame(frame: &Frame, key: &Sequence, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut aad: Sequence = _default::BodyAADByFrameType(frame); @@ -90456,7 +90546,7 @@ pub mod _MessageBody_Compile { })); return res.read(); } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(810,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(840,3) pub fn BodyAADByFrameType(frame: &Frame) -> Sequence { let mut __let_tmp_rhs0: (u32, Arc, u64) = (&({ Arc::new(move |_source0: &Frame| -> (u32, Arc, u64){ @@ -90507,7 +90597,7 @@ pub mod _MessageBody_Compile { let mut length: u64 = __let_tmp_rhs0.2.clone(); _default::BodyAAD(frame.header().body().messageId(), &bc, sequenceNumber, length) } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(893,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(923,3) pub fn BodyAAD(messageID: &Sequence, bc: &Arc, sequenceNumber: u32, length: u64) -> Sequence { let mut contentAAD: Arc>> = crate::implementation_from_dafny::UTF8::_default::Encode(&_default::BodyAADContentTypeString(bc)); messageID.concat(contentAAD.value()).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(sequenceNumber)).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt64ToSeq(length)) @@ -90516,27 +90606,22 @@ pub mod _MessageBody_Compile { /// = type=implication /// # The final frame /// # MUST be the last frame. - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(928,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(958,3) pub fn WriteFramedMessageBody(body: &FramedMessage) -> Sequence { _default::WriteMessageRegularFrames(body.regularFrames()).concat(&crate::implementation_from_dafny::_Frames_Compile::_default::WriteFinalFrame(body.finalFrame())) } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(942,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(972,3) pub fn WriteMessageRegularFrames(frames: &MessageRegularFrames) -> Sequence { - let mut _accumulator: Sequence = seq![] as Sequence; - let mut _r0 = frames.clone(); - 'TAIL_CALL_START: loop { - let frames = _r0; - if frames.cardinality() == int!(0) { - return (seq![] as Sequence).concat(&_accumulator); - } else { - _accumulator = crate::implementation_from_dafny::_Frames_Compile::_default::WriteRegularFrame(&crate::implementation_from_dafny::_Seq_Compile::_default::Last::(&frames)).concat(&_accumulator); - let mut _in0: Sequence = crate::implementation_from_dafny::_Seq_Compile::_default::DropLast::(&frames); - _r0 = _in0.clone(); - continue 'TAIL_CALL_START; - } + let mut ret = MaybePlacebo::>::new(); + let mut result: Sequence = seq![] as Sequence; + let mut _hi0: u64 = truncate!(frames.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + result = result.concat(&crate::implementation_from_dafny::_Frames_Compile::_default::WriteRegularFrame(&frames.get(&int!((&i).clone())))); } + ret = MaybePlacebo::from(result.clone()); + return ret.read(); } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(958,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(1010,3) pub fn ReadFramedMessageBody(buffer: &Arc, header: &FramedHeader, regularFrames: &MessageRegularFrames, continuation: &Arc) -> Arc>, Arc>> { let mut _r0 = buffer.clone(); let mut _r1 = header.clone(); @@ -90558,7 +90643,7 @@ pub mod _MessageBody_Compile { return valueOrError1.PropagateFailure::>>(); } else { let mut regularFrame: Arc> = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(regularFrame.data().seqNum().clone()) == regularFrames.cardinality() + int!(1), &Arc::new(ReadProblems::Error { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(regularFrame.data().seqNum().clone() as u64 == truncate!(regularFrames.cardinality(), u64) + 1, &Arc::new(ReadProblems::Error { message: string_utf16_of("Sequence number out of order.") })); if valueOrError2.IsFailure() { @@ -90582,7 +90667,7 @@ pub mod _MessageBody_Compile { return valueOrError3.PropagateFailure::>>(); } else { let mut finalFrame: Arc> = valueOrError3.Extract(); - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(finalFrame.data().seqNum().clone()) == regularFrames.cardinality() + int!(1), &Arc::new(ReadProblems::Error { + let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(finalFrame.data().seqNum().clone() as u64 == truncate!(regularFrames.cardinality(), u64) + 1, &Arc::new(ReadProblems::Error { message: string_utf16_of("Sequence number out of order.") })); if valueOrError4.IsFailure() { @@ -90604,7 +90689,7 @@ pub mod _MessageBody_Compile { } } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(1094,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(1149,3) pub fn ReadNonFramedMessageBody(buffer: &Arc, header: &NonFramedHeader) -> Arc>, Arc>> { let mut valueOrError0: Arc>, Arc>> = crate::implementation_from_dafny::_Frames_Compile::_default::ReadNonFrame(buffer, header); if valueOrError0.IsFailure() { @@ -90619,33 +90704,33 @@ pub mod _MessageBody_Compile { }) } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(37,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(38,3) pub fn BODY_AAD_CONTENT_REGULAR_FRAME() -> Sequence { string_utf16_of("AWSKMSEncryptionClient Frame") } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(38,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(39,3) pub fn BODY_AAD_CONTENT_FINAL_FRAME() -> Sequence { string_utf16_of("AWSKMSEncryptionClient Final Frame") } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(39,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(40,3) pub fn BODY_AAD_CONTENT_SINGLE_BLOCK() -> Sequence { string_utf16_of("AWSKMSEncryptionClient Single Block") } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(49,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(50,3) pub fn ENDFRAME_SEQUENCE_NUMBER() -> u32 { crate::implementation_from_dafny::_Frames_Compile::_default::ENDFRAME_SEQUENCE_NUMBER() } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(48,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(49,3) pub fn START_SEQUENCE_NUMBER() -> u32 { crate::implementation_from_dafny::_Frames_Compile::_default::START_SEQUENCE_NUMBER() } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(50,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(51,3) pub fn NONFRAMED_SEQUENCE_NUMBER() -> u32 { crate::implementation_from_dafny::_Frames_Compile::_default::NONFRAMED_SEQUENCE_NUMBER() } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(35,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(36,3) #[derive(PartialEq, Clone)] pub enum BodyAADContent { AADRegularFrame {}, @@ -90723,10 +90808,10 @@ pub mod _MessageBody_Compile { } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(103,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(111,3) pub type MessageRegularFrames = Sequence; - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(152,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(181,3) #[derive(PartialEq, Clone)] pub enum FramedMessageBody { FramedMessageBody { @@ -90805,13 +90890,13 @@ pub mod _MessageBody_Compile { } } - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(160,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(189,3) pub type FramedMessage = Arc; - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(170,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(199,3) pub type MessageFrame = Arc; - /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(176,3) + /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(205,3) pub type Frame = Arc; } /// ../mpl/libraries/src/NonlinearArithmetic/Internals/ModInternals.dfy(27,1) @@ -90876,13 +90961,14 @@ pub mod _MrkAwareDiscoveryMultiKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error; pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None; pub use crate::implementation_from_dafny::_AwsKmsMrkDiscoveryKeyring_Compile::AwsKmsMrkDiscoveryKeyring; pub use ::dafny_runtime::seq; - pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient; pub use ::dafny_runtime::rd; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput; @@ -90892,10 +90978,10 @@ pub mod _MrkAwareDiscoveryMultiKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareDiscoveryMultiKeyring.dfy(32,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareDiscoveryMultiKeyring.dfy(34,3) pub fn MrkAwareDiscoveryMultiKeyring(regions: &Sequence>, discoveryFilter: &Arc>>, clientSupplier: &Object, grantTokens: &Arc>) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < regions.cardinality(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(regions.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("No regions passed.") })); if valueOrError0.IsFailure() { @@ -90910,9 +90996,9 @@ pub mod _MrkAwareDiscoveryMultiKeyring_Compile { return output.read(); }; let mut children: Sequence> = seq![] as Sequence>; - let mut _hi0: DafnyInt = regions.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { - let mut region: Sequence = regions.get(&i); + let mut _hi0: u64 = truncate!(regions.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + let mut region: Sequence = regions.get(&int!((&i).clone())); let mut valueOrError2: Arc, Arc>>; let mut _out0: Arc, Arc>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput { region: region.clone() @@ -90964,8 +91050,9 @@ pub mod _MrkAwareStrictMultiKeyring_Compile { pub use ::dafny_runtime::rd; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput; pub use ::dafny_runtime::string_utf16_of; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; pub use ::dafny_runtime::rc_coerce; @@ -90975,7 +91062,7 @@ pub mod _MrkAwareStrictMultiKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareStrictMultiKeyring.dfy(23,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareStrictMultiKeyring.dfy(25,3) pub fn MrkAwareStrictMultiKeyring(generator: &Arc>>, awsKmsKeys: &Arc>>>, clientSupplier: &Object, grantTokens: &Arc>) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut allStrings: Sequence>; @@ -91037,9 +91124,9 @@ pub mod _MrkAwareStrictMultiKeyring_Compile { } else { let mut ___mcc_h2: Sequence> = _source2.value().clone(); let mut childIdentifiers: Sequence> = ___mcc_h2.clone(); - let mut _hi0: DafnyInt = childIdentifiers.cardinality(); - for index in integer_range(int!(0), _hi0.clone()) { - let mut childIdentifier: Sequence = childIdentifiers.get(&index); + let mut _hi0: u64 = truncate!(childIdentifiers.cardinality(), u64); + for index in integer_range(0, _hi0).map(Into::::into) { + let mut childIdentifier: Sequence = childIdentifiers.get(&int!((&index).clone())); let mut valueOrError4: Arc, Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(&childIdentifier).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError4.IsFailure() { output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); @@ -91064,7 +91151,7 @@ pub mod _MrkAwareStrictMultiKeyring_Compile { children = children.concat(&seq![keyring.clone()]); } }; - let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&generatorKeyring).as_ref(), Some{ .. }) || int!(0) < children.cardinality(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&generatorKeyring).as_ref(), Some{ .. }) || 0 < truncate!(children.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("generatorKeyring or child Keyrings needed to create a multi keyring") })); if valueOrError6.IsFailure() { @@ -91135,10 +91222,20 @@ pub mod _MulInternals_Compile { pub mod _MulInternalsNonlinear_Compile { } -/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(9,1) +/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(19,1) pub mod _MultiKeyring_Compile { pub use ::dafny_runtime::Object; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring; + pub use crate::implementation_from_dafny::_RawAESKeyring_Compile::RawAESKeyring; + pub use crate::implementation_from_dafny::_RawECDHKeyring_Compile::RawEcdhKeyring; + pub use crate::implementation_from_dafny::_RawRSAKeyring_Compile::RawRSAKeyring; + pub use crate::implementation_from_dafny::_AwsKmsDiscoveryKeyring_Compile::AwsKmsDiscoveryKeyring; + pub use crate::implementation_from_dafny::_AwsKmsEcdhKeyring_Compile::AwsKmsEcdhKeyring; + pub use crate::implementation_from_dafny::_AwsKmsHierarchicalKeyring_Compile::AwsKmsHierarchicalKeyring; + pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::AwsKmsKeyring; + pub use crate::implementation_from_dafny::_AwsKmsMrkDiscoveryKeyring_Compile::AwsKmsMrkDiscoveryKeyring; + pub use crate::implementation_from_dafny::_AwsKmsMrkKeyring_Compile::AwsKmsMrkKeyring; + pub use crate::implementation_from_dafny::_AwsKmsRsaKeyring_Compile::AwsKmsRsaKeyring; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; @@ -91164,8 +91261,9 @@ pub mod _MultiKeyring_Compile { pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; pub use ::dafny_runtime::seq; @@ -91173,7 +91271,41 @@ pub mod _MultiKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(338,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(52,3) + pub fn _Verified_q(keyring: &Object) -> bool { + ({ + let __is_20: Object = keyring.clone(); + __is_20.clone().is_instance_of::() + }) || ({ + let __is_21: Object = keyring.clone(); + __is_21.clone().is_instance_of::() + }) || ({ + let __is_22: Object = keyring.clone(); + __is_22.clone().is_instance_of::() + }) || ({ + let __is_23: Object = keyring.clone(); + __is_23.clone().is_instance_of::() + }) || ({ + let __is_24: Object = keyring.clone(); + __is_24.clone().is_instance_of::() + }) || ({ + let __is_25: Object = keyring.clone(); + __is_25.clone().is_instance_of::() + }) || ({ + let __is_26: Object = keyring.clone(); + __is_26.clone().is_instance_of::() + }) || ({ + let __is_27: Object = keyring.clone(); + __is_27.clone().is_instance_of::() + }) || ({ + let __is_28: Object = keyring.clone(); + __is_28.clone().is_instance_of::() + }) || ({ + let __is_29: Object = keyring.clone(); + __is_29.clone().is_instance_of::() + }) + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(461,3) pub fn AttemptDecryptDataKey(keyring: &Object, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, Arc>>; @@ -91184,12 +91316,17 @@ pub mod _MultiKeyring_Compile { return res.read(); }; let mut output: Arc = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(input.materials(), output.materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Keyring performed invalid material transition") - })); - if valueOrError1.IsFailure() { - res = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); - return res.read(); + if !(_default::_Verified_q(keyring) || ({ + let __is_30: Object = keyring.clone(); + __is_30.clone().is_instance_of::() + })) { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(input.materials(), output.materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Keyring performed invalid material transition") + })); + if valueOrError1.IsFailure() { + res = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); + return res.read(); + } }; res = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: output.clone() @@ -91198,7 +91335,7 @@ pub mod _MultiKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(18,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(69,3) pub struct MultiKeyring { pub __i_generatorKeyring: Arc>>, pub __i_childKeyrings: Sequence> @@ -91213,7 +91350,7 @@ pub mod _MultiKeyring_Compile { /// = type=implication /// # On keyring initialization, a keyring MUST define at least one of the /// # following: - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(43,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(95,5) pub fn _ctor(this: &Object, generatorKeyring: &Arc>>, childKeyrings: &Sequence>) -> () { let mut _set___i_generatorKeyring: bool = false; let mut _set___i_childKeyrings: bool = false; @@ -91221,11 +91358,11 @@ pub mod _MultiKeyring_Compile { update_field_uninit_object!(this.clone(), __i_childKeyrings, _set___i_childKeyrings, childKeyrings.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(40,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(92,5) pub fn generatorKeyring(&self) -> Arc>> { self.__i_generatorKeyring.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(41,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(93,5) pub fn childKeyrings(&self) -> Sequence> { self.__i_childKeyrings.clone() } @@ -91246,7 +91383,7 @@ pub mod _MultiKeyring_Compile { impl IKeyring for MultiKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(104,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(176,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); if matches!((&self.generatorKeyring().clone()).as_ref(), None{ .. }) && matches!(input.materials().plaintextDataKey().as_ref(), None{ .. }) { @@ -91281,46 +91418,64 @@ pub mod _MultiKeyring_Compile { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); return res.read(); }; - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(input.materials(), onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Generator keyring returned invalid encryption materials") - })); - if valueOrError2.IsFailure() { - res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); - return res.read(); + if !(_default::_Verified_q(self.generatorKeyring().clone().value()) || ({ + let __is_31: Object = self.generatorKeyring().clone().value().clone(); + __is_31.clone().is_instance_of::() + })) { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Could not retrieve materials required for encryption") + })); + if valueOrError2.IsFailure() { + res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); + return res.read(); + }; + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(input.materials(), onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Generator keyring returned invalid encryption materials") + })); + if valueOrError3.IsFailure() { + res = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); + return res.read(); + } }; returnMaterials = onEncryptOutput.value().materials().clone(); }; - let mut _hi0: DafnyInt = self.childKeyrings().clone().cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(self.childKeyrings().clone().cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { let mut onEncryptInput: Arc = Arc::new(OnEncryptInput::OnEncryptInput { materials: returnMaterials.clone() }); + let mut child: Object = self.childKeyrings().clone().get(&int!((&i).clone())); let mut onEncryptOutput: Arc, Arc>>; - let mut _out1: Arc, Arc>> = IKeyring::OnEncrypt(rd!(self.childKeyrings().clone().get(&i)), &onEncryptInput); + let mut _out1: Arc, Arc>> = IKeyring::OnEncrypt(rd!(child.clone()), &onEncryptInput); onEncryptOutput = _out1.clone(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&onEncryptOutput).as_ref(), Success{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&onEncryptOutput).as_ref(), Success{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Child keyring failed to encrypt plaintext data key") })); - if valueOrError3.IsFailure() { - res = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); - return res.read(); - }; - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(&returnMaterials, onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Child keyring performed invalid transition on encryption materials") - })); if valueOrError4.IsFailure() { res = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); return res.read(); }; + if !(_default::_Verified_q(&child) || ({ + let __is_32: Object = child.clone(); + __is_32.clone().is_instance_of::() + })) { + let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Could not retrieve materials required for encryption") + })); + if valueOrError5.IsFailure() { + res = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); + return res.read(); + }; + let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(&returnMaterials, onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Child keyring performed invalid transition on encryption materials") + })); + if valueOrError6.IsFailure() { + res = MaybePlacebo::from(valueOrError6.PropagateFailure::>()); + return res.read(); + } + }; returnMaterials = onEncryptOutput.value().materials().clone(); } - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(input.materials(), &returnMaterials), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("A child or generator keyring modified the encryption materials in illegal ways.") - })); - if valueOrError5.IsFailure() { - res = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); - return res.read(); - }; res = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: Arc::new(OnEncryptOutput::OnEncryptOutput { materials: returnMaterials.clone() @@ -91328,7 +91483,7 @@ pub mod _MultiKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(231,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(353,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -91355,10 +91510,10 @@ pub mod _MultiKeyring_Compile { failures = failures.concat(&seq![result.error().clone()]); } }; - let mut _hi0: DafnyInt = self.childKeyrings().clone().cardinality(); - for j in integer_range(int!(0), _hi0.clone()) { + let mut _hi0: u64 = truncate!(self.childKeyrings().clone().cardinality(), u64); + for j in integer_range(0, _hi0).map(Into::::into) { let mut result: Arc, Arc>>; - let mut _out1: Arc, Arc>> = _default::AttemptDecryptDataKey(&self.childKeyrings().clone().get(&j), input); + let mut _out1: Arc, Arc>> = _default::AttemptDecryptDataKey(&self.childKeyrings().clone().get(&int!((&j).clone())), input); result = _out1.clone(); if matches!((&result).as_ref(), Success{ .. }) { res = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { @@ -91447,7 +91602,7 @@ pub mod RSAEncryption { pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput; pub use ::dafny_runtime::MaybePlacebo; @@ -91456,7 +91611,7 @@ pub mod RSAEncryption { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(11,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(12,3) pub fn GenerateKeyPair(lengthBits: RSAModulusLengthBitsToGenerate) -> (Arc, Arc) { let mut publicKey: Arc; let mut privateKey: Arc; @@ -91482,14 +91637,14 @@ pub mod RSAEncryption { privateKey.clone() ); } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(19,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(20,3) pub fn GetRSAKeyModulusLength(publicKey: &Sequence) -> Arc>> { let mut valueOrError0: Arc>> = RSA::GetRSAKeyModulusLengthExtern(publicKey); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::() } else { let mut length: u32 = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(81) <= int!(length) && int!(length) < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(81 <= length as u64 && (length as u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Unsupported length for RSA modulus.") })); if valueOrError1.IsFailure() { @@ -91501,10 +91656,10 @@ pub mod RSAEncryption { } } } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(28,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(29,3) pub fn Decrypt(input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < input.privateKey().cardinality() && int!(0) < input.cipherText().cardinality(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(input.privateKey().cardinality(), u64) && 0 < truncate!(input.cipherText().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("") })); if valueOrError0.IsFailure() { @@ -91515,10 +91670,10 @@ pub mod RSAEncryption { output = MaybePlacebo::from(_out0.clone()); return output.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(35,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(38,3) pub fn Encrypt(input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < input.publicKey().cardinality() && int!(0) < input.plaintext().cardinality(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(input.publicKey().cardinality(), u64) && 0 < truncate!(input.plaintext().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("") })); if valueOrError0.IsFailure() { @@ -91529,25 +91684,25 @@ pub mod RSAEncryption { output = MaybePlacebo::from(_out0.clone()); return output.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(67,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(72,3) pub fn CreateGetRSAKeyModulusLengthExternSuccess(output: u32) -> Arc>> { Arc::new(Result::>::Success { value: output }) } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(71,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(76,3) pub fn CreateGetRSAKeyModulusLengthExternFailure(error: &Arc) -> Arc>> { Arc::new(Result::>::Failure { error: error.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(75,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(80,3) pub fn CreateBytesSuccess(bytes: &Sequence) -> Arc, Arc>> { Arc::new(Result::, Arc>::Success { value: bytes.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(79,3) + /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(84,3) pub fn CreateBytesFailure(error: &Arc) -> Arc, Arc>> { Arc::new(Result::, Arc>::Failure { error: error.clone() @@ -91564,13 +91719,13 @@ pub mod _Random_Compile { pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::OpaqueError; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(12,3) + /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(13,3) pub fn GenerateBytes(i: i32) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, OpaqueError>>; @@ -91581,7 +91736,7 @@ pub mod _Random_Compile { return res.read(); }; let mut value: Sequence = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(value.cardinality() == int!(i), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(value.cardinality(), u64) == i as u64, &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Incorrect length from ExternRandom.") })); if valueOrError1.IsFailure() { @@ -91598,10 +91753,9 @@ pub mod _Random_Compile { /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(14,1) pub mod _RawAESKeyring_Compile { pub use ::dafny_runtime::Sequence; - pub use ::dafny_runtime::_System::nat; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; pub use ::dafny_runtime::Object; pub use ::dafny_runtime::allocate_object; @@ -91635,6 +91789,7 @@ pub mod _RawAESKeyring_Compile { pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use ::dafny_runtime::string_utf16_of; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; @@ -91665,32 +91820,32 @@ pub mod _RawAESKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(402,3) - pub fn DeserializeEDKCiphertext(ciphertext: &Sequence, tagLen: &nat) -> Arc { - let mut encryptedKeyLength: DafnyInt = ciphertext.cardinality() - tagLen.clone(); + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(442,3) + pub fn DeserializeEDKCiphertext(ciphertext: &Sequence, tagLen: u64) -> Arc { + let mut encryptedKeyLength: u64 = truncate!(ciphertext.cardinality(), u64) - tagLen; Arc::new(AESEncryptOutput::AESEncryptOutput { - cipherText: ciphertext.take(&encryptedKeyLength), - authTag: ciphertext.drop(&encryptedKeyLength) + cipherText: ciphertext.take(&int!((&encryptedKeyLength).clone())), + authTag: ciphertext.drop(&int!((&encryptedKeyLength).clone())) }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(416,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(457,3) pub fn SerializeEDKCiphertext(encOutput: &Arc) -> Sequence { encOutput.cipherText().concat(encOutput.authTag()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(34,3) - pub fn AUTH_TAG_LEN_LEN() -> DafnyInt { - int!(4) - } /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(35,3) - pub fn IV_LEN_LEN() -> DafnyInt { - int!(4) + pub fn AUTH_TAG_LEN_LEN() -> u64 { + 4 + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(36,3) + pub fn IV_LEN_LEN() -> u64 { + 4 } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(37,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(38,3) pub struct RawAESKeyring { - pub __i_cryptoPrimitives: Object, pub __i_wrappingKey: Sequence, + pub __i_cryptoPrimitives: Object, pub __i_wrappingAlgorithm: Arc, pub __i_keyNamespace: ValidUTF8Bytes, pub __i_keyName: ValidUTF8Bytes @@ -91701,10 +91856,10 @@ pub mod _RawAESKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(79,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(81,5) pub fn _ctor(this: &Object, namespace: &ValidUTF8Bytes, name: &ValidUTF8Bytes, key: &Sequence, wrappingAlgorithm: &Arc, cryptoPrimitives: &Object) -> () { - let mut _set___i_cryptoPrimitives: bool = false; let mut _set___i_wrappingKey: bool = false; + let mut _set___i_cryptoPrimitives: bool = false; let mut _set___i_wrappingAlgorithm: bool = false; let mut _set___i_keyNamespace: bool = false; let mut _set___i_keyName: bool = false; @@ -91715,39 +91870,40 @@ pub mod _RawAESKeyring_Compile { update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(360,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(396,5) pub fn SerializeProviderInfo(&self, iv: &Sequence) -> Sequence { self.keyName().clone().concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq((self.wrappingAlgorithm().clone().tagLength().clone() * 8) as u32)).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(self.wrappingAlgorithm().clone().ivLength().clone() as u32)).concat(iv) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(369,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(405,5) pub fn ShouldDecryptEDK(&self, edk: &Arc) -> bool { edk.keyProviderId().clone() == self.keyNamespace().clone() && self.ValidProviderInfo(edk.keyProviderInfo()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(375,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(411,5) pub fn ValidProviderInfo(&self, info: &Sequence) -> bool { - info.cardinality() == self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN() + int!(self.wrappingAlgorithm().clone().ivLength().clone()) && info.slice(&int!(0), &self.keyName().clone().cardinality()) == self.keyName().clone() && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&self.keyName().clone().cardinality(), &(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN()))) == 128 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&self.keyName().clone().cardinality(), &(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN()))) == self.wrappingAlgorithm().clone().tagLength().clone() as u32 * 8 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN()), &(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN()))) == self.wrappingAlgorithm().clone().ivLength().clone() as u32 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN()), &(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN()))) == 12 + let mut keyname_size: u64 = truncate!(self.keyName().clone().cardinality(), u64); + truncate!(info.cardinality(), u64) == crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add4(keyname_size, _default::AUTH_TAG_LEN_LEN(), _default::IV_LEN_LEN(), self.wrappingAlgorithm().clone().ivLength().clone() as u64) && info.take(&int!((&keyname_size).clone())) == self.keyName().clone() && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&int!((&keyname_size).clone()), &int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN())).clone()))) == 128 && 128 == self.wrappingAlgorithm().clone().tagLength().clone() as u32 * 8 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN())).clone()), &int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())).clone()))) == self.wrappingAlgorithm().clone().ivLength().clone() as u32 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN())).clone()), &int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())).clone()))) == 12 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(395,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(434,5) pub fn GetIvFromProvInfo(&self, info: &Sequence) -> Sequence { - info.drop(&(self.keyName().clone().cardinality() + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())) - } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(42,5) - pub fn cryptoPrimitives(&self) -> Object { - self.__i_cryptoPrimitives.clone() + info.drop(&int!((&(truncate!(self.keyName().clone().cardinality(), u64) + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())).clone())) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(73,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(75,5) pub fn wrappingKey(&self) -> Sequence { self.__i_wrappingKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(74,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(43,5) + pub fn cryptoPrimitives(&self) -> Object { + self.__i_cryptoPrimitives.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(76,5) pub fn wrappingAlgorithm(&self) -> Arc { self.__i_wrappingAlgorithm.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(54,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(56,5) pub fn keyNamespace(&self) -> ValidUTF8Bytes { self.__i_keyNamespace.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(55,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(57,5) pub fn keyName(&self) -> ValidUTF8Bytes { self.__i_keyName.clone() } @@ -91768,7 +91924,7 @@ pub mod _RawAESKeyring_Compile { impl IKeyring for RawAESKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(120,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(143,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -91833,7 +91989,7 @@ pub mod _RawAESKeyring_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(241,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(275,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut materials: Arc = input.materials().clone(); @@ -91850,7 +92006,7 @@ pub mod _RawAESKeyring_Compile { return output.read(); }; let mut aad: Sequence = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(self.wrappingKey().clone().cardinality() == int!(self.wrappingAlgorithm().clone().keyLength().clone()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(self.wrappingKey().clone().cardinality(), u64) == self.wrappingAlgorithm().clone().keyLength().clone() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("The wrapping key does not match the wrapping algorithm") })); if valueOrError2.IsFailure() { @@ -91858,10 +92014,10 @@ pub mod _RawAESKeyring_Compile { return output.read(); }; let mut errors: Sequence> = seq![] as Sequence>; - let mut _hi0: DafnyInt = input.encryptedDataKeys().cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { - if self.ShouldDecryptEDK(&input.encryptedDataKeys().get(&i)) { - let mut edk: Arc = input.encryptedDataKeys().get(&i); + let mut _hi0: u64 = truncate!(input.encryptedDataKeys().cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + if self.ShouldDecryptEDK(&input.encryptedDataKeys().get(&int!((&i).clone()))) { + let mut edk: Arc = input.encryptedDataKeys().get(&int!((&i).clone())); let mut iv: Sequence = self.GetIvFromProvInfo(edk.keyProviderInfo()); let mut unwrap: Object; let mut _nw0: Object = AesUnwrapKeyMaterial::_allocate_object(); @@ -91888,7 +92044,7 @@ pub mod _RawAESKeyring_Compile { errors = errors.concat(&seq![unwrapOutput.error().clone()]); } } else { - let mut valueOrError4: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(input.encryptedDataKeys().get(&i).keyProviderId()).MapFailure::>(&({ + let mut valueOrError4: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(input.encryptedDataKeys().get(&int!((&i).clone())).keyProviderId()).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: e.clone() @@ -91901,7 +92057,7 @@ pub mod _RawAESKeyring_Compile { }; let mut extractedKeyProviderId: Sequence = valueOrError4.Extract(); errors = errors.concat(&seq![Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectRawDataKeys(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&i), &string_utf16_of("AESKeyring"), &extractedKeyProviderId) + message: crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectRawDataKeys(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&i).clone())), &string_utf16_of("AESKeyring"), &extractedKeyProviderId) })]); } } @@ -91920,7 +92076,7 @@ pub mod _RawAESKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(429,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(474,3) #[derive(PartialEq, Clone)] pub enum AesUnwrapInfo { AesUnwrapInfo {} @@ -91982,7 +92138,7 @@ pub mod _RawAESKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(430,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(475,3) #[derive(PartialEq, Clone)] pub enum AesWrapInfo { AesWrapInfo { @@ -92050,7 +92206,7 @@ pub mod _RawAESKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(432,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(477,3) pub struct AesGenerateAndWrapKeyMaterial { pub __i_wrap: Object } @@ -92060,13 +92216,13 @@ pub mod _RawAESKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(437,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(482,5) pub fn _ctor(this: &Object, wrap: &Object) -> () { let mut _set___i_wrap: bool = false; update_field_uninit_object!(this.clone(), __i_wrap, _set___i_wrap, wrap.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(435,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(480,5) pub fn wrap(&self) -> Object { self.__i_wrap.clone() } @@ -92095,7 +92251,7 @@ pub mod _RawAESKeyring_Compile { impl Action, Arc>>, Arc>>> for AesGenerateAndWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(486,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(532,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut generateBytesResult: Arc, Arc>>; @@ -92119,7 +92275,8 @@ pub mod _RawAESKeyring_Compile { let mut _out1: Arc>>, Arc>> = Action::, Arc>>, Arc>>>::Invoke(rd!(self.wrap().clone()), &Arc::new(WrapInput::WrapInput { plaintextMaterial: plaintextMaterial.clone(), algorithmSuite: input.algorithmSuite().clone(), - encryptionContext: input.encryptionContext().clone() + encryptionContext: input.encryptionContext().clone(), + serializedEC: input.serializedEC().clone() })); valueOrError1 = _out1.clone(); if valueOrError1.IsFailure() { @@ -92143,7 +92300,7 @@ pub mod _RawAESKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(529,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(576,3) pub struct AesWrapKeyMaterial { pub __i_wrappingKey: Sequence, pub __i_wrappingAlgorithm: Arc, @@ -92155,7 +92312,7 @@ pub mod _RawAESKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(536,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(583,5) pub fn _ctor(this: &Object, wrappingKey: &Sequence, wrappingAlgorithm: &Arc, cryptoPrimitives: &Object) -> () { let mut _set___i_wrappingKey: bool = false; let mut _set___i_wrappingAlgorithm: bool = false; @@ -92165,15 +92322,15 @@ pub mod _RawAESKeyring_Compile { update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(532,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(579,5) pub fn wrappingKey(&self) -> Sequence { self.__i_wrappingKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(533,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(580,5) pub fn wrappingAlgorithm(&self) -> Arc { self.__i_wrappingAlgorithm.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(534,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(581,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } @@ -92202,7 +92359,7 @@ pub mod _RawAESKeyring_Compile { impl Action, Arc>>, Arc>>> for AesWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(591,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(638,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext()); @@ -92267,7 +92424,7 @@ pub mod _RawAESKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(629,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(676,3) pub struct AesUnwrapKeyMaterial { pub __i_wrappingKey: Sequence, pub __i_iv: Sequence, @@ -92280,7 +92437,7 @@ pub mod _RawAESKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(637,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(684,5) pub fn _ctor(this: &Object, wrappingKey: &Sequence, wrappingAlgorithm: &Arc, iv: &Sequence, cryptoPrimitives: &Object) -> () { let mut _set___i_wrappingKey: bool = false; let mut _set___i_iv: bool = false; @@ -92292,19 +92449,19 @@ pub mod _RawAESKeyring_Compile { update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(632,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(679,5) pub fn wrappingKey(&self) -> Sequence { self.__i_wrappingKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(634,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(681,5) pub fn iv(&self) -> Sequence { self.__i_iv.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(633,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(680,5) pub fn wrappingAlgorithm(&self) -> Arc { self.__i_wrappingAlgorithm.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(635,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(682,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } @@ -92333,7 +92490,7 @@ pub mod _RawAESKeyring_Compile { impl Action, Arc>>, Arc>>> for AesUnwrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(699,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(746,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext()); @@ -92342,14 +92499,14 @@ pub mod _RawAESKeyring_Compile { return res.read(); }; let mut aad: Sequence = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(self.wrappingAlgorithm().clone().tagLength().clone()) <= input.wrappedMaterial().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>((self.wrappingAlgorithm().clone().tagLength().clone() as u64) <= truncate!(input.wrappedMaterial().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Insufficient data to decrypt.") })); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::>>>()); return res.read(); }; - let mut encryptionOutput: Arc = _default::DeserializeEDKCiphertext(input.wrappedMaterial(), &int!(self.wrappingAlgorithm().clone().tagLength().clone())); + let mut encryptionOutput: Arc = _default::DeserializeEDKCiphertext(input.wrappedMaterial(), self.wrappingAlgorithm().clone().tagLength().clone() as u64); let mut maybePtKey: Arc, Arc>>; let mut _out0: Arc, Arc>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(self.cryptoPrimitives().clone()), &Arc::new(AESDecryptInput::AESDecryptInput { encAlg: self.wrappingAlgorithm().clone(), @@ -92372,7 +92529,7 @@ pub mod _RawAESKeyring_Compile { return res.read(); }; let mut ptKey: Sequence = valueOrError2.Extract(); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())) == ptKey.cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64 == truncate!(ptKey.cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Plaintext Data Key is not the expected length") })); if valueOrError3.IsFailure() { @@ -92397,7 +92554,7 @@ pub mod _RawAESKeyring_Compile { /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(16,1) pub mod _RawECDHKeyring_Compile { pub use ::dafny_runtime::Sequence; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey; @@ -92414,7 +92571,6 @@ pub mod _RawECDHKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyInput; - pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyOutput; @@ -92464,7 +92620,7 @@ pub mod _RawECDHKeyring_Compile { pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult; pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials; pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey; pub use crate::implementation_from_dafny::_Actions_Compile::Action; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PublicKeyDiscoveryInput; @@ -92479,19 +92635,22 @@ pub mod _RawECDHKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(41,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(42,3) pub fn ValidPublicKeyLength(p: &Sequence) -> bool { - true && (p.cardinality() == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_256() || p.cardinality() == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_384() || p.cardinality() == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_521()) + let mut len: u64 = truncate!(p.cardinality(), u64); + true && (len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_256() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_384() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_521()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(48,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(51,3) pub fn ValidCompressedPublicKeyLength(p: &Sequence) -> bool { - true && (p.cardinality() == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_256() || p.cardinality() == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_384() || p.cardinality() == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_521()) + let mut len: u64 = truncate!(p.cardinality(), u64); + true && (len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_256() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_384() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_521()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(55,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(60,3) pub fn ValidProviderInfoLength(p: &Sequence) -> bool { - p.cardinality() == int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_256_LEN()) || p.cardinality() == int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_384_LEN()) || p.cardinality() == int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN()) + let mut len: u64 = truncate!(p.cardinality(), u64); + len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_256_LEN() as u64 || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_384_LEN() as u64 || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(674,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(719,3) pub fn LocalDeriveSharedSecret(senderPrivateKey: &Arc, recipientPublicKey: &Arc, curveSpec: &Arc, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut maybeSharedSecret: Arc, Arc>>; @@ -92518,7 +92677,7 @@ pub mod _RawECDHKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(708,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(753,3) pub fn CompressPublicKey(publicKey: &Arc, curveSpec: &Arc, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut maybeCompressedPublicKey: Arc, Arc>>; @@ -92538,13 +92697,13 @@ pub mod _RawECDHKeyring_Compile { res = MaybePlacebo::from(valueOrError0.PropagateFailure::>()); return res.read(); }; - let mut compresedPublicKey: Arc = valueOrError0.Extract(); + let mut compressedPublicKey: Arc = valueOrError0.Extract(); res = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { - value: compresedPublicKey.compressedPublicKey().clone() + value: compressedPublicKey.compressedPublicKey().clone() })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(739,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(784,3) pub fn DecompressPublicKey(publicKey: &Sequence, curveSpec: &Arc, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut maybePublicKey: Arc, Arc>>; @@ -92570,11 +92729,11 @@ pub mod _RawECDHKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(770,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(815,3) pub fn SerializeProviderInfo(senderPublicKey: &Sequence, recipientPublicKey: &Sequence) -> Sequence { _default::RAW_ECDH_KEYRING_VERSION().concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(truncate!(recipientPublicKey.cardinality(), u32))).concat(recipientPublicKey).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(truncate!(senderPublicKey.cardinality(), u32))).concat(senderPublicKey) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(790,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(835,3) pub fn GenerateEphemeralEccKeyPair(curveSpec: &Arc, crypto: &Object) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut maybeKeyPair: Arc, Arc>>; @@ -92599,7 +92758,7 @@ pub mod _RawECDHKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(815,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(860,3) pub fn ValidatePublicKey(crypto: &Object, curveSpec: &Arc, publicKey: &Sequence) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut maybeValidate: Arc, Arc>>; @@ -92625,7 +92784,7 @@ pub mod _RawECDHKeyring_Compile { })); return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(843,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(888,3) pub fn CurveSpecTypeToString(c: &Arc) -> Sequence { let mut _source0: Arc = c.clone(); if matches!((&_source0).as_ref(), ECC_NIST_P256{ .. }) { @@ -92642,19 +92801,19 @@ pub mod _RawECDHKeyring_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(853,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(898,3) pub fn E(s: &Sequence) -> Arc { Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: s.clone() }) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(39,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(40,3) pub fn RAW_ECDH_KEYRING_VERSION() -> Sequence { seq![1] } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(66,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(73,3) pub struct RawEcdhKeyring { pub __i_cryptoPrimitives: Object, pub __i_keyAgreementScheme: Arc, @@ -92671,7 +92830,7 @@ pub mod _RawECDHKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(87,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(94,5) pub fn _ctor(this: &Object, keyAgreementScheme: &Arc, curveSpec: &Arc, senderPrivateKey: &Arc>>, senderPublicKey: &Arc>>, recipientPublicKey: &Sequence, compressedSenderPublicKey: &Arc>>, compressedRecipientPublicKey: &Sequence, cryptoPrimitives: &Object) -> () { let mut _set___i_cryptoPrimitives: bool = false; let mut _set___i_keyAgreementScheme: bool = false; @@ -92710,35 +92869,35 @@ pub mod _RawECDHKeyring_Compile { update_field_if_uninit_object!(this, __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, as Default>::default()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(76,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(83,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(74,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(81,5) pub fn keyAgreementScheme(&self) -> Arc { self.__i_keyAgreementScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(75,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(82,5) pub fn curveSpec(&self) -> Arc { self.__i_curveSpec.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(71,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(78,5) pub fn recipientPublicKey(&self) -> Arc { self.__i_recipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(73,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(80,5) pub fn compressedRecipientPublicKey(&self) -> Sequence { self.__i_compressedRecipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(70,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(77,5) pub fn senderPublicKey(&self) -> Arc { self.__i_senderPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(69,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(76,5) pub fn senderPrivateKey(&self) -> Arc { self.__i_senderPrivateKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(72,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(79,5) pub fn compressedSenderPublicKey(&self) -> Sequence { self.__i_compressedSenderPublicKey.clone() } @@ -92759,7 +92918,7 @@ pub mod _RawECDHKeyring_Compile { impl IKeyring for RawEcdhKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(141,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(169,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); if matches!((&self.keyAgreementScheme().clone()).as_ref(), PublicKeyDiscovery{ .. }) { @@ -92888,7 +93047,7 @@ pub mod _RawECDHKeyring_Compile { }; return res.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(293,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(332,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); if matches!((&self.keyAgreementScheme().clone()).as_ref(), EphemeralPrivateKeyToStaticPublicKey{ .. }) { @@ -92926,7 +93085,7 @@ pub mod _RawECDHKeyring_Compile { return res.read(); }; let mut edksToAttempt: Sequence> = valueOrError1.Extract(); - if int!(0) == edksToAttempt.cardinality() { + if 0 == truncate!(edksToAttempt.cardinality(), u64) { let mut valueOrError2: Arc, Arc>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of("")); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); @@ -92972,7 +93131,7 @@ pub mod _RawECDHKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(384,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(424,3) pub struct OnDecryptEcdhDataKeyFilter { pub __i_keyAgreementScheme: Arc, pub __i_compressedRecipientPublicKey: Sequence, @@ -92984,7 +93143,7 @@ pub mod _RawECDHKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(391,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(431,5) pub fn _ctor(this: &Object, keyAgreementScheme: &Arc, compressedRecipientPublicKey: &Sequence, compressedSenderPublicKey: &Arc>>) -> () { let mut _set___i_keyAgreementScheme: bool = false; let mut _set___i_compressedRecipientPublicKey: bool = false; @@ -92999,15 +93158,15 @@ pub mod _RawECDHKeyring_Compile { update_field_if_uninit_object!(this, __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, as Default>::default()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(387,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(427,5) pub fn keyAgreementScheme(&self) -> Arc { self.__i_keyAgreementScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(388,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(428,5) pub fn compressedRecipientPublicKey(&self) -> Sequence { self.__i_compressedRecipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(389,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(429,5) pub fn compressedSenderPublicKey(&self) -> Sequence { self.__i_compressedSenderPublicKey.clone() } @@ -93028,7 +93187,7 @@ pub mod _RawECDHKeyring_Compile { impl DeterministicAction, Arc>>> for OnDecryptEcdhDataKeyFilter { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(419,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(460,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut providerInfo: Sequence = edk.keyProviderInfo().clone(); @@ -93039,27 +93198,27 @@ pub mod _RawECDHKeyring_Compile { })); return res.read(); }; - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerInfo.cardinality() <= int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN()) && _default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && _default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); }; - let mut keyringVersion: u8 = providerInfo.get(&int!(0)); + let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())); let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(seq![keyringVersion] == _default::RAW_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info."))); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::()); return res.read(); }; - let mut recipientPublicKeyLength: DafnyInt = int!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())))); - let mut recipientPublicKeyLengthIndex: DafnyInt = int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()) + recipientPublicKeyLength.clone(); - let mut senderPublicKeyIndex: DafnyInt = recipientPublicKeyLengthIndex.clone() + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex.clone() + int!(4) < providerInfo.cardinality(), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); + let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()))); + let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64; + let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::()); return res.read(); }; - let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &recipientPublicKeyLengthIndex); - let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&senderPublicKeyIndex); + let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone())); + let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&int!((&senderPublicKeyIndex).clone())); if matches!((&self.keyAgreementScheme().clone()).as_ref(), PublicKeyDiscovery{ .. }) { res = MaybePlacebo::from(Arc::new(Result::>::Success { value: self.compressedRecipientPublicKey().clone() == providerInfoRecipientPublicKey.clone() @@ -93080,7 +93239,7 @@ pub mod _RawECDHKeyring_Compile { UpcastObjectFn!(dyn DeterministicAction, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(478,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(520,3) pub struct DecryptSingleEncryptedDataKey { pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey, pub __i_cryptoPrimitives: Object, @@ -93095,7 +93254,7 @@ pub mod _RawECDHKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(491,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(533,5) pub fn _ctor(this: &Object, materials: &DecryptionMaterialsPendingPlaintextDataKey, cryptoPrimitives: &Object, senderPublicKey: &Sequence, recipientPublicKey: &Sequence, keyAgreementScheme: &Arc, curveSpec: &Arc) -> () { let mut _set___i_materials: bool = false; let mut _set___i_cryptoPrimitives: bool = false; @@ -93111,27 +93270,27 @@ pub mod _RawECDHKeyring_Compile { update_field_uninit_object!(this.clone(), __i_curveSpec, _set___i_curveSpec, curveSpec.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(484,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(526,5) pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey { self.__i_materials.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(485,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(527,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(487,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(529,5) pub fn recipientPublicKey(&self) -> Sequence { self.__i_recipientPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(486,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(528,5) pub fn senderPublicKey(&self) -> Sequence { self.__i_senderPublicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(488,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(530,5) pub fn keyAgreementScheme(&self) -> Arc { self.__i_keyAgreementScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(489,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(531,5) pub fn curveSpec(&self) -> Arc { self.__i_curveSpec.clone() } @@ -93152,79 +93311,72 @@ pub mod _RawECDHKeyring_Compile { impl Action, Arc>>> for DecryptSingleEncryptedDataKey { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(543,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(590,5) fn Invoke(&self, edk: &Arc) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderId()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Received invalid EDK provider id for AWS KMS ECDH Keyring") - })); - if valueOrError0.IsFailure() { - res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); - return res.read(); - }; let mut suite: Arc = self.materials().clone().algorithmSuite().clone(); let mut keyProviderId: ValidUTF8Bytes = edk.keyProviderId().clone(); let mut providerInfo: Sequence = edk.keyProviderInfo().clone(); let mut ciphertext: Sequence = edk.ciphertext().clone(); - let mut valueOrError1: Arc, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite); + let mut valueOrError0: Arc, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite); + if valueOrError0.IsFailure() { + res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); + return res.read(); + }; + let mut providerWrappedMaterial: Sequence = valueOrError0.Extract(); + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && _default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); if valueOrError1.IsFailure() { res = MaybePlacebo::from(valueOrError1.PropagateFailure::()); return res.read(); }; - let mut providerWrappedMaterial: Sequence = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(providerInfo.cardinality() <= int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN()) && _default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected"))); + let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())); + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(seq![keyringVersion] == _default::RAW_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info."))); if valueOrError2.IsFailure() { res = MaybePlacebo::from(valueOrError2.PropagateFailure::()); return res.read(); }; - let mut keyringVersion: u8 = providerInfo.get(&int!(0)); - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(seq![keyringVersion] == _default::RAW_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info."))); + let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()))); + let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64; + let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); if valueOrError3.IsFailure() { res = MaybePlacebo::from(valueOrError3.PropagateFailure::()); return res.read(); }; - let mut recipientPublicKeyLength: DafnyInt = int!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())))); - let mut recipientPublicKeyLengthIndex: DafnyInt = int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()) + recipientPublicKeyLength.clone(); - let mut senderPublicKeyIndex: DafnyInt = recipientPublicKeyLengthIndex.clone() + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN(); - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(recipientPublicKeyLengthIndex.clone() + int!(4) < providerInfo.cardinality(), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected."))); + let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone())); + let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&int!((&senderPublicKeyIndex).clone())); + let mut valueOrError4: Arc, Arc>>; + let mut _out0: Arc, Arc>> = _default::DecompressPublicKey(&providerInfoSenderPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); + valueOrError4 = _out0.clone(); if valueOrError4.IsFailure() { res = MaybePlacebo::from(valueOrError4.PropagateFailure::()); return res.read(); }; - let mut providerInfoRecipientPublicKey: Sequence = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &recipientPublicKeyLengthIndex); - let mut providerInfoSenderPublicKey: Sequence = providerInfo.drop(&senderPublicKeyIndex); + let mut senderPublicKey: Sequence = valueOrError4.Extract(); let mut valueOrError5: Arc, Arc>>; - let mut _out0: Arc, Arc>> = _default::DecompressPublicKey(&providerInfoSenderPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); - valueOrError5 = _out0.clone(); + let mut _out1: Arc, Arc>> = _default::DecompressPublicKey(&providerInfoRecipientPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); + valueOrError5 = _out1.clone(); if valueOrError5.IsFailure() { res = MaybePlacebo::from(valueOrError5.PropagateFailure::()); return res.read(); }; - let mut senderPublicKey: Sequence = valueOrError5.Extract(); - let mut valueOrError6: Arc, Arc>>; - let mut _out1: Arc, Arc>> = _default::DecompressPublicKey(&providerInfoRecipientPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); - valueOrError6 = _out1.clone(); + let mut recipientPublicKey: Sequence = valueOrError5.Extract(); + let mut valueOrError6: Arc>>; + let mut _out2: Arc>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &senderPublicKey); + valueOrError6 = _out2.clone(); if valueOrError6.IsFailure() { res = MaybePlacebo::from(valueOrError6.PropagateFailure::()); return res.read(); }; - let mut recipientPublicKey: Sequence = valueOrError6.Extract(); + let mut _v0: bool = valueOrError6.Extract(); let mut valueOrError7: Arc>>; - let mut _out2: Arc>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &senderPublicKey); - valueOrError7 = _out2.clone(); + let mut _out3: Arc>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &recipientPublicKey); + valueOrError7 = _out3.clone(); if valueOrError7.IsFailure() { res = MaybePlacebo::from(valueOrError7.PropagateFailure::()); return res.read(); }; - let mut _v0: bool = valueOrError7.Extract(); - let mut valueOrError8: Arc>>; - let mut _out3: Arc>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &recipientPublicKey); - valueOrError8 = _out3.clone(); - if valueOrError8.IsFailure() { - res = MaybePlacebo::from(valueOrError8.PropagateFailure::()); - return res.read(); - }; - let mut _v1: bool = valueOrError8.Extract(); + let mut _v1: bool = valueOrError7.Extract(); let mut sharedSecretPublicKey = MaybePlacebo::>::new(); let mut sharedSecretPrivateKey = MaybePlacebo::>::new(); let mut _source0: Arc = self.keyAgreementScheme().clone(); @@ -93251,26 +93403,26 @@ pub mod _RawECDHKeyring_Compile { return res.read(); } }; - let mut valueOrError9: Arc>>; + let mut valueOrError8: Arc>>; let mut _out4: Arc>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &sharedSecretPublicKey.read()); - valueOrError9 = _out4.clone(); - if valueOrError9.IsFailure() { - res = MaybePlacebo::from(valueOrError9.PropagateFailure::()); + valueOrError8 = _out4.clone(); + if valueOrError8.IsFailure() { + res = MaybePlacebo::from(valueOrError8.PropagateFailure::()); return res.read(); }; - let mut _v3: bool = valueOrError9.Extract(); - let mut valueOrError10: Arc, Arc>>; + let mut _v3: bool = valueOrError8.Extract(); + let mut valueOrError9: Arc, Arc>>; let mut _out5: Arc, Arc>> = _default::LocalDeriveSharedSecret(&Arc::new(ECCPrivateKey::ECCPrivateKey { pem: sharedSecretPrivateKey.read() }), &Arc::new(ECCPublicKey::ECCPublicKey { der: sharedSecretPublicKey.read() }), &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); - valueOrError10 = _out5.clone(); - if valueOrError10.IsFailure() { - res = MaybePlacebo::from(valueOrError10.PropagateFailure::()); + valueOrError9 = _out5.clone(); + if valueOrError9.IsFailure() { + res = MaybePlacebo::from(valueOrError9.PropagateFailure::()); return res.read(); }; - let mut sharedSecret: Sequence = valueOrError10.Extract(); + let mut sharedSecret: Sequence = valueOrError9.Extract(); let mut ecdhUnwrap: Object; let mut _nw0: Object = EcdhUnwrap::_allocate_object(); EcdhUnwrap::_ctor(&_nw0, &providerInfoSenderPublicKey, &providerInfoRecipientPublicKey, &sharedSecret, &_default::RAW_ECDH_KEYRING_VERSION(), &self.curveSpec().clone(), &self.cryptoPrimitives().clone()); @@ -93278,18 +93430,18 @@ pub mod _RawECDHKeyring_Compile { let mut unwrapOutputRes: Arc>>, Arc>>; let mut _out6: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::>(edk.ciphertext(), &self.materials().clone(), &upcast_object::>>()(ecdhUnwrap.clone())); unwrapOutputRes = _out6.clone(); - let mut valueOrError11: Arc>>, Arc>> = unwrapOutputRes.clone(); - if valueOrError11.IsFailure() { - res = MaybePlacebo::from(valueOrError11.PropagateFailure::()); + let mut valueOrError10: Arc>>, Arc>> = unwrapOutputRes.clone(); + if valueOrError10.IsFailure() { + res = MaybePlacebo::from(valueOrError10.PropagateFailure::()); return res.read(); }; - let mut unwrapOutput: Arc>> = valueOrError11.Extract(); - let mut valueOrError12: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()); - if valueOrError12.IsFailure() { - res = MaybePlacebo::from(valueOrError12.PropagateFailure::()); + let mut unwrapOutput: Arc>> = valueOrError10.Extract(); + let mut valueOrError11: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()); + if valueOrError11.IsFailure() { + res = MaybePlacebo::from(valueOrError11.PropagateFailure::()); return res.read(); }; - let mut result: Arc = valueOrError12.Extract(); + let mut result: Arc = valueOrError11.Extract(); res = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: result.clone() })); @@ -93313,8 +93465,9 @@ pub mod _RawRSAKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient; pub use ::dafny_runtime::update_field_uninit_object; + pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; + pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey; - pub use ::dafny_runtime::int; pub use ::dafny_runtime::UpcastObject; pub use ::dafny_runtime::DynAny; pub use ::dafny_runtime::UpcastObjectFn; @@ -93324,7 +93477,6 @@ pub mod _RawRSAKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput; pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; @@ -93338,8 +93490,9 @@ pub mod _RawRSAKeyring_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials; - pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput; pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; @@ -93368,14 +93521,16 @@ pub mod _RawRSAKeyring_Compile { pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(40,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(41,3) pub struct RawRSAKeyring { pub __i_cryptoPrimitives: Object, + pub __i_privateKeyMaterial: Arc>>, + pub __i_publicKeyMaterial: Arc>>, + pub __i_publicKey: Arc>>, + pub __i_privateKey: Arc>>, pub __i_keyNamespace: ValidUTF8Bytes, pub __i_keyName: ValidUTF8Bytes, - pub __i_paddingScheme: Arc, - pub __i_publicKey: Arc>>, - pub __i_privateKey: Arc>> + pub __i_paddingScheme: Arc } impl RawRSAKeyring { @@ -93383,20 +93538,50 @@ pub mod _RawRSAKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(67,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(76,5) pub fn _ctor(this: &Object, namespace: &ValidUTF8Bytes, name: &ValidUTF8Bytes, publicKey: &Arc>>, privateKey: &Arc>>, paddingScheme: &Arc, cryptoPrimitives: &Object) -> () { let mut _set___i_cryptoPrimitives: bool = false; + let mut _set___i_privateKeyMaterial: bool = false; + let mut _set___i_publicKeyMaterial: bool = false; + let mut _set___i_publicKey: bool = false; + let mut _set___i_privateKey: bool = false; let mut _set___i_keyNamespace: bool = false; let mut _set___i_keyName: bool = false; let mut _set___i_paddingScheme: bool = false; - let mut _set___i_publicKey: bool = false; - let mut _set___i_privateKey: bool = false; update_field_uninit_object!(this.clone(), __i_keyNamespace, _set___i_keyNamespace, namespace.clone()); update_field_uninit_object!(this.clone(), __i_keyName, _set___i_keyName, name.clone()); update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone()); update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone()); update_field_uninit_object!(this.clone(), __i_privateKey, _set___i_privateKey, privateKey.clone()); update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); + let mut localPrivateKeyMaterial: Arc>> = Arc::new(Option::>::None {}); + if matches!(privateKey.as_ref(), Some{ .. }) { + let mut extract: Sequence = privateKey.Extract(); + if 0 < truncate!(extract.cardinality(), u64) { + let mut unwrap: Object; + let mut _nw0: Object = RsaUnwrapKeyMaterial::_allocate_object(); + RsaUnwrapKeyMaterial::_ctor(&_nw0, &extract, paddingScheme, cryptoPrimitives); + unwrap = _nw0.clone(); + localPrivateKeyMaterial = Arc::new(Option::>::Some { + value: unwrap.clone() + }); + } + }; + let mut localPublicKeyMaterial: Arc>> = Arc::new(Option::>::None {}); + if matches!(publicKey.as_ref(), Some{ .. }) { + let mut extract: Sequence = publicKey.Extract(); + if 0 < truncate!(extract.cardinality(), u64) { + let mut wrap: Object; + let mut _nw1: Object = RsaWrapKeyMaterial::_allocate_object(); + RsaWrapKeyMaterial::_ctor(&_nw1, &extract, paddingScheme, cryptoPrimitives); + wrap = _nw1.clone(); + localPublicKeyMaterial = Arc::new(Option::>::Some { + value: wrap.clone() + }); + } + }; + update_field_uninit_object!(this.clone(), __i_publicKeyMaterial, _set___i_publicKeyMaterial, localPublicKeyMaterial.clone()); + update_field_uninit_object!(this.clone(), __i_privateKeyMaterial, _set___i_privateKeyMaterial, localPrivateKeyMaterial.clone()); return (); } /// = aws-encryption-sdk-specification/framework/raw-rsa-keyring.md#ondecrypt @@ -93404,34 +93589,42 @@ pub mod _RawRSAKeyring_Compile { /// # For each encrypted data key, the keyring MUST attempt to decrypt the /// # encrypted data key into plaintext using RSA if and only if the /// # following is true: - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(375,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(437,5) pub fn ShouldDecryptEDK(&self, edk: &Arc) -> bool { - crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()) && edk.keyProviderInfo().clone() == self.keyName().clone() && edk.keyProviderId().clone() == self.keyNamespace().clone() && int!(0) < edk.ciphertext().cardinality() + crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()) && edk.keyProviderInfo().clone() == self.keyName().clone() && edk.keyProviderId().clone() == self.keyNamespace().clone() && 0 < truncate!(edk.ciphertext().cardinality(), u64) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(43,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(60,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(54,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(65,5) + pub fn privateKeyMaterial(&self) -> Arc>> { + self.__i_privateKeyMaterial.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(66,5) + pub fn publicKeyMaterial(&self) -> Arc>> { + self.__i_publicKeyMaterial.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(63,5) + pub fn publicKey(&self) -> Arc>> { + self.__i_publicKey.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(64,5) + pub fn privateKey(&self) -> Arc>> { + self.__i_privateKey.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(61,5) pub fn keyNamespace(&self) -> ValidUTF8Bytes { self.__i_keyNamespace.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(55,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(62,5) pub fn keyName(&self) -> ValidUTF8Bytes { self.__i_keyName.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(58,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(67,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(56,5) - pub fn publicKey(&self) -> Arc>> { - self.__i_publicKey.clone() - } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(57,5) - pub fn privateKey(&self) -> Arc>> { - self.__i_privateKey.clone() - } } impl UpcastObject @@ -93449,10 +93642,10 @@ pub mod _RawRSAKeyring_Compile { impl IKeyring for RawRSAKeyring { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(131,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(192,5) fn _OnEncrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.publicKey().clone()).as_ref(), Some{ .. }) && int!(0) < self.publicKey().clone().Extract().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.publicKeyMaterial().clone()).as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("A RawRSAKeyring without a public key cannot provide OnEncrypt") })); if valueOrError0.IsFailure() { @@ -93461,16 +93654,12 @@ pub mod _RawRSAKeyring_Compile { }; let mut materials: Arc = input.materials().clone(); let mut suite: Arc = materials.algorithmSuite().clone(); - let mut wrap: Object; - let mut _nw0: Object = RsaWrapKeyMaterial::_allocate_object(); - RsaWrapKeyMaterial::_ctor(&_nw0, self.publicKey().clone().value(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone()); - wrap = _nw0.clone(); let mut generateAndWrap: Object; - let mut _nw1: Object = RsaGenerateAndWrapKeyMaterial::_allocate_object(); - RsaGenerateAndWrapKeyMaterial::_ctor(&_nw1, self.publicKey().clone().value(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone()); - generateAndWrap = _nw1.clone(); + let mut _nw0: Object = RsaGenerateAndWrapKeyMaterial::_allocate_object(); + RsaGenerateAndWrapKeyMaterial::_ctor(&_nw0, self.publicKey().clone().value(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone()); + generateAndWrap = _nw0.clone(); let mut valueOrError1: Arc>>, Arc>>; - let mut _out0: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::>(&materials, &upcast_object::>>()(wrap.clone()), &upcast_object::>>()(generateAndWrap.clone())); + let mut _out0: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::>(&materials, &upcast_object::>>()(self.publicKeyMaterial().clone().value().clone()), &upcast_object::>>()(generateAndWrap.clone())); valueOrError1 = _out0.clone(); if valueOrError1.IsFailure() { output = MaybePlacebo::from(valueOrError1.PropagateFailure::>()); @@ -93521,10 +93710,10 @@ pub mod _RawRSAKeyring_Compile { }; return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(273,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(339,5) fn _OnDecrypt_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.privateKey().clone()).as_ref(), Some{ .. }) && int!(0) < self.privateKey().clone().Extract().cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&self.privateKeyMaterial().clone()).as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("A RawRSAKeyring without a private key cannot provide OnEncrypt") })); if valueOrError0.IsFailure() { @@ -93540,16 +93729,12 @@ pub mod _RawRSAKeyring_Compile { return output.read(); }; let mut errors: Sequence> = seq![] as Sequence>; - let mut _hi0: DafnyInt = input.encryptedDataKeys().cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { - if self.ShouldDecryptEDK(&input.encryptedDataKeys().get(&i)) { - let mut edk: Arc = input.encryptedDataKeys().get(&i); - let mut unwrap: Object; - let mut _nw0: Object = RsaUnwrapKeyMaterial::_allocate_object(); - RsaUnwrapKeyMaterial::_ctor(&_nw0, &self.privateKey().clone().Extract(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone()); - unwrap = _nw0.clone(); + let mut _hi0: u64 = truncate!(input.encryptedDataKeys().cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + if self.ShouldDecryptEDK(&input.encryptedDataKeys().get(&int!((&i).clone()))) { + let mut edk: Arc = input.encryptedDataKeys().get(&int!((&i).clone())); let mut unwrapOutput: Arc>>, Arc>>; - let mut _out0: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::>(edk.ciphertext(), &materials, &upcast_object::>>()(unwrap.clone())); + let mut _out0: Arc>>, Arc>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::>(edk.ciphertext(), &materials, &upcast_object::>>()(self.privateKeyMaterial().clone().value().clone())); unwrapOutput = _out0.clone(); if matches!((&unwrapOutput).as_ref(), Success{ .. }) { let mut valueOrError2: Arc, Arc>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&materials, unwrapOutput.value().plaintextDataKey(), unwrapOutput.value().symmetricSigningKey()); @@ -93568,7 +93753,7 @@ pub mod _RawRSAKeyring_Compile { errors = errors.concat(&seq![unwrapOutput.error().clone()]); } } else { - let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(input.encryptedDataKeys().get(&i).keyProviderId()).MapFailure::>(&({ + let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::UTF8::_default::Decode(input.encryptedDataKeys().get(&int!((&i).clone())).keyProviderId()).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: e.clone() @@ -93581,14 +93766,14 @@ pub mod _RawRSAKeyring_Compile { }; let mut extractedKeyProviderId: Sequence = valueOrError3.Extract(); errors = errors.concat(&seq![Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { - message: crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectRawDataKeys(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&i), &string_utf16_of("RSAKeyring"), &extractedKeyProviderId) + message: crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectRawDataKeys(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&i).clone())), &string_utf16_of("RSAKeyring"), &extractedKeyProviderId) })]); } } output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Failure { error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors { list: errors.clone(), - message: string_utf16_of("Raw RSA Key was unable to decrypt any encrypted data key. The list of encountered Exceptions is avaible via `list`.") + message: string_utf16_of("Raw RSA Key was unable to decrypt any encrypted data key. The list of encountered Exceptions is available via `list`.") }) })); return output.read(); @@ -93600,7 +93785,7 @@ pub mod _RawRSAKeyring_Compile { UpcastObjectFn!(dyn IKeyring); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(407,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(470,3) #[derive(PartialEq, Clone)] pub enum RsaUnwrapInfo { RsaUnwrapInfo {} @@ -93662,7 +93847,7 @@ pub mod _RawRSAKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(409,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(472,3) #[derive(PartialEq, Clone)] pub enum RsaWrapInfo { RsaWrapInfo {} @@ -93724,7 +93909,7 @@ pub mod _RawRSAKeyring_Compile { } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(411,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(474,3) pub struct RsaGenerateAndWrapKeyMaterial { pub __i_publicKey: Sequence, pub __i_paddingScheme: Arc, @@ -93736,7 +93921,7 @@ pub mod _RawRSAKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(418,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(481,5) pub fn _ctor(this: &Object, publicKey: &Sequence, paddingScheme: &Arc, cryptoPrimitives: &Object) -> () { let mut _set___i_publicKey: bool = false; let mut _set___i_paddingScheme: bool = false; @@ -93746,15 +93931,15 @@ pub mod _RawRSAKeyring_Compile { update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(414,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(477,5) pub fn publicKey(&self) -> Sequence { self.__i_publicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(415,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(478,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(416,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(479,5) pub fn cryptoPrimitives(&self) -> Object { self.__i_cryptoPrimitives.clone() } @@ -93783,7 +93968,7 @@ pub mod _RawRSAKeyring_Compile { impl Action, Arc>>, Arc>>> for RsaGenerateAndWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(457,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(520,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut generateBytesResult: Arc, Arc>>; @@ -93811,7 +93996,8 @@ pub mod _RawRSAKeyring_Compile { let mut _out1: Arc>>, Arc>> = Action::, Arc>>, Arc>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput { plaintextMaterial: plaintextMaterial.clone(), algorithmSuite: input.algorithmSuite().clone(), - encryptionContext: input.encryptionContext().clone() + encryptionContext: input.encryptionContext().clone(), + serializedEC: input.serializedEC().clone() })); valueOrError1 = _out1.clone(); if valueOrError1.IsFailure() { @@ -93836,11 +94022,11 @@ pub mod _RawRSAKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(505,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(569,3) pub struct RsaWrapKeyMaterial { + pub __i_cryptoPrimitives: Object, pub __i_publicKey: Sequence, - pub __i_paddingScheme: Arc, - pub __i_cryptoPrimitives: Object + pub __i_paddingScheme: Arc } impl RsaWrapKeyMaterial { @@ -93848,28 +94034,28 @@ pub mod _RawRSAKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(512,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(576,5) pub fn _ctor(this: &Object, publicKey: &Sequence, paddingScheme: &Arc, cryptoPrimitives: &Object) -> () { + let mut _set___i_cryptoPrimitives: bool = false; let mut _set___i_publicKey: bool = false; let mut _set___i_paddingScheme: bool = false; - let mut _set___i_cryptoPrimitives: bool = false; update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone()); update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone()); update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(508,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(574,5) + pub fn cryptoPrimitives(&self) -> Object { + self.__i_cryptoPrimitives.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(572,5) pub fn publicKey(&self) -> Sequence { self.__i_publicKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(509,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(573,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(510,5) - pub fn cryptoPrimitives(&self) -> Object { - self.__i_cryptoPrimitives.clone() - } } impl UpcastObject @@ -93895,7 +94081,7 @@ pub mod _RawRSAKeyring_Compile { impl Action, Arc>>, Arc>>> for RsaWrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(560,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(623,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut RSAEncryptOutput: Arc, Arc>>; @@ -93933,11 +94119,11 @@ pub mod _RawRSAKeyring_Compile { UpcastObjectFn!(dyn Action, Arc>>, Arc>>>); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(601,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(664,3) pub struct RsaUnwrapKeyMaterial { + pub __i_cryptoPrimitives: Object, pub __i_privateKey: Sequence, - pub __i_paddingScheme: Arc, - pub __i_cryptoPrimitives: Object + pub __i_paddingScheme: Arc } impl RsaUnwrapKeyMaterial { @@ -93945,28 +94131,28 @@ pub mod _RawRSAKeyring_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(608,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(671,5) pub fn _ctor(this: &Object, privateKey: &Sequence, paddingScheme: &Arc, cryptoPrimitives: &Object) -> () { + let mut _set___i_cryptoPrimitives: bool = false; let mut _set___i_privateKey: bool = false; let mut _set___i_paddingScheme: bool = false; - let mut _set___i_cryptoPrimitives: bool = false; update_field_uninit_object!(this.clone(), __i_privateKey, _set___i_privateKey, privateKey.clone()); update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone()); update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(604,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(669,5) + pub fn cryptoPrimitives(&self) -> Object { + self.__i_cryptoPrimitives.clone() + } + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(667,5) pub fn privateKey(&self) -> Sequence { self.__i_privateKey.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(605,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(668,5) pub fn paddingScheme(&self) -> Arc { self.__i_paddingScheme.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(606,5) - pub fn cryptoPrimitives(&self) -> Object { - self.__i_cryptoPrimitives.clone() - } } impl UpcastObject @@ -93992,7 +94178,7 @@ pub mod _RawRSAKeyring_Compile { impl Action, Arc>>, Arc>>> for RsaUnwrapKeyMaterial { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(655,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(717,5) fn Invoke(&self, input: &Arc) -> Arc>>, Arc>> { let mut res = MaybePlacebo::>>, Arc>>>::new(); let mut suite: Arc = input.algorithmSuite().clone(); @@ -94017,7 +94203,7 @@ pub mod _RawRSAKeyring_Compile { return res.read(); }; let mut decryptResult: Sequence = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(decryptResult.cardinality() == int!(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(decryptResult.cardinality(), u64) == crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("Invalid plaintext length.") })); if valueOrError1.IsFailure() { @@ -94048,7 +94234,7 @@ pub mod _RawRSAKeyring_Compile { pub mod _Relations_Compile { } -/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(11,1) +/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(12,1) pub mod _RequiredEncryptionContextCMM_Compile { pub use ::dafny_runtime::Object; pub use ::dafny_runtime::allocate_object; @@ -94073,11 +94259,12 @@ pub mod _RequiredEncryptionContextCMM_Compile { pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use ::dafny_runtime::seq; + pub use crate::implementation_from_dafny::_DefaultCMM_Compile::DefaultCMM; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(21,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(24,3) pub struct RequiredEncryptionContextCMM { pub __i_underlyingCMM: Object, pub __i_requiredEncryptionContextKeys: Sequence @@ -94088,7 +94275,7 @@ pub mod _RequiredEncryptionContextCMM_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(36,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(39,5) pub fn _ctor(this: &Object, inputCMM: &Object, inputKeys: &Set) -> () { let mut _set___i_underlyingCMM: bool = false; let mut _set___i_requiredEncryptionContextKeys: bool = false; @@ -94100,11 +94287,11 @@ pub mod _RequiredEncryptionContextCMM_Compile { update_field_uninit_object!(this.clone(), __i_requiredEncryptionContextKeys, _set___i_requiredEncryptionContextKeys, keySeq.clone()); return (); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(24,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(27,5) pub fn underlyingCMM(&self) -> Object { self.__i_underlyingCMM.clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(25,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(28,5) pub fn requiredEncryptionContextKeys(&self) -> Sequence { self.__i_requiredEncryptionContextKeys.clone() } @@ -94125,7 +94312,7 @@ pub mod _RequiredEncryptionContextCMM_Compile { impl ICryptographicMaterialsManager for RequiredEncryptionContextCMM { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(70,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(85,5) fn _GetEncryptionMaterials_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({ @@ -94151,15 +94338,15 @@ pub mod _RequiredEncryptionContextCMM_Compile { }; let mut valueOrError1: Arc, Arc>>; let mut _out0: Arc, Arc>> = ICryptographicMaterialsManager::GetEncryptionMaterials(rd!(self.underlyingCMM().clone()), &({ - let __pat_let18_0: Arc = input.clone(); + let __pat_let33_0: Arc = input.clone(); { - let _dt__update__tmp_h0: Arc = __pat_let18_0.clone(); + let _dt__update__tmp_h0: Arc = __pat_let33_0.clone(); { - let __pat_let19_0: Arc>> = Arc::new(Option::>::Some { + let __pat_let34_0: Arc>> = Arc::new(Option::>::Some { value: input.requiredEncryptionContextKeys().UnwrapOr(&(seq![] as Sequence)).concat(&self.requiredEncryptionContextKeys().clone()) }); { - let _dt__update_hrequiredEncryptionContextKeys_h0: Arc>> = __pat_let19_0.clone(); + let _dt__update_hrequiredEncryptionContextKeys_h0: Arc>> = __pat_let34_0.clone(); Arc::new(GetEncryptionMaterialsInput::GetEncryptionMaterialsInput { encryptionContext: _dt__update__tmp_h0.encryptionContext().clone(), commitmentPolicy: _dt__update__tmp_h0.commitmentPolicy().clone(), @@ -94177,47 +94364,55 @@ pub mod _RequiredEncryptionContextCMM_Compile { return output.read(); }; let mut result: Arc = valueOrError1.Extract(); - let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({ - let mut _this = Object::<_>::from_ref(self); - let mut result = result.clone(); - Arc::new(move |__forall_var_1: ValidUTF8Bytes| -> bool{ - let mut k: ValidUTF8Bytes = __forall_var_1.clone(); - if { - let i: Sequence = k.clone(); - crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i) - } { - !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || result.encryptionMaterials().requiredEncryptionContextKeys().contains(&k) - } else { - true - } - }) - }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Expected encryption context keys do not exist in keys to only authenticate.") - })); - if valueOrError2.IsFailure() { - output = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); - return output.read(); - }; - let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(result.encryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Could not retrieve materials required for encryption") - })); - if valueOrError3.IsFailure() { - output = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); - return output.read(); - }; - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_CMM_Compile::_default::_RequiredEncryptionContextKeys_q(input.requiredEncryptionContextKeys(), result.encryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Keyring returned an invalid response") - })); - if valueOrError4.IsFailure() { - output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); - return output.read(); + if !(({ + let __is_35: Object = self.underlyingCMM().clone(); + __is_35.clone().is_instance_of::() + }) || ({ + let __is_36: Object = self.underlyingCMM().clone(); + __is_36.clone().is_instance_of::() + })) { + let mut valueOrError2: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({ + let mut _this = Object::<_>::from_ref(self); + let mut result = result.clone(); + Arc::new(move |__forall_var_1: ValidUTF8Bytes| -> bool{ + let mut k: ValidUTF8Bytes = __forall_var_1.clone(); + if { + let i: Sequence = k.clone(); + crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i) + } { + !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || result.encryptionMaterials().requiredEncryptionContextKeys().contains(&k) + } else { + true + } + }) + }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Expected encryption context keys do not exist in keys to only authenticate.") + })); + if valueOrError2.IsFailure() { + output = MaybePlacebo::from(valueOrError2.PropagateFailure::>()); + return output.read(); + }; + let mut valueOrError3: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(result.encryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Could not retrieve materials required for encryption") + })); + if valueOrError3.IsFailure() { + output = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); + return output.read(); + }; + let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_CMM_Compile::_default::_RequiredEncryptionContextKeys_q(input.requiredEncryptionContextKeys(), result.encryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Keyring returned an invalid response") + })); + if valueOrError4.IsFailure() { + output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); + return output.read(); + } }; output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: result.clone() })); return output.read(); } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(192,5) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(241,5) fn _DecryptMaterials_k(&self, input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!(input.reproducedEncryptionContext().as_ref(), Some{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException { @@ -94263,40 +94458,48 @@ pub mod _RequiredEncryptionContextCMM_Compile { return output.read(); }; let mut result: Arc = valueOrError3.Extract(); - let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({ - let mut _this = Object::<_>::from_ref(self); - let mut result = result.clone(); - Arc::new(move |__forall_var_1: ValidUTF8Bytes| -> bool{ - let mut k: ValidUTF8Bytes = __forall_var_1.clone(); - if { - let i: Sequence = k.clone(); - crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i) - } { - !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || result.decryptionMaterials().encryptionContext().contains(&k) - } else { - true - } - }) - }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Final encryption context missing required keys.") - })); - if valueOrError4.IsFailure() { - output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); - return output.read(); - }; - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_CMM_Compile::_default::EncryptionContextComplete(input, result.decryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Reproduced encryption context missing from encryption context.") - })); - if valueOrError5.IsFailure() { - output = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); - return output.read(); - }; - let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithPlaintextDataKey(result.decryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { - message: string_utf16_of("Keyring.OnDecrypt failed to decrypt the plaintext data key.") - })); - if valueOrError6.IsFailure() { - output = MaybePlacebo::from(valueOrError6.PropagateFailure::>()); - return output.read(); + if !(({ + let __is_37: Object = self.underlyingCMM().clone(); + __is_37.clone().is_instance_of::() + }) || ({ + let __is_38: Object = self.underlyingCMM().clone(); + __is_38.clone().is_instance_of::() + })) { + let mut valueOrError4: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({ + let mut _this = Object::<_>::from_ref(self); + let mut result = result.clone(); + Arc::new(move |__forall_var_1: ValidUTF8Bytes| -> bool{ + let mut k: ValidUTF8Bytes = __forall_var_1.clone(); + if { + let i: Sequence = k.clone(); + crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i) + } { + !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || result.decryptionMaterials().encryptionContext().contains(&k) + } else { + true + } + }) + }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Final encryption context missing required keys.") + })); + if valueOrError4.IsFailure() { + output = MaybePlacebo::from(valueOrError4.PropagateFailure::>()); + return output.read(); + }; + let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_CMM_Compile::_default::EncryptionContextComplete(input, result.decryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Reproduced encryption context missing from encryption context.") + })); + if valueOrError5.IsFailure() { + output = MaybePlacebo::from(valueOrError5.PropagateFailure::>()); + return output.read(); + }; + let mut valueOrError6: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithPlaintextDataKey(result.decryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + message: string_utf16_of("Keyring.OnDecrypt failed to decrypt the plaintext data key.") + })); + if valueOrError6.IsFailure() { + output = MaybePlacebo::from(valueOrError6.PropagateFailure::>()); + return output.read(); + } }; output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: result.clone() @@ -94821,18 +95024,21 @@ pub mod _SerializableTypes_Compile { pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey; pub use ::dafny_runtime::Map; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::itertools::Itertools; pub use ::dafny_runtime::Sequence; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM; - pub use ::dafny_runtime::_System::nat; - pub use ::dafny_runtime::int; - pub use ::std::marker::Sync; - pub use ::std::marker::Send; + pub use ::dafny_runtime::seq; pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::integer_range; pub use ::dafny_runtime::Zero; + pub use ::dafny_runtime::int; + pub use ::std::marker::Sync; + pub use ::std::marker::Send; + pub use ::std::default::Default; + pub use ::std::convert::Into; pub use ::dafny_runtime::DafnyType; pub use ::std::fmt::Debug; pub use ::std::fmt::Formatter; @@ -94841,19 +95047,18 @@ pub mod _SerializableTypes_Compile { pub use ::std::cmp::Eq; pub use ::std::hash::Hash; pub use ::std::hash::Hasher; - pub use ::std::default::Default; pub use ::std::convert::AsRef; pub struct _default {} impl _default { - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(21,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(22,3) pub fn IsESDKEncryptedDataKey(edk: &Arc) -> bool { crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::(edk.keyProviderId()) && crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderId()) && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::(edk.keyProviderInfo()) && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::(edk.ciphertext()) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(35,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(36,3) pub fn IsESDKEncryptionContext(ec: &Map) -> bool { - ec.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT() && _default::Length(ec) < _default::ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH() && Itertools::unique((&ec.keys().as_dafny_multiset().merge(&ec.values().as_dafny_multiset())).iter()).all(({ + truncate!(ec.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64) && _default::Length(ec) < _default::ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH() && Itertools::unique((&ec.keys().as_dafny_multiset().merge(&ec.values().as_dafny_multiset())).iter()).all(({ let mut ec = ec.clone(); Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{ let mut element: ValidUTF8Bytes = __forall_var_0.clone(); @@ -94868,37 +95073,53 @@ pub mod _SerializableTypes_Compile { }) }).as_ref()) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(49,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(51,3) pub fn GetIvLength(a: &Arc) -> u8 { let mut _source0: Arc = a.encrypt().clone(); let mut ___mcc_h0: Arc = _source0.AES_GCM().clone(); let mut e: Arc = ___mcc_h0.clone(); e.ivLength().clone() as u8 } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(56,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(58,3) + pub fn GetIvLengthZeros(a: &Arc) -> Sequence { + let mut len: u8 = _default::GetIvLength(a); + if len == 12 { + seq![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + } else { + { + let _initializer = { + Arc::new(move |_v0: &DafnyInt| -> u8{ + 0 + }) + }; + integer_range(Zero::zero(), int!(len)).map(move |i| _initializer(&i)).collect::>() + } + } + } + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(70,3) pub fn GetTagLength(a: &Arc) -> u8 { let mut _source0: Arc = a.encrypt().clone(); let mut ___mcc_h0: Arc = _source0.AES_GCM().clone(); let mut e: Arc = ___mcc_h0.clone(); e.tagLength().clone() as u8 } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(63,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(77,3) pub fn GetEncryptKeyLength(a: &Arc) -> i32 { let mut _source0: Arc = a.encrypt().clone(); let mut ___mcc_h0: Arc = _source0.AES_GCM().clone(); let mut e: Arc = ___mcc_h0.clone(); e.keyLength().clone() } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(86,3) - pub fn Length(encryptionContext: &Map) -> nat { - if encryptionContext.cardinality() == int!(0) { - int!(0) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(100,3) + pub fn Length(encryptionContext: &Map) -> u64 { + if truncate!(encryptionContext.cardinality(), u64) == 0 { + 0 } else { let mut pairs: Sequence>> = _default::GetCanonicalLinearPairs(encryptionContext); _default::LinearLength(&pairs) } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(102,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(117,3) pub fn GetCanonicalLinearPairs(encryptionContext: &Map) -> Sequence>> { let mut keys: Sequence = crate::implementation_from_dafny::SortedSets::_default::SetToOrderedSequence2::(&encryptionContext.keys(), &(Arc::new(move |x0: &u8,x1: &u8| crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt8Less(x0.clone(), x1.clone())) as Arc _ + Sync + Send>)); { @@ -94919,36 +95140,31 @@ pub mod _SerializableTypes_Compile { integer_range(Zero::zero(), keys.cardinality()).map(move |i| _initializer(&i)).collect::>() } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(152,3) - pub fn LinearLength(pairs: &Sequence>>) -> nat { - let mut _accumulator: nat = int!(0); - let mut _r0 = pairs.clone(); - 'TAIL_CALL_START: loop { - let pairs = _r0; - if pairs.cardinality() == int!(0) { - return int!(0) + _accumulator.clone(); - } else { - _accumulator = _default::PairLength(&crate::implementation_from_dafny::_Seq_Compile::_default::Last::>>(&pairs)) + _accumulator.clone(); - let mut _in0: Sequence>> = crate::implementation_from_dafny::_Seq_Compile::_default::DropLast::>>(&pairs); - _r0 = _in0.clone(); - continue 'TAIL_CALL_START; - } + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(167,3) + pub fn LinearLength(pairs: &Sequence>>) -> u64 { + let mut ret: u64 = ::default(); + let mut result: u64 = 0; + let mut _hi0: u64 = truncate!(pairs.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + result = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(result, _default::PairLength(&pairs.get(&int!((&i).clone())))); } + ret = result; + return ret; } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(166,3) - pub fn PairLength(pair: &Arc>) -> nat { - int!(2) + pair.key().cardinality() + int!(2) + pair.value().cardinality() + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(200,3) + pub fn PairLength(pair: &Arc>) -> u64 { + crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add4(2, truncate!(pair.key().cardinality(), u64), 2, truncate!(pair.value().cardinality(), u64)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(33,3) - pub fn ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH() -> DafnyInt { - crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT() - int!(2) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(34,3) + pub fn ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH() -> u64 { + truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64) - 2 } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(15,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(16,3) pub type ShortUTF8Seq = Sequence; - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(18,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(19,3) #[derive(PartialEq, Clone)] pub enum Pair { Pair { @@ -95027,22 +95243,20 @@ pub mod _SerializableTypes_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(28,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(29,3) pub type ESDKEncryptedDataKey = Arc; - /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(45,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(47,3) pub type ESDKEncryptionContext = Map; } /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(6,1) pub mod _SerializeFunctions_Compile { pub use ::dafny_runtime::Sequence; pub use ::std::sync::Arc; - pub use ::dafny_runtime::_System::nat; - pub use ::dafny_runtime::DafnyInt; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16; - pub use ::dafny_runtime::truncate; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq32; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64; pub use ::dafny_runtime::DafnyCharUTF16; @@ -95059,34 +95273,34 @@ pub mod _SerializeFunctions_Compile { pub struct _default {} impl _default { - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(168,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(169,3) pub fn Write(data: &Sequence) -> Sequence { data.clone() } /// Optional elements in a data structure can be represented with a length of 0 bytes. - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(177,3) - pub fn Read(buffer: &Arc, length: &nat) -> Arc>>, MoreNeeded>> { - let mut end: DafnyInt = buffer.start().clone() + length.clone(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(buffer.bytes().cardinality() >= end.clone(), &Arc::new(ReadProblems::MoreNeeded { - pos: end.clone() + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(178,3) + pub fn Read(buffer: &Arc, length: u64) -> Arc>>, MoreNeeded>> { + let mut end: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(buffer.start().clone(), length); + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(buffer.bytes().cardinality(), u64) >= end, &Arc::new(ReadProblems::MoreNeeded { + pos: end })); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>>, Arc>::Success { value: Arc::new(SuccessfulRead::>::SuccessfulRead { - data: buffer.bytes().slice(buffer.start(), &end), + data: buffer.bytes().slice(&int!(buffer.start().clone()), &int!((&end).clone())), tail: { - let __pat_let20_0: Arc = buffer.clone(); + let __pat_let39_0: Arc = buffer.clone(); { - let _dt__update__tmp_h0: Arc = __pat_let20_0.clone(); + let _dt__update__tmp_h0: Arc = __pat_let39_0.clone(); { - let __pat_let21_0: DafnyInt = end.clone(); + let __pat_let40_0: u64 = end; { - let _dt__update_hstart_h0: nat = __pat_let21_0.clone(); + let _dt__update_hstart_h0: u64 = __pat_let40_0; Arc::new(ReadableBuffer::ReadableBuffer { bytes: _dt__update__tmp_h0.bytes().clone(), - start: _dt__update_hstart_h0.clone() + start: _dt__update_hstart_h0 }) } } @@ -95096,13 +95310,13 @@ pub mod _SerializeFunctions_Compile { }) } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(206,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(208,3) pub fn WriteUint16(number: u16) -> Sequence { _default::Write(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(number)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(214,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(216,3) pub fn ReadUInt16(buffer: &Arc) -> Arc>, MoreNeeded>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = _default::Read(buffer, &int!(2)); + let mut valueOrError0: Arc>>, MoreNeeded>> = _default::Read(buffer, 2); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -95117,13 +95331,13 @@ pub mod _SerializeFunctions_Compile { }) } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(225,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(227,3) pub fn WriteUint32(number: u32) -> Sequence { _default::Write(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(number)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(233,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(235,3) pub fn ReadUInt32(buffer: &Arc) -> Arc>, MoreNeeded>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = _default::Read(buffer, &int!(4)); + let mut valueOrError0: Arc>>, MoreNeeded>> = _default::Read(buffer, 4); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -95138,13 +95352,13 @@ pub mod _SerializeFunctions_Compile { }) } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(244,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(246,3) pub fn WriteUint64(number: u64) -> Sequence { _default::Write(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt64ToSeq(number)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(252,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(254,3) pub fn ReadUInt64(buffer: &Arc) -> Arc>, MoreNeeded>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = _default::Read(buffer, &int!(8)); + let mut valueOrError0: Arc>>, MoreNeeded>> = _default::Read(buffer, 8); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -95159,18 +95373,18 @@ pub mod _SerializeFunctions_Compile { }) } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(263,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(265,3) pub fn WriteShortLengthSeq(d: &seq16) -> Sequence { _default::WriteUint16(truncate!(d.cardinality(), u16)).concat(&_default::Write(d)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(272,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(274,3) pub fn ReadShortLengthSeq(buffer: &Arc) -> Arc>>, Arc>> { let mut valueOrError0: Arc>, MoreNeeded>> = _default::ReadUInt16(buffer); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { let mut length: Arc> = valueOrError0.Extract(); - let mut valueOrError1: Arc>>, MoreNeeded>> = _default::Read(length.tail(), &int!(length.data().clone())); + let mut valueOrError1: Arc>>, MoreNeeded>> = _default::Read(length.tail(), length.data().clone() as u64); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>>>() } else { @@ -95181,18 +95395,18 @@ pub mod _SerializeFunctions_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(290,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(292,3) pub fn WriteUint32Seq(d: &seq32) -> Sequence { _default::WriteUint32(truncate!(d.cardinality(), u32)).concat(&_default::Write(d)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(299,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(301,3) pub fn ReadUint32Seq(buffer: &Arc) -> Arc>>, Arc>> { let mut valueOrError0: Arc>, MoreNeeded>> = _default::ReadUInt32(buffer); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { let mut length: Arc> = valueOrError0.Extract(); - let mut valueOrError1: Arc>>, MoreNeeded>> = _default::Read(length.tail(), &int!(length.data().clone())); + let mut valueOrError1: Arc>>, MoreNeeded>> = _default::Read(length.tail(), length.data().clone() as u64); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>>>() } else { @@ -95203,18 +95417,18 @@ pub mod _SerializeFunctions_Compile { } } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(318,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(320,3) pub fn WriteUint64Seq(d: &seq64) -> Sequence { _default::WriteUint64(truncate!(d.cardinality(), u64)).concat(&_default::Write(d)) } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(327,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(329,3) pub fn ReadUint64Seq(buffer: &Arc) -> Arc>>, Arc>> { let mut valueOrError0: Arc>, MoreNeeded>> = _default::ReadUInt64(buffer); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { let mut length: Arc> = valueOrError0.Extract(); - let mut valueOrError1: Arc>>, MoreNeeded>> = _default::Read(length.tail(), &int!(length.data().clone())); + let mut valueOrError1: Arc>>, MoreNeeded>> = _default::Read(length.tail(), length.data().clone()); if valueOrError1.IsFailure() { valueOrError1.PropagateFailure::>>>() } else { @@ -95227,11 +95441,11 @@ pub mod _SerializeFunctions_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(12,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(13,3) #[derive(PartialEq, Clone)] pub enum ReadProblems { MoreNeeded { - pos: nat + pos: u64 }, Error { message: Sequence @@ -95240,7 +95454,7 @@ pub mod _SerializeFunctions_Compile { impl ReadProblems { /// Gets the field pos for all enum members which have it - pub fn pos(&self) -> &nat { + pub fn pos(&self) -> &u64 { match self { ReadProblems::MoreNeeded{pos, } => pos, ReadProblems::Error{message, } => panic!("field does not exist on this variant"), @@ -95315,15 +95529,15 @@ pub mod _SerializeFunctions_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(24,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(25,3) pub type MoreNeeded = Arc; - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(30,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(31,3) #[derive(PartialEq, Clone)] pub enum ReadableBuffer { ReadableBuffer { bytes: Sequence, - start: nat + start: u64 } } @@ -95335,7 +95549,7 @@ pub mod _SerializeFunctions_Compile { } } /// Returns a borrow of the field start - pub fn start(&self) -> &nat { + pub fn start(&self) -> &u64 { match self { ReadableBuffer::ReadableBuffer{bytes, start, } => start, } @@ -95397,7 +95611,7 @@ pub mod _SerializeFunctions_Compile { } } - /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(38,3) + /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(39,3) #[derive(PartialEq, Clone)] pub enum SuccessfulRead { SuccessfulRead { @@ -95486,7 +95700,6 @@ pub mod _SharedHeaderFunctions_Compile { pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems; pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded; - pub use ::dafny_runtime::int; pub use ::dafny_runtime::DafnyCharUTF16; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite; pub use ::dafny_runtime::Object; @@ -95501,6 +95714,8 @@ pub mod _SharedHeaderFunctions_Compile { pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType; pub use ::dafny_runtime::seq; + pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub struct _default {} @@ -95511,7 +95726,7 @@ pub mod _SharedHeaderFunctions_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(31,3) pub fn ReadMessageFormatVersion(buffer: &Arc) -> Arc>>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!(1)); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { @@ -95542,7 +95757,7 @@ pub mod _SharedHeaderFunctions_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(51,3) pub fn ReadESDKSuiteId(buffer: &Arc, mpl: &Object) -> Arc>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!(2)); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 2); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -95588,7 +95803,7 @@ pub mod _SharedHeaderFunctions_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(83,3) pub fn ReadMessageIdV1(buffer: &Arc) -> Arc>, MoreNeeded>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V1()); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V1()); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -95604,7 +95819,7 @@ pub mod _SharedHeaderFunctions_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(95,3) pub fn ReadMessageIdV2(buffer: &Arc) -> Arc>, MoreNeeded>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V2()); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V2()); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -95624,14 +95839,14 @@ pub mod _SharedHeaderFunctions_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(115,3) pub fn ReadContentType(buffer: &Arc) -> Arc>>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!(1)); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { let mut __let_tmp_rhs0: Arc>> = valueOrError0.Extract(); let mut raw: Sequence = __let_tmp_rhs0.data().clone(); let mut tail: Arc = __let_tmp_rhs0.tail().clone(); - let mut valueOrError1: Arc, Arc>> = ContentType::Get(raw.get(&int!(0))).MapFailure::>(&({ + let mut valueOrError1: Arc, Arc>> = ContentType::Get(raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(ReadProblems::Error { message: e.clone() @@ -95658,14 +95873,13 @@ pub mod Signature { pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm::ECDSA_P384; - pub use ::dafny_runtime::_System::nat; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyOutput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error; pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_dafny_externs::Signature::ECDSA; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use ::dafny_runtime::Sequence; pub use ::std::fmt::Debug; @@ -95680,7 +95894,7 @@ pub mod Signature { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(16,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(17,3) pub fn SignatureLength(signatureAlgorithm: &Arc) -> u16 { let mut _source0: Arc = signatureAlgorithm.clone(); if matches!((&_source0).as_ref(), ECDSA_P384{ .. }) { @@ -95689,16 +95903,16 @@ pub mod Signature { 71 } } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(22,3) - pub fn FieldSize(signatureAlgorithm: &Arc) -> nat { + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(23,3) + pub fn FieldSize(signatureAlgorithm: &Arc) -> u64 { let mut _source0: Arc = signatureAlgorithm.clone(); if matches!((&_source0).as_ref(), ECDSA_P384{ .. }) { - int!(49) + 49 } else { - int!(33) + 33 } } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(30,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(31,3) pub fn KeyGen(input: &Arc) -> Arc, Arc>> { let mut res = MaybePlacebo::, Arc>>>::new(); let mut valueOrError0: Arc, Arc>>; @@ -95709,7 +95923,7 @@ pub mod Signature { return res.read(); }; let mut sigKeyPair: Arc = valueOrError0.Extract(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(sigKeyPair.verificationKey().cardinality() == _default::FieldSize(input.signatureAlgorithm()), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(sigKeyPair.verificationKey().cardinality(), u64) == _default::FieldSize(input.signatureAlgorithm()), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Incorrect verification-key length from ExternKeyGen.") })); if valueOrError1.IsFailure() { @@ -95725,37 +95939,37 @@ pub mod Signature { })); return res.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(91,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(93,3) pub fn CreateExternKeyGenSuccess(output: &Arc) -> Arc, Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: output.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(95,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(97,3) pub fn CreateExternKeyGenFailure(error: &Arc) -> Arc, Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Failure { error: error.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(99,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(101,3) pub fn CreateSignSuccess(bytes: &Sequence) -> Arc, Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Success { value: bytes.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(103,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(105,3) pub fn CreateSignFailure(error: &Arc) -> Arc, Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Arc>::Failure { error: error.clone() }) } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(107,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(109,3) pub fn CreateVerifySuccess(b: bool) -> Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>::Success { value: b }) } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(111,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(113,3) pub fn CreateVerifyFailure(error: &Arc) -> Arc>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::>::Failure { error: error.clone() @@ -95763,7 +95977,7 @@ pub mod Signature { } } - /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(12,3) + /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(13,3) #[derive(PartialEq, Clone)] pub enum SignatureKeyPair { SignatureKeyPair { @@ -95911,51 +96125,44 @@ pub mod _Sorting_Compile { pub mod _StandardLibrary_Compile { pub use ::dafny_runtime::DafnyType; pub use ::dafny_runtime::Sequence; - pub use ::dafny_runtime::seq; + pub use ::dafny_runtime::MaybePlacebo; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; pub use ::dafny_runtime::DafnyTypeEq; + pub use ::dafny_runtime::seq; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; - pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; pub use ::std::marker::Sync; pub use ::std::marker::Send; pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::_System::nat; pub use ::dafny_runtime::integer_range; pub use ::dafny_runtime::Zero; pub use ::dafny_runtime::Object; - pub use ::dafny_runtime::MaybePlacebo; pub use ::std::mem::MaybeUninit; pub use ::dafny_runtime::array; pub use ::dafny_runtime::DafnyUsize; pub use ::dafny_runtime::rd; pub use ::dafny_runtime::Set; - pub use ::dafny_runtime::set; pub struct _default {} impl _default { - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(16,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(17,3) pub fn Join<_T: DafnyType>(ss: &Sequence>, joiner: &Sequence<_T>) -> Sequence<_T> { - let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>; - let mut _r0 = ss.clone(); - let mut _r1 = joiner.clone(); - 'TAIL_CALL_START: loop { - let ss = _r0; - let joiner = _r1; - if ss.cardinality() == int!(1) { - return _accumulator.concat(&ss.get(&int!(0))); - } else { - _accumulator = _accumulator.concat(&ss.get(&int!(0)).concat(&joiner)); - let mut _in0: Sequence> = ss.drop(&int!(1)); - let mut _in1: Sequence<_T> = joiner.clone(); - _r0 = _in0.clone(); - _r1 = _in1.clone(); - continue 'TAIL_CALL_START; - } - } - } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(22,3) + let mut s = MaybePlacebo::>::new(); + let mut size: u64 = truncate!(ss.cardinality(), u64); + let mut result: Sequence<_T> = ss.get(&int!((&(size - 1)).clone())); + let mut i: u64 = size - 1; + while 0 < i { + i = i - 1; + result = ss.get(&int!((&i).clone())).concat(joiner).concat(&result); + }; + s = MaybePlacebo::from(result.clone()); + return s.read(); + } + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(37,3) pub fn Split<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> Sequence> { let mut _accumulator: Sequence> = seq![] as Sequence>; let mut _r0 = s.clone(); @@ -95963,10 +96170,10 @@ pub mod _StandardLibrary_Compile { 'TAIL_CALL_START: loop { let s = _r0; let delim = _r1; - let mut i: Arc> = _default::FindIndexMatching::<_T>(&s, &delim, &int!(0)); + let mut i: Arc> = _default::FindIndexMatching::<_T>(&s, &delim, 0); if matches!((&i).as_ref(), Some{ .. }) { - _accumulator = _accumulator.concat(&seq![s.take(i.value())]); - let mut _in0: Sequence<_T> = s.drop(&(i.value().clone() + int!(1))); + _accumulator = _accumulator.concat(&seq![s.take(&int!(i.value().clone()))]); + let mut _in0: Sequence<_T> = s.drop(&int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(i.value().clone(), 1)).clone())); let mut _in1: _T = delim.clone(); _r0 = _in0.clone(); _r1 = _in1.clone(); @@ -95976,31 +96183,31 @@ pub mod _StandardLibrary_Compile { } } } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(35,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(50,3) pub fn SplitOnce<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> (Sequence<_T>, Sequence<_T>) { - let mut i: Arc> = _default::FindIndexMatching::<_T>(s, delim, &int!(0)); + let mut i: Arc> = _default::FindIndexMatching::<_T>(s, delim, 0); ( - s.take(i.value()), - s.drop(&(i.value().clone() + int!(1))) + s.take(&int!(i.value().clone())), + s.drop(&int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(i.value().clone(), 1)).clone())) ) } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(46,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(61,3) pub fn _SplitOnce_q<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> Arc, Sequence<_T>)>> { - let mut valueOrError0: Arc> = _default::FindIndexMatching::<_T>(s, delim, &int!(0)); + let mut valueOrError0: Arc> = _default::FindIndexMatching::<_T>(s, delim, 0); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::<(Sequence<_T>, Sequence<_T>)>() } else { - let mut i: nat = valueOrError0.Extract(); + let mut i: u64 = valueOrError0.Extract(); Arc::new(Option::<(Sequence<_T>, Sequence<_T>)>::Some { value: ( - s.take(&i), - s.drop(&(i.clone() + int!(1))) + s.take(&int!((&i).clone())), + s.drop(&int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(i, 1)).clone())) ) }) } } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(95,3) - pub fn FindIndexMatching<_T: DafnyTypeEq>(s: &Sequence<_T>, c: &_T, i: &nat) -> Arc> { + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(111,3) + pub fn FindIndexMatching<_T: DafnyTypeEq>(s: &Sequence<_T>, c: &_T, i: u64) -> Arc> { _default::FindIndex::<_T>(s, { let c: _T = c.clone(); &({ @@ -96011,63 +96218,49 @@ pub mod _StandardLibrary_Compile { }) }, i) } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(104,3) - pub fn FindIndex<_T: DafnyType>(s: &Sequence<_T>, f: &Arc bool + Sync + Send>, i: &nat) -> Arc> { + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(120,3) + pub fn FindIndex<_T: DafnyType>(s: &Sequence<_T>, f: &Arc bool + Sync + Send>, i: u64) -> Arc> { let mut _r0 = s.clone(); let mut _r1 = f.clone(); - let mut _r2 = i.clone(); + let mut _r2 = i; 'TAIL_CALL_START: loop { let s = _r0; let f = _r1; let i = _r2; - if i.clone() == s.cardinality() { - return Arc::new(Option::::None {}); + if i == truncate!(s.cardinality(), u64) { + return Arc::new(Option::::None {}); } else { - if (&f)(&s.get(&i)) { - return Arc::new(Option::::Some { - value: i.clone() + if (&f)(&s.get(&int!((&i).clone()))) { + return Arc::new(Option::::Some { + value: i }); } else { let mut _in0: Sequence<_T> = s.clone(); let mut _in1: Arc bool + Sync + Send> = f.clone(); - let mut _in2: DafnyInt = i.clone() + int!(1); + let mut _in2: u64 = i + 1; _r0 = _in0.clone(); _r1 = _in1.clone(); - _r2 = _in2.clone(); + _r2 = _in2; continue 'TAIL_CALL_START; } } } } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(115,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(132,3) pub fn Filter<_T: DafnyType>(s: &Sequence<_T>, f: &Arc bool + Sync + Send>) -> Sequence<_T> { - let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>; - let mut _r0 = s.clone(); - let mut _r1 = f.clone(); - 'TAIL_CALL_START: loop { - let s = _r0; - let f = _r1; - if s.cardinality() == int!(0) { - return _accumulator.concat(&(seq![] as Sequence<_T>)); - } else { - if (&f)(&s.get(&int!(0))) { - _accumulator = _accumulator.concat(&seq![s.get(&int!(0))]); - let mut _in0: Sequence<_T> = s.drop(&int!(1)); - let mut _in1: Arc bool + Sync + Send> = f.clone(); - _r0 = _in0.clone(); - _r1 = _in1.clone(); - continue 'TAIL_CALL_START; - } else { - let mut _in2: Sequence<_T> = s.drop(&int!(1)); - let mut _in3: Arc bool + Sync + Send> = f.clone(); - _r0 = _in2.clone(); - _r1 = _in3.clone(); - continue 'TAIL_CALL_START; - } + let mut res = MaybePlacebo::>::new(); + let mut result: Sequence<_T> = seq![] as Sequence<_T>; + let mut i: u64 = truncate!(s.cardinality(), u64); + while 0 < i { + i = i - 1; + if f(&s.get(&int!((&i).clone()))) { + result = seq![s.get(&int!((&i).clone()))].concat(&result); } - } + }; + res = MaybePlacebo::from(result.clone()); + return res.read(); } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(151,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(183,3) pub fn Min(a: &DafnyInt, b: &DafnyInt) -> DafnyInt { if a.clone() < b.clone() { a.clone() @@ -96075,7 +96268,7 @@ pub mod _StandardLibrary_Compile { b.clone() } } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(155,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(188,3) pub fn Fill<_T: DafnyType>(value: &_T, n: &nat) -> Sequence<_T> { { let _initializer = { @@ -96091,7 +96284,7 @@ pub mod _StandardLibrary_Compile { } } /// "Fresh" expressions require editing memory - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(162,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(195,3) pub fn SeqToArray<_T: DafnyType>(s: &Sequence<_T>) -> Object<[_T]> { let mut a = MaybePlacebo::>::new(); let mut _init0: Arc _T + Sync + Send> = { @@ -96113,7 +96306,7 @@ pub mod _StandardLibrary_Compile { a = MaybePlacebo::from(array::construct_object(_nw0.clone())); return a.read(); } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(191,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(226,3) pub fn LexicographicLessOrEqual<_T: DafnyTypeEq>(a: &Sequence<_T>, b: &Sequence<_T>, less: &Arc bool + Sync + Send>) -> bool { integer_range(int!(0), a.cardinality() + int!(1)).any(({ let mut a = a.clone(); @@ -96125,7 +96318,7 @@ pub mod _StandardLibrary_Compile { }) }).as_ref()) } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(195,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(230,3) pub fn LexicographicLessOrEqualAux<_T: DafnyTypeEq>(a: &Sequence<_T>, b: &Sequence<_T>, less: &Arc bool + Sync + Send>, lengthOfCommonPrefix: &nat) -> bool { lengthOfCommonPrefix.clone() <= b.cardinality() && integer_range(int!(0), lengthOfCommonPrefix.clone()).all(({ let mut lengthOfCommonPrefix = lengthOfCommonPrefix.clone(); @@ -96137,39 +96330,7 @@ pub mod _StandardLibrary_Compile { }) }).as_ref()) && (lengthOfCommonPrefix.clone() == a.cardinality() || lengthOfCommonPrefix.clone() < b.cardinality() && less(&a.get(lengthOfCommonPrefix), &b.get(lengthOfCommonPrefix))) } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(338,3) - pub fn SetToOrderedSequence<_T: DafnyTypeEq>(s: &Set>, less: &Arc bool + Sync + Send>) -> Sequence> { - let mut _accumulator: Sequence> = seq![] as Sequence>; - let mut _r0 = s.clone(); - let mut _r1 = less.clone(); - 'TAIL_CALL_START: loop { - let s = _r0; - let less = _r1; - if s.clone() == set!{} { - return _accumulator.concat(&(seq![] as Sequence>)); - } else { - return (&({ - let mut s = s.clone(); - let mut less = less.clone(); - Arc::new(move |__let_dummy_22: &DafnyInt| -> Sequence>{ - let mut a = MaybePlacebo::>::new(); - 'label_goto__ASSIGN_SUCH_THAT_0: loop { - for __assign_such_that_0 in (&s).iter().cloned() { - a = MaybePlacebo::from(__assign_such_that_0.clone()); - if s.contains(&a.read()) && _default::IsMinimum::<_T>(&a.read(), &s, &less) { - break 'label_goto__ASSIGN_SUCH_THAT_0; - } - } - panic!("Halt"); - break; - }; - seq![a.read()].concat(&_default::SetToOrderedSequence::<_T>(&s.subtract(&set!{a.read()}), &less)) - }) - }))(&int!(0)); - } - } - } - /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(373,3) + /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(409,3) pub fn IsMinimum<_T: DafnyTypeEq>(a: &Sequence<_T>, s: &Set>, less: &Arc bool + Sync + Send>) -> bool { s.contains(a) && s.iter().all(({ let mut a = a.clone(); @@ -96183,30 +96344,108 @@ pub mod _StandardLibrary_Compile { } } - /// ../mpl/StandardLibrary/src/Sequence.dfy(6,1) + /// ../mpl/StandardLibrary/src/MemoryMath.dfy(12,1) + pub mod _MemoryMath_Compile { + pub struct _default {} + + impl _default { + /// ../mpl/StandardLibrary/src/MemoryMath.dfy(60,3) + pub fn Add(x: u64, y: u64) -> u64 { + x + y + } + /// ../mpl/StandardLibrary/src/MemoryMath.dfy(67,3) + pub fn Add3(x: u64, y: u64, z: u64) -> u64 { + x + y + z + } + /// ../mpl/StandardLibrary/src/MemoryMath.dfy(74,3) + pub fn Add4(w: u64, x: u64, y: u64, z: u64) -> u64 { + w + x + y + z + } + } + } + + /// ../mpl/StandardLibrary/src/Sequence.dfy(7,1) pub mod _Sequence_Compile { - pub use ::dafny_runtime::DafnyTypeEq; + pub use ::dafny_runtime::DafnyType; + pub use ::std::sync::Arc; + pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; + pub use ::std::marker::Sync; + pub use ::std::marker::Send; pub use ::dafny_runtime::Sequence; - pub use ::dafny_runtime::_System::nat; pub use ::dafny_runtime::truncate; + pub use ::dafny_runtime::int; + pub use ::dafny_runtime::seq; + pub use ::dafny_runtime::DafnyTypeEq; + pub use ::dafny_runtime::_System::nat; pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64; pub use ::std::default::Default; pub use ::dafny_runtime::integer_range; pub use ::std::convert::Into; - pub use ::dafny_runtime::int; pub struct _default {} impl _default { - /// ../mpl/StandardLibrary/src/Sequence.dfy(10,3) - pub fn SequenceEqualNat<_T: DafnyTypeEq>(seq1: &Sequence<_T>, seq2: &Sequence<_T>, start1: &nat, start2: &nat, size: &nat) -> bool { - if crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT64_MAX_LIMIT() < seq1.cardinality() || crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT64_MAX_LIMIT() < seq2.cardinality() { - seq1.slice(start1, &(start1.clone() + size.clone())) == seq2.slice(start2, &(start2.clone() + size.clone())) - } else { - crate::implementation_from_dafny::_StandardLibrary_Compile::_Sequence_Compile::_default::SequenceEqual::<_T>(seq1, seq2, truncate!(start1.clone(), u64), truncate!(start2.clone(), u64), truncate!(size.clone(), u64)) + /// ../mpl/StandardLibrary/src/Sequence.dfy(14,3) + pub fn MapWithResult<_T: DafnyType, _R: DafnyType, _E: DafnyType>(f: &Arc Arc> + Sync + Send>, xs: &Sequence<_T>, pos: u64, acc: &Sequence<_R>) -> Arc, _E>> { + let mut _r0 = f.clone(); + let mut _r1 = xs.clone(); + let mut _r2 = pos; + let mut _r3 = acc.clone(); + 'TAIL_CALL_START: loop { + let f = _r0; + let xs = _r1; + let pos = _r2; + let acc = _r3; + if truncate!(xs.cardinality(), u64) == pos { + return Arc::new(Result::, _E>::Success { + value: acc.clone() + }); + } else { + let mut valueOrError0: Arc> = (&f)(&xs.get(&int!((&pos).clone()))); + if valueOrError0.IsFailure() { + return valueOrError0.PropagateFailure::>(); + } else { + let mut head: _R = valueOrError0.Extract(); + let mut _in0: Arc Arc> + Sync + Send> = f.clone(); + let mut _in1: Sequence<_T> = xs.clone(); + let mut _in2: u64 = pos + truncate!(int!(1), u64); + let mut _in3: Sequence<_R> = acc.concat(&seq![head.clone()]); + _r0 = _in0.clone(); + _r1 = _in1.clone(); + _r2 = _in2; + _r3 = _in3.clone(); + continue 'TAIL_CALL_START; + } + } } } - /// ../mpl/StandardLibrary/src/Sequence.dfy(22,3) + /// ../mpl/StandardLibrary/src/Sequence.dfy(42,3) + pub fn Flatten<_T: DafnyType>(xs: &Sequence>, pos: u64, acc: &Sequence<_T>) -> Sequence<_T> { + let mut _r0 = xs.clone(); + let mut _r1 = pos; + let mut _r2 = acc.clone(); + 'TAIL_CALL_START: loop { + let xs = _r0; + let pos = _r1; + let acc = _r2; + if truncate!(xs.cardinality(), u64) == pos { + return acc.clone(); + } else { + let mut _in0: Sequence> = xs.clone(); + let mut _in1: u64 = pos + truncate!(int!(1), u64); + let mut _in2: Sequence<_T> = acc.concat(&xs.get(&int!((&pos).clone()))); + _r0 = _in0.clone(); + _r1 = _in1; + _r2 = _in2.clone(); + continue 'TAIL_CALL_START; + } + } + } + /// ../mpl/StandardLibrary/src/Sequence.dfy(53,3) + pub fn SequenceEqualNat<_T: DafnyTypeEq>(seq1: &Sequence<_T>, seq2: &Sequence<_T>, start1: &nat, start2: &nat, size: &nat) -> bool { + crate::implementation_from_dafny::_StandardLibrary_Compile::_Sequence_Compile::_default::SequenceEqual::<_T>(seq1, seq2, truncate!(start1.clone(), u64), truncate!(start2.clone(), u64), truncate!(size.clone(), u64)) + } + /// ../mpl/StandardLibrary/src/Sequence.dfy(63,3) pub fn SequenceEqual<_T: DafnyTypeEq>(seq1: &seq64<_T>, seq2: &seq64<_T>, start1: u64, start2: u64, size: u64) -> bool { let mut ret: bool = ::default(); let mut j: u64 = start2; @@ -96337,6 +96576,7 @@ pub mod _StandardLibrary_Compile { pub mod _UInt_Compile { pub use ::dafny_runtime::DafnyType; pub use ::dafny_runtime::Sequence; + pub use ::dafny_runtime::_System::nat; pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::int; pub use ::dafny_runtime::seq; @@ -96362,17 +96602,53 @@ pub mod _StandardLibrary_Compile { s.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT64_LIMIT() } /// ../mpl/StandardLibrary/src/UInt.dfy(44,3) + pub fn HasUint16Size(s: &nat) -> bool { + s.clone() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT() + } + /// ../mpl/StandardLibrary/src/UInt.dfy(47,3) + pub fn HasUint32Size(s: &nat) -> bool { + s.clone() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT() + } + /// ../mpl/StandardLibrary/src/UInt.dfy(50,3) + pub fn HasUint64Size(s: &nat) -> bool { + s.clone() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT64_LIMIT() + } + /// ../mpl/StandardLibrary/src/UInt.dfy(54,3) pub fn UInt16ToSeq(x: u16) -> Sequence { let mut b0: u8 = (x / truncate!(int!(256), u16)) as u8; let mut b1: u8 = (x % truncate!(int!(256), u16)) as u8; seq![b0, b1] } - /// ../mpl/StandardLibrary/src/UInt.dfy(53,3) + /// ../mpl/StandardLibrary/src/UInt.dfy(63,3) pub fn SeqToUInt16(s: &Sequence) -> u16 { - let mut x0: u16 = s.get(&int!(0)) as u16 * truncate!(int!(256), u16); - x0 + s.get(&int!(1)) as u16 + let mut x0: u16 = s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u16 * truncate!(int!(256), u16); + x0 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u16 + } + /// ../mpl/StandardLibrary/src/UInt.dfy(72,3) + pub fn SeqPosToUInt16(s: &Sequence, pos: u64) -> u16 { + let mut x0: u16 = s.get(&int!((&pos).clone())) as u16 * truncate!(int!(256), u16); + x0 + s.get(&int!((&(pos + truncate!(int!(1), u64))).clone())) as u16 + } + /// ../mpl/StandardLibrary/src/UInt.dfy(82,3) + pub fn SeqPosToUInt32(s: &Sequence, pos: u64) -> u32 { + let mut x0: u32 = s.get(&int!((&pos).clone())) as u32 * truncate!(int!(b"16777216"), u32); + let mut x1: u32 = x0 + s.get(&int!((&(pos + truncate!(int!(1), u64))).clone())) as u32 * truncate!(int!(b"65536"), u32); + let mut x2: u32 = x1 + s.get(&int!((&(pos + truncate!(int!(2), u64))).clone())) as u32 * truncate!(int!(256), u32); + x2 + s.get(&int!((&(pos + truncate!(int!(3), u64))).clone())) as u32 + } + /// ../mpl/StandardLibrary/src/UInt.dfy(93,3) + pub fn SeqPosToUInt64(s: &Sequence, pos: u64) -> u64 { + let mut x0: u64 = s.get(&int!((&pos).clone())) as u64 * truncate!(int!(b"72057594037927936"), u64); + let mut x1: u64 = x0 + s.get(&int!((&(pos + truncate!(int!(1), u64))).clone())) as u64 * truncate!(int!(b"281474976710656"), u64); + let mut x2: u64 = x1 + s.get(&int!((&(pos + truncate!(int!(2), u64))).clone())) as u64 * truncate!(int!(b"1099511627776"), u64); + let mut x3: u64 = x2 + s.get(&int!((&(pos + truncate!(int!(3), u64))).clone())) as u64 * truncate!(int!(b"4294967296"), u64); + let mut x4: u64 = x3 + s.get(&int!((&(pos + truncate!(int!(4), u64))).clone())) as u64 * truncate!(int!(b"16777216"), u64); + let mut x5: u64 = x4 + s.get(&int!((&(pos + truncate!(int!(5), u64))).clone())) as u64 * truncate!(int!(b"65536"), u64); + let mut x6: u64 = x5 + s.get(&int!((&(pos + truncate!(int!(6), u64))).clone())) as u64 * truncate!(int!(256), u64); + let mut x: u64 = x6 + s.get(&int!((&(pos + truncate!(int!(7), u64))).clone())) as u64; + x } - /// ../mpl/StandardLibrary/src/UInt.dfy(71,3) + /// ../mpl/StandardLibrary/src/UInt.dfy(140,3) pub fn UInt32ToSeq(x: u32) -> Sequence { let mut b0: u8 = (x / truncate!(int!(b"16777216"), u32)) as u8; let mut x0: u32 = x - b0 as u32 * truncate!(int!(b"16777216"), u32); @@ -96382,14 +96658,14 @@ pub mod _StandardLibrary_Compile { let mut b3: u8 = (x1 % truncate!(int!(256), u32)) as u8; seq![b0, b1, b2, b3] } - /// ../mpl/StandardLibrary/src/UInt.dfy(86,3) + /// ../mpl/StandardLibrary/src/UInt.dfy(155,3) pub fn SeqToUInt32(s: &Sequence) -> u32 { - let mut x0: u32 = s.get(&int!(0)) as u32 * truncate!(int!(b"16777216"), u32); - let mut x1: u32 = x0 + s.get(&int!(1)) as u32 * truncate!(int!(b"65536"), u32); - let mut x2: u32 = x1 + s.get(&int!(2)) as u32 * truncate!(int!(256), u32); - x2 + s.get(&int!(3)) as u32 + let mut x0: u32 = s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u32 * truncate!(int!(b"16777216"), u32); + let mut x1: u32 = x0 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u32 * truncate!(int!(b"65536"), u32); + let mut x2: u32 = x1 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u32 * truncate!(int!(256), u32); + x2 + s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) as u32 } - /// ../mpl/StandardLibrary/src/UInt.dfy(105,3) + /// ../mpl/StandardLibrary/src/UInt.dfy(174,3) pub fn UInt64ToSeq(x: u64) -> Sequence { let mut b0: u8 = (x / truncate!(int!(b"72057594037927936"), u64)) as u8; let mut x0: u64 = x - b0 as u64 * truncate!(int!(b"72057594037927936"), u64); @@ -96407,16 +96683,16 @@ pub mod _StandardLibrary_Compile { let mut b7: u8 = (x5 % truncate!(int!(256), u64)) as u8; seq![b0, b1, b2, b3, b4, b5, b6, b7] } - /// ../mpl/StandardLibrary/src/UInt.dfy(134,3) + /// ../mpl/StandardLibrary/src/UInt.dfy(203,3) pub fn SeqToUInt64(s: &Sequence) -> u64 { - let mut x0: u64 = s.get(&int!(0)) as u64 * truncate!(int!(b"72057594037927936"), u64); - let mut x1: u64 = x0 + s.get(&int!(1)) as u64 * truncate!(int!(b"281474976710656"), u64); - let mut x2: u64 = x1 + s.get(&int!(2)) as u64 * truncate!(int!(b"1099511627776"), u64); - let mut x3: u64 = x2 + s.get(&int!(3)) as u64 * truncate!(int!(b"4294967296"), u64); - let mut x4: u64 = x3 + s.get(&int!(4)) as u64 * truncate!(int!(b"16777216"), u64); - let mut x5: u64 = x4 + s.get(&int!(5)) as u64 * truncate!(int!(b"65536"), u64); - let mut x6: u64 = x5 + s.get(&int!(6)) as u64 * truncate!(int!(256), u64); - let mut x: u64 = x6 + s.get(&int!(7)) as u64; + let mut x0: u64 = s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u64 * truncate!(int!(b"72057594037927936"), u64); + let mut x1: u64 = x0 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u64 * truncate!(int!(b"281474976710656"), u64); + let mut x2: u64 = x1 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u64 * truncate!(int!(b"1099511627776"), u64); + let mut x3: u64 = x2 + s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) as u64 * truncate!(int!(b"4294967296"), u64); + let mut x4: u64 = x3 + s.get(&int!((&truncate!((&int!(4)).clone(), u32)).clone())) as u64 * truncate!(int!(b"16777216"), u64); + let mut x5: u64 = x4 + s.get(&int!((&truncate!((&int!(5)).clone(), u32)).clone())) as u64 * truncate!(int!(b"65536"), u64); + let mut x6: u64 = x5 + s.get(&int!((&truncate!((&int!(6)).clone(), u32)).clone())) as u64 * truncate!(int!(256), u64); + let mut x: u64 = x6 + s.get(&int!((&truncate!((&int!(7)).clone(), u32)).clone())) as u64; x } /// ../mpl/StandardLibrary/src/UInt.dfy(14,3) @@ -96538,8 +96814,8 @@ pub mod _StormTracker_Compile { pub use ::dafny_runtime::MaybePlacebo; pub use ::dafny_runtime::modify_field; pub use ::dafny_runtime::Set; - pub use ::dafny_runtime::DafnyInt; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput; pub use ::dafny_runtime::euclidian_division; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; @@ -96737,7 +97013,7 @@ pub mod _StormTracker_Compile { inFlightTTL = cache.inFlightTTL().clone() as i64; }; let mut _nw0: Object = LocalCMC::_allocate_object(); - LocalCMC::_ctor(&_nw0, &int!(cache.entryCapacity().clone()), &int!((&cache.entryPruningTailSize().UnwrapOr(&truncate!((&int!(1)).clone(), i32))).clone())); + LocalCMC::_ctor(&_nw0, cache.entryCapacity().clone() as u64, cache.entryPruningTailSize().UnwrapOr(&truncate!((&int!(1)).clone(), i32)) as u64); update_field_mut_uninit_object!(this.clone(), wrapped, _set_wrapped, _nw0.clone()); let mut _nw1: Object, PositiveLong>> = MutableMap::, PositiveLong>::_allocate_object(); update_field_mut_uninit_object!(this.clone(), inFlight, _set_inFlight, _nw1.clone()); @@ -96815,11 +97091,11 @@ pub mod _StormTracker_Compile { let mut keys: Sequence>; let mut _out0: Sequence> = crate::implementation_from_dafny::SortedSets::_default::SetToSequence::>(&keySet); keys = _out0.clone(); - let mut _hi0: DafnyInt = keys.cardinality(); - for i in integer_range(int!(0), _hi0.clone()) { - let mut v: PositiveLong = MutableMapTrait::, PositiveLong>::Select(rd!(read_field!(self.inFlight)), &keys.get(&i)); + let mut _hi0: u64 = truncate!(keys.cardinality(), u64); + for i in integer_range(0, _hi0).map(Into::::into) { + let mut v: PositiveLong = MutableMapTrait::, PositiveLong>::Select(rd!(read_field!(self.inFlight)), &keys.get(&int!((&i).clone()))); if now >= self.AddLong(v, read_field!(self.inFlightTTL)) { - MutableMapTrait::, PositiveLong>::Remove(rd!(read_field!(self.inFlight)), &keys.get(&i)) + MutableMapTrait::, PositiveLong>::Remove(rd!(read_field!(self.inFlight)), &keys.get(&int!((&i).clone()))) } } return (); @@ -96946,7 +97222,7 @@ pub mod _StormTracker_Compile { UpcastObjectFn!(DynAny); } } -/// ../mpl/StandardLibrary/src/Streams.dfy(6,1) +/// ../mpl/StandardLibrary/src/Streams.dfy(7,1) pub mod _Streams_Compile { pub use ::dafny_runtime::DafnyType; pub use ::dafny_runtime::Object; @@ -96955,25 +97231,24 @@ pub mod _Streams_Compile { pub use ::dafny_runtime::update_field_uninit_object; pub use ::dafny_runtime::update_field_mut_uninit_object; pub use ::dafny_runtime::int; - pub use ::dafny_runtime::_System::nat; pub use ::dafny_runtime::read_field; pub use ::dafny_runtime::modify_field; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; pub use ::dafny_runtime::DafnyCharUTF16; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use ::dafny_runtime::UpcastObject; pub use ::dafny_runtime::DynAny; pub use ::dafny_runtime::UpcastObjectFn; pub use ::dafny_runtime::MaybePlacebo; pub use ::dafny_runtime::rd; - pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default; pub use ::std::default::Default; pub use ::dafny_runtime::seq; - /// ../mpl/StandardLibrary/src/Streams.dfy(10,3) + /// ../mpl/StandardLibrary/src/Streams.dfy(12,3) pub struct SeqReader { - pub pos: ::dafny_runtime::Field, + pub pos: ::dafny_runtime::Field, pub __i_data: Sequence } @@ -96982,25 +97257,25 @@ pub mod _Streams_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/StandardLibrary/src/Streams.dfy(23,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(26,5) pub fn _ctor(this: &Object>, s: &Sequence) -> () { let mut _set_pos: bool = false; let mut _set___i_data: bool = false; update_field_uninit_object!(this.clone(), __i_data, _set___i_data, s.clone()); - update_field_mut_uninit_object!(this.clone(), pos, _set_pos, int!(0)); + update_field_mut_uninit_object!(this.clone(), pos, _set_pos, 0); return (); } - /// ../mpl/StandardLibrary/src/Streams.dfy(33,5) - pub fn ReadElements(&self, n: &nat) -> Sequence { - let mut elems: Sequence = self.data().clone().drop(&read_field!(self.pos)).take(n); - modify_field!(self.pos, read_field!(self.pos) + n.clone()); + /// ../mpl/StandardLibrary/src/Streams.dfy(36,5) + pub fn ReadElements(&self, n: u64) -> Sequence { + let mut elems: Sequence = self.data().clone().drop(&int!((&read_field!(self.pos)).clone())).take(&int!((&n).clone())); + modify_field!(self.pos, crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(read_field!(self.pos), n)); elems = elems.clone(); return elems.clone(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(47,5) - pub fn ReadExact(&self, n: &nat) -> Arc, Sequence>> { + /// ../mpl/StandardLibrary/src/Streams.dfy(50,5) + pub fn ReadExact(&self, n: u64) -> Arc, Sequence>> { let mut res: Arc, Sequence>>; - if self.data().clone().cardinality() - read_field!(self.pos) < n.clone() { + if truncate!(self.data().clone().cardinality(), u64) - read_field!(self.pos) < n { res = Arc::new(Result::, Sequence>::Failure { error: string_utf16_of("IO Error: Not enough elements left on stream.") }); @@ -97016,7 +97291,7 @@ pub mod _Streams_Compile { }; return res.clone(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(12,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(14,5) pub fn data(&self) -> Sequence { self.__i_data.clone() } @@ -97027,7 +97302,7 @@ pub mod _Streams_Compile { UpcastObjectFn!(DynAny); } - /// ../mpl/StandardLibrary/src/Streams.dfy(67,3) + /// ../mpl/StandardLibrary/src/Streams.dfy(71,3) pub struct ByteReader { pub __i_reader: Object> } @@ -97037,7 +97312,7 @@ pub mod _Streams_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/StandardLibrary/src/Streams.dfy(79,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(83,5) pub fn _ctor(this: &Object, s: &Sequence) -> () { let mut _set___i_reader: bool = false; let mut mr: Object>; @@ -97047,11 +97322,11 @@ pub mod _Streams_Compile { update_field_uninit_object!(this.clone(), __i_reader, _set___i_reader, mr.clone()); return (); } - /// ../mpl/StandardLibrary/src/Streams.dfy(89,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(93,5) pub fn ReadByte(&self) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut valueOrError0: Arc, Sequence>>; - let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(&int!(1)); + let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(1); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); @@ -97063,8 +97338,8 @@ pub mod _Streams_Compile { })); return res.read(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(104,5) - pub fn ReadBytes(&self, n: &nat) -> Arc, Sequence>> { + /// ../mpl/StandardLibrary/src/Streams.dfy(108,5) + pub fn ReadBytes(&self, n: u64) -> Arc, Sequence>> { let mut res = MaybePlacebo::, Sequence>>>::new(); let mut valueOrError0: Arc, Sequence>>; let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(n); @@ -97079,69 +97354,70 @@ pub mod _Streams_Compile { })); return res.read(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(121,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(126,5) pub fn ReadUInt16(&self) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut valueOrError0: Arc, Sequence>>; - let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(&int!(2)); + let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(2); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); }; let mut bytes: Sequence = valueOrError0.Extract(); - let mut n: u16 = _default::SeqToUInt16(&bytes); + let mut n: u16 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt16(&bytes); res = MaybePlacebo::from(Arc::new(Result::>::Success { value: n })); return res.read(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(137,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(142,5) pub fn ReadUInt32(&self) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut valueOrError0: Arc, Sequence>>; - let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(&int!(4)); + let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(4); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); }; let mut bytes: Sequence = valueOrError0.Extract(); - let mut n: u32 = _default::SeqToUInt32(&bytes); + let mut n: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&bytes); res = MaybePlacebo::from(Arc::new(Result::>::Success { value: n })); return res.read(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(153,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(158,5) pub fn ReadUInt64(&self) -> Arc>> { let mut res = MaybePlacebo::>>>::new(); let mut valueOrError0: Arc, Sequence>>; - let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(&int!(8)); + let mut _out0: Arc, Sequence>> = rd!(self.reader().clone()).ReadExact(8); valueOrError0 = _out0.clone(); if valueOrError0.IsFailure() { res = MaybePlacebo::from(valueOrError0.PropagateFailure::()); return res.read(); }; let mut bytes: Sequence = valueOrError0.Extract(); - let mut n: u64 = _default::SeqToUInt64(&bytes); + let mut n: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt64(&bytes); res = MaybePlacebo::from(Arc::new(Result::>::Success { value: n })); return res.read(); } - /// ../mpl/StandardLibrary/src/Streams.dfy(169,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(174,5) pub fn IsDoneReading(&self) -> bool { let mut b: bool = ::default(); - b = rd!(self.reader().clone().clone()).data().clone().cardinality() == read_field!(rd!(self.reader().clone().clone()).pos); + b = truncate!(rd!(self.reader().clone().clone()).data().clone().cardinality(), u64) == read_field!(rd!(self.reader().clone().clone()).pos); return b; } - /// ../mpl/StandardLibrary/src/Streams.dfy(177,5) - pub fn GetSizeRead(&self) -> nat { - let mut n: nat = read_field!(rd!(self.reader().clone().clone()).pos); - return n.clone(); + /// ../mpl/StandardLibrary/src/Streams.dfy(183,5) + pub fn GetSizeRead(&self) -> u64 { + let mut n: u64 = ::default(); + n = read_field!(rd!(self.reader().clone().clone()).pos); + return n; } - /// ../mpl/StandardLibrary/src/Streams.dfy(69,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(73,5) pub fn reader(&self) -> Object> { self.__i_reader.clone() } @@ -97152,7 +97428,7 @@ pub mod _Streams_Compile { UpcastObjectFn!(DynAny); } - /// ../mpl/StandardLibrary/src/Streams.dfy(186,3) + /// ../mpl/StandardLibrary/src/Streams.dfy(192,3) pub struct SeqWriter { pub data: ::dafny_runtime::Field> } @@ -97162,18 +97438,18 @@ pub mod _Streams_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/StandardLibrary/src/Streams.dfy(197,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(203,5) pub fn _ctor(this: &Object>) -> () { let mut _set_data: bool = false; update_field_mut_uninit_object!(this.clone(), data, _set_data, seq![] as Sequence); return (); } - /// ../mpl/StandardLibrary/src/Streams.dfy(205,5) - pub fn WriteElements(&self, elems: &Sequence) -> nat { - let mut n = MaybePlacebo::::new(); + /// ../mpl/StandardLibrary/src/Streams.dfy(211,5) + pub fn WriteElements(&self, elems: &Sequence) -> u64 { + let mut n: u64 = ::default(); modify_field!(self.data, read_field!(self.data).concat(elems)); - n = MaybePlacebo::from(elems.cardinality()); - return n.read(); + n = truncate!(elems.cardinality(), u64); + return n; } } @@ -97182,7 +97458,7 @@ pub mod _Streams_Compile { UpcastObjectFn!(DynAny); } - /// ../mpl/StandardLibrary/src/Streams.dfy(219,3) + /// ../mpl/StandardLibrary/src/Streams.dfy(226,3) pub struct ByteWriter { pub __i_writer: Object> } @@ -97192,7 +97468,7 @@ pub mod _Streams_Compile { pub fn _allocate_object() -> Object { allocate_object::() } - /// ../mpl/StandardLibrary/src/Streams.dfy(231,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(238,5) pub fn _ctor(this: &Object) -> () { let mut _set___i_writer: bool = false; let mut mw: Object>; @@ -97202,43 +97478,43 @@ pub mod _Streams_Compile { update_field_uninit_object!(this.clone(), __i_writer, _set___i_writer, mw.clone()); return (); } - /// ../mpl/StandardLibrary/src/Streams.dfy(240,5) - pub fn WriteByte(&self, n: u8) -> nat { - let mut r: nat; - let mut _out0: nat = rd!(self.writer().clone()).WriteElements(&seq![n]); - r = _out0.clone(); - return r.clone(); - } - /// ../mpl/StandardLibrary/src/Streams.dfy(250,5) - pub fn WriteBytes(&self, s: &Sequence) -> nat { - let mut r: nat; - let mut _out0: nat = rd!(self.writer().clone()).WriteElements(s); - r = _out0.clone(); - return r.clone(); - } - /// ../mpl/StandardLibrary/src/Streams.dfy(260,5) - pub fn WriteUInt16(&self, n: u16) -> nat { - let mut r: nat; - let mut _out0: nat = rd!(self.writer().clone()).WriteElements(&_default::UInt16ToSeq(n)); - r = _out0.clone(); - return r.clone(); - } - /// ../mpl/StandardLibrary/src/Streams.dfy(270,5) - pub fn WriteUInt32(&self, n: u32) -> nat { - let mut r: nat; - let mut _out0: nat = rd!(self.writer().clone()).WriteElements(&_default::UInt32ToSeq(n)); - r = _out0.clone(); - return r.clone(); - } - /// ../mpl/StandardLibrary/src/Streams.dfy(280,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(247,5) + pub fn WriteByte(&self, n: u8) -> u64 { + let mut r: u64 = ::default(); + let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(&seq![n]); + r = _out0; + return r; + } + /// ../mpl/StandardLibrary/src/Streams.dfy(257,5) + pub fn WriteBytes(&self, s: &Sequence) -> u64 { + let mut r: u64 = ::default(); + let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(s); + r = _out0; + return r; + } + /// ../mpl/StandardLibrary/src/Streams.dfy(267,5) + pub fn WriteUInt16(&self, n: u16) -> u64 { + let mut r: u64 = ::default(); + let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(n)); + r = _out0; + return r; + } + /// ../mpl/StandardLibrary/src/Streams.dfy(277,5) + pub fn WriteUInt32(&self, n: u32) -> u64 { + let mut r: u64 = ::default(); + let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(n)); + r = _out0; + return r; + } + /// ../mpl/StandardLibrary/src/Streams.dfy(287,5) pub fn GetDataWritten(&self) -> Sequence { read_field!(rd!(self.writer().clone().clone()).data) } - /// ../mpl/StandardLibrary/src/Streams.dfy(289,5) - pub fn GetSizeWritten(&self) -> nat { - read_field!(rd!(self.writer().clone().clone()).data).cardinality() + /// ../mpl/StandardLibrary/src/Streams.dfy(296,5) + pub fn GetSizeWritten(&self) -> u64 { + truncate!(read_field!(rd!(self.writer().clone().clone()).data).cardinality(), u64) } - /// ../mpl/StandardLibrary/src/Streams.dfy(221,5) + /// ../mpl/StandardLibrary/src/Streams.dfy(228,5) pub fn writer(&self) -> Object> { self.__i_writer.clone() } @@ -97272,8 +97548,9 @@ pub mod _StrictMultiKeyring_Compile { pub use ::dafny_runtime::rd; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput; pub use ::dafny_runtime::string_utf16_of; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::integer_range; + pub use ::std::convert::Into; pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; @@ -97284,7 +97561,7 @@ pub mod _StrictMultiKeyring_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/StrictMultiKeyring.dfy(23,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/StrictMultiKeyring.dfy(25,3) pub fn StrictMultiKeyring(generator: &Arc>>, awsKmsKeys: &Arc>>>, clientSupplier: &Object, grantTokens: &Arc>) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); let mut allStrings: Sequence>; @@ -97341,9 +97618,9 @@ pub mod _StrictMultiKeyring_Compile { } else { let mut ___mcc_h2: Sequence> = _source2.value().clone(); let mut childIdentifiers: Sequence> = ___mcc_h2.clone(); - let mut _hi0: DafnyInt = childIdentifiers.cardinality(); - for index in integer_range(int!(0), _hi0.clone()) { - let mut childIdentifier: Sequence = childIdentifiers.get(&index); + let mut _hi0: u64 = truncate!(childIdentifiers.cardinality(), u64); + for index in integer_range(0, _hi0).map(Into::::into) { + let mut childIdentifier: Sequence = childIdentifiers.get(&int!((&index).clone())); let mut valueOrError3: Arc, Arc>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(&childIdentifier).MapFailure::>(&(Arc::new(move |x0: &Sequence| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc _ + Sync + Send>)); if valueOrError3.IsFailure() { output = MaybePlacebo::from(valueOrError3.PropagateFailure::>()); @@ -97368,7 +97645,7 @@ pub mod _StrictMultiKeyring_Compile { children = children.concat(&seq![keyring.clone()]); } }; - let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&generatorKeyring).as_ref(), Some{ .. }) || int!(0) < children.cardinality(), &Arc::new(Error::AwsCryptographicMaterialProvidersException { + let mut valueOrError5: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(matches!((&generatorKeyring).as_ref(), Some{ .. }) || 0 < truncate!(children.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException { message: string_utf16_of("generatorKeyring or child Keryings needed to create a multi keyring") })); if valueOrError5.IsFailure() { @@ -97391,7 +97668,7 @@ pub mod _Structure_Compile { pub use ::dafny_runtime::Map; pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::DafnyCharUTF16; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::std::sync::Arc; pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue; pub use ::dafny_runtime::MapBuilder; @@ -97399,6 +97676,7 @@ pub mod _Structure_Compile { pub use crate::implementation_from_dafny::_Wrappers_Compile::Result; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BeaconKeyMaterials; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; @@ -97415,9 +97693,9 @@ pub mod _Structure_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(38,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(39,3) pub fn _BranchKeyContext_q(m: &Map, Sequence>) -> bool { - m.contains(&_default::BRANCH_KEY_IDENTIFIER_FIELD()) && m.contains(&_default::TYPE_FIELD()) && m.contains(&_default::KEY_CREATE_TIME()) && m.contains(&_default::HIERARCHY_VERSION()) && m.contains(&_default::TABLE_FIELD()) && m.contains(&_default::KMS_FIELD()) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(&m.get(&_default::KMS_FIELD())) && !m.keys().contains(&_default::BRANCH_KEY_FIELD()) && int!(0) < m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()).cardinality() && int!(0) < m.get(&_default::TYPE_FIELD()).cardinality() && (&m.keys()).iter().all(({ + m.contains(&_default::BRANCH_KEY_IDENTIFIER_FIELD()) && m.contains(&_default::TYPE_FIELD()) && m.contains(&_default::KEY_CREATE_TIME()) && m.contains(&_default::HIERARCHY_VERSION()) && m.contains(&_default::TABLE_FIELD()) && m.contains(&_default::KMS_FIELD()) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(&m.get(&_default::KMS_FIELD())) && !m.keys().contains(&_default::BRANCH_KEY_FIELD()) && 0 < truncate!(m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()).cardinality(), u64) && 0 < truncate!(m.get(&_default::TYPE_FIELD()).cardinality(), u64) && (&m.keys()).iter().all(({ let mut m = m.clone(); Arc::new(move |__forall_var_0: &Sequence| -> bool{ let mut k: Sequence = __forall_var_0.clone(); @@ -97425,7 +97703,7 @@ pub mod _Structure_Compile { }) }).as_ref()) && m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (true && m.get(&_default::TYPE_FIELD()) == _default::BRANCH_KEY_ACTIVE_TYPE()) && (!m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) || true && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD())) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (m.get(&_default::TYPE_FIELD()) == _default::BEACON_KEY_TYPE_VALUE() || _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::TYPE_FIELD())) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(115,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(116,3) pub fn ToAttributeMap(encryptionContext: &BranchKeyContext, encryptedKey: &Sequence) -> Map, Arc> { (&({ let mut encryptedKey = encryptedKey.clone(); @@ -97463,7 +97741,7 @@ pub mod _Structure_Compile { }) }))() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(140,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(141,3) pub fn ToBranchKeyContext(item: &Map, Arc>, logicalKeyStoreName: &Sequence) -> BranchKeyContext { (&({ let mut logicalKeyStoreName = logicalKeyStoreName.clone(); @@ -97491,14 +97769,14 @@ pub mod _Structure_Compile { /// = aws-encryption-sdk-specification/framework/branch-key-store.md#branch-key-materials-from-authenticated-encryption-context /// = type=implication /// # The `type` attribute MUST either be equal to `"branch:ACTIVE"` or start with `"branch:version:"`. - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(161,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(162,3) pub fn ToBranchKeyMaterials(encryptionContext: &BranchKeyContext, plaintextKey: &Sequence) -> Arc, Arc>> { let mut versionInformation: Sequence = if encryptionContext.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) { encryptionContext.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) } else { encryptionContext.get(&_default::TYPE_FIELD()) }; - let mut branchKeyVersion: Sequence = versionInformation.drop(&_default::BRANCH_KEY_TYPE_PREFIX().cardinality()); + let mut branchKeyVersion: Sequence = versionInformation.drop(&int!((&truncate!((&_default::BRANCH_KEY_TYPE_PREFIX().cardinality()).clone(), u32)).clone())); let mut valueOrError0: Arc>> = crate::implementation_from_dafny::UTF8::_default::Encode(&branchKeyVersion).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(Error::KeyStoreException { @@ -97526,7 +97804,7 @@ pub mod _Structure_Compile { } } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(241,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(242,3) pub fn ToBeaconKeyMaterials(encryptionContext: &BranchKeyContext, plaintextKey: &Sequence) -> Arc, Arc>> { let mut valueOrError0: Arc, Arc>> = _default::ExtractCustomEncryptionContext(encryptionContext); if valueOrError0.IsFailure() { @@ -97545,7 +97823,7 @@ pub mod _Structure_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(257,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(258,3) pub fn ExtractCustomEncryptionContext(encryptionContext: &BranchKeyContext) -> Arc, Arc>> { let mut encodedEncryptionContext: Set<(Arc>>, Arc>>)> = (&({ let mut encryptionContext = encryptionContext.clone(); @@ -97555,7 +97833,7 @@ pub mod _Structure_Compile { let mut k: Sequence = __compr_0.clone(); if encryptionContext.contains(&k) && _default::ENCRYPTION_CONTEXT_PREFIX() < k.clone() { _coll0.add(&(( - crate::implementation_from_dafny::UTF8::_default::Encode(&k.drop(&_default::ENCRYPTION_CONTEXT_PREFIX().cardinality())), + crate::implementation_from_dafny::UTF8::_default::Encode(&k.drop(&int!((&truncate!((&_default::ENCRYPTION_CONTEXT_PREFIX().cardinality()).clone(), u32)).clone()))), crate::implementation_from_dafny::UTF8::_default::Encode(&encryptionContext.get(&k)) ))) } @@ -97592,7 +97870,7 @@ pub mod _Structure_Compile { }) } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(304,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(305,3) pub fn DecryptOnlyBranchKeyEncryptionContext(branchKeyId: &Sequence, branchKeyVersion: &Sequence, timestamp: &Sequence, logicalKeyStoreName: &Sequence, kmsKeyArn: &Sequence, customEncryptionContext: &Map, Sequence>) -> Map, Sequence> { map![(_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (branchKeyId.clone()), (_default::TYPE_FIELD()) => (_default::BRANCH_KEY_TYPE_PREFIX().concat(branchKeyVersion)), (_default::KEY_CREATE_TIME()) => (timestamp.clone()), (_default::TABLE_FIELD()) => (logicalKeyStoreName.clone()), (_default::KMS_FIELD()) => (kmsKeyArn.clone()), (_default::HIERARCHY_VERSION()) => (string_utf16_of("1"))].merge(&(&({ let mut customEncryptionContext = customEncryptionContext.clone(); @@ -97608,21 +97886,21 @@ pub mod _Structure_Compile { }) }))()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(348,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(349,3) pub fn ActiveBranchKeyEncryptionContext(decryptOnlyEncryptionContext: &Map, Sequence>) -> Map, Sequence> { decryptOnlyEncryptionContext.merge(&map![(_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) => (decryptOnlyEncryptionContext.get(&_default::TYPE_FIELD())), (_default::TYPE_FIELD()) => (_default::BRANCH_KEY_ACTIVE_TYPE())]) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(364,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(365,3) pub fn BeaconKeyEncryptionContext(decryptOnlyEncryptionContext: &Map, Sequence>) -> Map, Sequence> { decryptOnlyEncryptionContext.merge(&map![(_default::TYPE_FIELD()) => (_default::BEACON_KEY_TYPE_VALUE())]) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(379,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(380,3) pub fn NewVersionFromActiveBranchKeyEncryptionContext(activeBranchKeyEncryptionContext: &Map, Sequence>, branchKeyVersion: &Sequence, timestamp: &Sequence) -> Map, Sequence> { activeBranchKeyEncryptionContext.merge(&map![(_default::TYPE_FIELD()) => (_default::BRANCH_KEY_TYPE_PREFIX().concat(branchKeyVersion)), (_default::KEY_CREATE_TIME()) => (timestamp.clone())]).subtract(&set!{_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()}) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(409,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(410,3) pub fn _BranchKeyItem_q(m: &Map, Arc>) -> bool { - m.contains(&_default::BRANCH_KEY_IDENTIFIER_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD())).as_ref(), S{ .. }) && m.contains(&_default::TYPE_FIELD()) && matches!((&m.get(&_default::TYPE_FIELD())).as_ref(), S{ .. }) && m.contains(&_default::KEY_CREATE_TIME()) && matches!((&m.get(&_default::KEY_CREATE_TIME())).as_ref(), S{ .. }) && m.contains(&_default::HIERARCHY_VERSION()) && matches!((&m.get(&_default::HIERARCHY_VERSION())).as_ref(), N{ .. }) && !m.contains(&_default::TABLE_FIELD()) && m.contains(&_default::KMS_FIELD()) && matches!((&m.get(&_default::KMS_FIELD())).as_ref(), S{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(m.get(&_default::KMS_FIELD()).S()) && m.contains(&_default::BRANCH_KEY_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_FIELD())).as_ref(), B{ .. }) && int!(0) < m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()).S().cardinality() && int!(0) < m.get(&_default::TYPE_FIELD()).S().cardinality() && (&m.keys().subtract(&set!{_default::BRANCH_KEY_FIELD(), _default::HIERARCHY_VERSION()})).iter().all(({ + m.contains(&_default::BRANCH_KEY_IDENTIFIER_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD())).as_ref(), S{ .. }) && m.contains(&_default::TYPE_FIELD()) && matches!((&m.get(&_default::TYPE_FIELD())).as_ref(), S{ .. }) && m.contains(&_default::KEY_CREATE_TIME()) && matches!((&m.get(&_default::KEY_CREATE_TIME())).as_ref(), S{ .. }) && m.contains(&_default::HIERARCHY_VERSION()) && matches!((&m.get(&_default::HIERARCHY_VERSION())).as_ref(), N{ .. }) && !m.contains(&_default::TABLE_FIELD()) && m.contains(&_default::KMS_FIELD()) && matches!((&m.get(&_default::KMS_FIELD())).as_ref(), S{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(m.get(&_default::KMS_FIELD()).S()) && m.contains(&_default::BRANCH_KEY_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_FIELD())).as_ref(), B{ .. }) && 0 < truncate!(m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()).S().cardinality(), u64) && 0 < truncate!(m.get(&_default::TYPE_FIELD()).S().cardinality(), u64) && (&m.keys().subtract(&set!{_default::BRANCH_KEY_FIELD(), _default::HIERARCHY_VERSION()})).iter().all(({ let mut m = m.clone(); Arc::new(move |__forall_var_0: &Sequence| -> bool{ let mut k: Sequence = __forall_var_0.clone(); @@ -97630,81 +97908,81 @@ pub mod _Structure_Compile { }) }).as_ref()) && m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (true && m.get(&_default::TYPE_FIELD()).S().clone() == _default::BRANCH_KEY_ACTIVE_TYPE()) && (!m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) || true && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()).S().clone()) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (m.get(&_default::TYPE_FIELD()).S().clone() == _default::BEACON_KEY_TYPE_VALUE() || _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::TYPE_FIELD()).S().clone()) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(m.get(&_default::BRANCH_KEY_FIELD()).B()) } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(436,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(437,3) pub fn _ActiveBranchKeyItem_q(m: &Map, Arc>) -> bool { _default::_BranchKeyItem_q(m) && m.get(&_default::TYPE_FIELD()).S().clone() == _default::BRANCH_KEY_ACTIVE_TYPE() && m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD())).as_ref(), S{ .. }) && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()).S().clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(444,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(445,3) pub fn _VersionBranchKeyItem_q(m: &Map, Arc>) -> bool { _default::_BranchKeyItem_q(m) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::TYPE_FIELD()).S().clone() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(451,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(452,3) pub fn _BeaconKeyItem_q(m: &Map, Arc>) -> bool { _default::_BranchKeyItem_q(m) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) && m.get(&_default::TYPE_FIELD()).S().clone() == _default::BEACON_KEY_TYPE_VALUE() } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(17,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(18,3) pub fn BRANCH_KEY_IDENTIFIER_FIELD() -> Sequence { string_utf16_of("branch-key-id") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(18,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(19,3) pub fn TYPE_FIELD() -> Sequence { string_utf16_of("type") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(19,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(20,3) pub fn KEY_CREATE_TIME() -> Sequence { string_utf16_of("create-time") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(20,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(21,3) pub fn HIERARCHY_VERSION() -> Sequence { string_utf16_of("hierarchy-version") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(21,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(22,3) pub fn TABLE_FIELD() -> Sequence { string_utf16_of("tablename") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(22,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(23,3) pub fn KMS_FIELD() -> Sequence { string_utf16_of("kms-arn") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(24,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(25,3) pub fn BRANCH_KEY_FIELD() -> Sequence { string_utf16_of("enc") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(25,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(26,3) pub fn BRANCH_KEY_ACTIVE_VERSION_FIELD() -> Sequence { string_utf16_of("version") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(28,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(29,3) pub fn BRANCH_KEY_ACTIVE_TYPE() -> Sequence { string_utf16_of("branch:ACTIVE") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(27,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(28,3) pub fn BRANCH_KEY_TYPE_PREFIX() -> Sequence { string_utf16_of("branch:version:") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(29,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(30,3) pub fn BEACON_KEY_TYPE_VALUE() -> Sequence { string_utf16_of("beacon:ACTIVE") } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(30,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(31,3) pub fn ENCRYPTION_CONTEXT_PREFIX() -> Sequence { string_utf16_of("aws-crypto-ec:") } } - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(37,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(38,3) pub type BranchKeyContext = Map, Sequence>; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(401,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(402,3) pub type BranchKeyItem = Map, Arc>; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(435,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(436,3) pub type ActiveBranchKeyItem = Map, Arc>; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(443,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(444,3) pub type VersionBranchKeyItem = Map, Arc>; - /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(450,3) + /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(451,3) pub type BeaconKeyItem = Map, Arc>; } /// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(6,1) @@ -97758,8 +98036,8 @@ pub mod _TestCreateEsdkClient_Compile { }; let mut esdk: Object = upcast_object::()(valueOrError0.Extract()); if !({ - let __is_23: Object = esdk.clone(); - __is_23.clone().is_instance_of::() + let __is_41: Object = esdk.clone(); + __is_41.clone().is_instance_of::() }) { panic!("Halt") }; @@ -100312,7 +100590,7 @@ pub mod _TestRequiredEncryptionContext_Compile { _default::TestReservedEncryptionContextKeyFailure() } } -/// ../mpl/StandardLibrary/src/Time.dfy(9,1) +/// ../mpl/StandardLibrary/src/Time.dfy(11,1) pub mod Time { pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::DafnyCharUTF16; @@ -100320,6 +100598,10 @@ pub mod Time { pub use ::dafny_runtime::string_utf16_of; pub use ::std::sync::Arc; pub use ::dafny_runtime::DafnyPrintWrapper; + pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; + pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some; + pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes; + pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; pub use ::std::fmt::Debug; pub use ::std::fmt::Formatter; pub use ::dafny_runtime::DafnyPrint; @@ -100332,7 +100614,7 @@ pub mod Time { pub struct _default {} impl _default { - /// ../mpl/StandardLibrary/src/Time.dfy(53,3) + /// ../mpl/StandardLibrary/src/Time.dfy(57,3) pub fn FormatMilli(diff: u64) -> Sequence { let mut whole: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&(diff / 1000)).clone())); let mut frac: Sequence = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&(diff % 1000)).clone())); @@ -100346,7 +100628,7 @@ pub mod Time { } } } - /// ../mpl/StandardLibrary/src/Time.dfy(65,3) + /// ../mpl/StandardLibrary/src/Time.dfy(69,3) pub fn FormatMilliDiff(start: i64, end: i64) -> Sequence { if start <= end { _default::FormatMilli((end - start) as u64) @@ -100354,7 +100636,7 @@ pub mod Time { string_utf16_of("-").concat(&_default::FormatMilli((start - end) as u64)) } } - /// ../mpl/StandardLibrary/src/Time.dfy(83,3) + /// ../mpl/StandardLibrary/src/Time.dfy(87,3) pub fn GetAbsoluteTime() -> Arc { let mut output: Arc; let mut ClockTime: i64; @@ -100369,7 +100651,7 @@ pub mod Time { }); return output.clone(); } - /// ../mpl/StandardLibrary/src/Time.dfy(93,3) + /// ../mpl/StandardLibrary/src/Time.dfy(97,3) pub fn PrintTimeSince(start: &Arc) -> () { let mut t: Arc; let mut _out0: Arc = _default::TimeSince(start); @@ -100377,7 +100659,7 @@ pub mod Time { _default::PrintTime(&t); return (); } - /// ../mpl/StandardLibrary/src/Time.dfy(99,3) + /// ../mpl/StandardLibrary/src/Time.dfy(103,3) pub fn PrintTimeSinceShort(start: &Arc) -> () { let mut t: Arc; let mut _out0: Arc = _default::TimeSince(start); @@ -100385,7 +100667,7 @@ pub mod Time { _default::PrintTimeShort(&t); return (); } - /// ../mpl/StandardLibrary/src/Time.dfy(105,3) + /// ../mpl/StandardLibrary/src/Time.dfy(109,3) pub fn PrintTimeSinceShortChained(start: &Arc) -> Arc { let mut x: Arc; let mut end: Arc; @@ -100395,7 +100677,7 @@ pub mod Time { x = end.clone(); return x.clone(); } - /// ../mpl/StandardLibrary/src/Time.dfy(112,3) + /// ../mpl/StandardLibrary/src/Time.dfy(116,3) pub fn TimeDiff(start: &Arc, end: &Arc) -> Arc { if start.ClockTime().clone() <= end.ClockTime().clone() && start.CpuTime().clone() <= end.CpuTime().clone() { Arc::new(RelativeTime::RelativeTime { @@ -100409,7 +100691,7 @@ pub mod Time { }) } } - /// ../mpl/StandardLibrary/src/Time.dfy(126,3) + /// ../mpl/StandardLibrary/src/Time.dfy(130,3) pub fn TimeSince(start: &Arc) -> Arc { let mut output: Arc; let mut end: Arc; @@ -100418,7 +100700,7 @@ pub mod Time { output = _default::TimeDiff(start, &end); return output.clone(); } - /// ../mpl/StandardLibrary/src/Time.dfy(132,3) + /// ../mpl/StandardLibrary/src/Time.dfy(136,3) pub fn PrintTime(time: &Arc) -> () { print!("{}", DafnyPrintWrapper(&string_utf16_of("Clock Time : "))); print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.ClockTime().clone()))); @@ -100427,34 +100709,42 @@ pub mod Time { print!("{}", DafnyPrintWrapper(&string_utf16_of("\n"))); return (); } - /// ../mpl/StandardLibrary/src/Time.dfy(137,3) - pub fn PrintTimeLong(time: &Arc, tag: &Sequence) -> () { - print!("{}", DafnyPrintWrapper(tag)); - print!("{}", DafnyPrintWrapper(&string_utf16_of(" "))); - print!("{}", DafnyPrintWrapper(&crate::implementation_from_dafny::OsLang::_default::GetOsLong())); - print!("{}", DafnyPrintWrapper(&string_utf16_of(" "))); - print!("{}", DafnyPrintWrapper(&crate::implementation_from_dafny::OsLang::_default::GetLanguageLong())); - print!("{}", DafnyPrintWrapper(&string_utf16_of(" Clock Time : "))); - print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.ClockTime().clone()))); - print!("{}", DafnyPrintWrapper(&string_utf16_of(" CPU Time : "))); - print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.CpuTime().clone()))); - print!("{}", DafnyPrintWrapper(&string_utf16_of("\n"))); + /// ../mpl/StandardLibrary/src/Time.dfy(141,3) + pub fn PrintTimeSinceLong(start: &Arc, tag: &Sequence, file: &Arc>>) -> () { + let mut t: Arc; + let mut _out0: Arc = _default::TimeSince(start); + t = _out0.clone(); + _default::PrintTimeLong(&t, tag, file); + return (); + } + /// ../mpl/StandardLibrary/src/Time.dfy(147,3) + pub fn PrintTimeLong(time: &Arc, tag: &Sequence, file: &Arc>>) -> () { + let mut val: Sequence = tag.concat(&string_utf16_of(" ")).concat(&crate::implementation_from_dafny::OsLang::_default::GetOsShort()).concat(&string_utf16_of(" ")).concat(&crate::implementation_from_dafny::OsLang::_default::GetLanguageShort()).concat(&string_utf16_of(" ")).concat(&_default::FormatMilli(time.ClockTime().clone())).concat(&string_utf16_of(" ")).concat(&_default::FormatMilli(time.CpuTime().clone())).concat(&string_utf16_of("\n")); + print!("{}", DafnyPrintWrapper(&val)); + if matches!(file.as_ref(), Some{ .. }) { + let mut utf8_val: Arc>> = crate::implementation_from_dafny::UTF8::_default::Encode(&val); + if matches!((&utf8_val).as_ref(), Success{ .. }) { + let mut _v0: Arc>>; + let mut _out0: Arc>> = crate::implementation_from_dafny::_FileIO_Compile::_default::AppendBytesToFile(file.value(), utf8_val.value()); + _v0 = _out0.clone(); + } + }; return (); } - /// ../mpl/StandardLibrary/src/Time.dfy(142,3) + /// ../mpl/StandardLibrary/src/Time.dfy(159,3) pub fn PrintTimeShort(time: &Arc) -> () { print!("{}", DafnyPrintWrapper(&string_utf16_of("CPU:"))); print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.CpuTime().clone()))); print!("{}", DafnyPrintWrapper(&string_utf16_of(" "))); return (); } - /// ../mpl/StandardLibrary/src/Time.dfy(152,3) + /// ../mpl/StandardLibrary/src/Time.dfy(169,3) pub fn CreateGetCurrentTimeStampSuccess(value: &Sequence) -> Arc, Sequence>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Sequence>::Success { value: value.clone() }) } - /// ../mpl/StandardLibrary/src/Time.dfy(156,3) + /// ../mpl/StandardLibrary/src/Time.dfy(173,3) pub fn CreateGetCurrentTimeStampFailure(error: &Sequence) -> Arc, Sequence>> { Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::, Sequence>::Failure { error: error.clone() @@ -100462,7 +100752,7 @@ pub mod Time { } } - /// ../mpl/StandardLibrary/src/Time.dfy(75,3) + /// ../mpl/StandardLibrary/src/Time.dfy(79,3) #[derive(PartialEq, Clone)] pub enum AbsoluteTime { AbsoluteTime { @@ -100541,7 +100831,7 @@ pub mod Time { } } - /// ../mpl/StandardLibrary/src/Time.dfy(79,3) + /// ../mpl/StandardLibrary/src/Time.dfy(83,3) #[derive(PartialEq, Clone)] pub enum RelativeTime { RelativeTime { @@ -100629,8 +100919,11 @@ pub mod UTF8 { pub use ::dafny_runtime::integer_range; pub use ::dafny_runtime::int; pub use ::dafny_runtime::DafnyInt; - pub use ::dafny_runtime::seq; pub use ::dafny_runtime::_System::nat; + pub use ::std::default::Default; + pub use ::dafny_runtime::truncate; + pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64; + pub use ::dafny_runtime::seq; pub struct _default {} @@ -100669,97 +100962,89 @@ pub mod UTF8 { }) }).as_ref()) } - /// ../mpl/StandardLibrary/src/UTF8.dfy(62,3) - pub fn EncodeAscii(s: &Sequence) -> ValidUTF8Bytes { - let mut _accumulator: ValidUTF8Bytes = seq![] as Sequence; - let mut _r0 = s.clone(); - 'TAIL_CALL_START: loop { - let s = _r0; - if s.cardinality() == int!(0) { - return _accumulator.concat(&(seq![] as Sequence)); - } else { - let mut x: Sequence = seq![s.get(&int!(0)).0 as u8]; - _accumulator = _accumulator.concat(&x); - let mut _in0: Sequence = s.drop(&int!(1)); - _r0 = _in0.clone(); - continue 'TAIL_CALL_START; - } - } - } - /// ../mpl/StandardLibrary/src/UTF8.dfy(105,3) + /// ../mpl/StandardLibrary/src/UTF8.dfy(108,3) pub fn Uses1Byte(s: &Sequence) -> bool { 0 <= s.get(&int!(0)) && s.get(&int!(0)) <= 127 } - /// ../mpl/StandardLibrary/src/UTF8.dfy(112,3) + /// ../mpl/StandardLibrary/src/UTF8.dfy(115,3) pub fn Uses2Bytes(s: &Sequence) -> bool { 194 <= s.get(&int!(0)) && s.get(&int!(0)) <= 223 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) } - /// ../mpl/StandardLibrary/src/UTF8.dfy(119,3) + /// ../mpl/StandardLibrary/src/UTF8.dfy(122,3) pub fn Uses3Bytes(s: &Sequence) -> bool { s.get(&int!(0)) == 224 && (160 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) || 225 <= s.get(&int!(0)) && s.get(&int!(0)) <= 236 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) || s.get(&int!(0)) == 237 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 159) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) || 238 <= s.get(&int!(0)) && s.get(&int!(0)) <= 239 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) } - /// ../mpl/StandardLibrary/src/UTF8.dfy(129,3) + /// ../mpl/StandardLibrary/src/UTF8.dfy(132,3) pub fn Uses4Bytes(s: &Sequence) -> bool { s.get(&int!(0)) == 240 && (144 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) && (128 <= s.get(&int!(3)) && s.get(&int!(3)) <= 191) || 241 <= s.get(&int!(0)) && s.get(&int!(0)) <= 243 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) && (128 <= s.get(&int!(3)) && s.get(&int!(3)) <= 191) || s.get(&int!(0)) == 244 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 143) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) && (128 <= s.get(&int!(3)) && s.get(&int!(3)) <= 191) } - /// ../mpl/StandardLibrary/src/UTF8.dfy(138,3) + /// ../mpl/StandardLibrary/src/UTF8.dfy(141,3) pub fn ValidUTF8Range(a: &Sequence, lo: &nat, hi: &nat) -> bool { - let mut _r0 = a.clone(); - let mut _r1 = lo.clone(); - let mut _r2 = hi.clone(); - 'TAIL_CALL_START: loop { - let a = _r0; - let lo = _r1; - let hi = _r2; - if lo.clone() == hi.clone() { - return true; + let mut _hresult: bool = ::default(); + if crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint64Len::(a) { + _hresult = _default::BoundedValidUTF8Range(a, truncate!(lo.clone(), u64), truncate!(hi.clone(), u64)); + return _hresult; + }; + if lo.clone() == hi.clone() { + _hresult = true; + return _hresult; + }; + let mut i: DafnyInt = lo.clone(); + while i.clone() < hi.clone() { + if i.clone() < hi.clone() && (0 <= a.get(&i) && a.get(&i) <= 127) { + i = i.clone() + int!(1); } else { - let mut r: Sequence = a.slice(&lo, &hi); - if _default::Uses1Byte(&r) { - let mut _in0: Sequence = a.clone(); - let mut _in1: DafnyInt = lo.clone() + int!(1); - let mut _in2: nat = hi.clone(); - _r0 = _in0.clone(); - _r1 = _in1.clone(); - _r2 = _in2.clone(); - continue 'TAIL_CALL_START; + if i.clone() + int!(1) < hi.clone() && (194 <= a.get(&i) && a.get(&i) <= 223) && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) { + i = i.clone() + int!(2); } else { - if int!(2) <= r.cardinality() && _default::Uses2Bytes(&r) { - let mut _in3: Sequence = a.clone(); - let mut _in4: DafnyInt = lo.clone() + int!(2); - let mut _in5: nat = hi.clone(); - _r0 = _in3.clone(); - _r1 = _in4.clone(); - _r2 = _in5.clone(); - continue 'TAIL_CALL_START; + if i.clone() + int!(2) < hi.clone() && (a.get(&i) == 224 && (160 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) || 225 <= a.get(&i) && a.get(&i) <= 236 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) || a.get(&i) == 237 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 159) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) || 238 <= a.get(&i) && a.get(&i) <= 239 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191)) { + i = i.clone() + int!(3); } else { - if int!(3) <= r.cardinality() && _default::Uses3Bytes(&r) { - let mut _in6: Sequence = a.clone(); - let mut _in7: DafnyInt = lo.clone() + int!(3); - let mut _in8: nat = hi.clone(); - _r0 = _in6.clone(); - _r1 = _in7.clone(); - _r2 = _in8.clone(); - continue 'TAIL_CALL_START; + if i.clone() + int!(3) < hi.clone() && (a.get(&i) == 240 && (144 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) && (128 <= a.get(&(i.clone() + int!(3))) && a.get(&(i.clone() + int!(3))) <= 191) || 241 <= a.get(&i) && a.get(&i) <= 243 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) && (128 <= a.get(&(i.clone() + int!(3))) && a.get(&(i.clone() + int!(3))) <= 191) || a.get(&i) == 244 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 143) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) && (128 <= a.get(&(i.clone() + int!(3))) && a.get(&(i.clone() + int!(3))) <= 191)) { + i = i.clone() + int!(4); } else { - if int!(4) <= r.cardinality() && _default::Uses4Bytes(&r) { - let mut _in9: Sequence = a.clone(); - let mut _in10: DafnyInt = lo.clone() + int!(4); - let mut _in11: nat = hi.clone(); - _r0 = _in9.clone(); - _r1 = _in10.clone(); - _r2 = _in11.clone(); - continue 'TAIL_CALL_START; - } else { - return false; - } + _hresult = false; + return _hresult; } } } } - } + }; + _hresult = true; + return _hresult; } - /// ../mpl/StandardLibrary/src/UTF8.dfy(180,3) + /// ../mpl/StandardLibrary/src/UTF8.dfy(223,3) + pub fn BoundedValidUTF8Range(a: &seq64, lo: u64, hi: u64) -> bool { + let mut _hresult: bool = ::default(); + if lo == hi { + _hresult = true; + return _hresult; + }; + let mut i: u64 = lo; + while i < hi { + if i < hi && (0 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 127) { + i = i + 1; + } else { + if i < hi - 1 && (194 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 223) && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) { + i = i + 2; + } else { + if 2 <= hi && i < hi - 2 && (a.get(&int!((&i).clone())) == 224 && (160 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) || 225 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 236 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) || a.get(&int!((&i).clone())) == 237 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 159) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) || 238 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 239 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191)) { + i = i + 3; + } else { + if 3 <= hi && i < hi - 3 && (a.get(&int!((&i).clone())) == 240 && (144 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 3)).clone())) && a.get(&int!((&(i + 3)).clone())) <= 191) || 241 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 243 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 3)).clone())) && a.get(&int!((&(i + 3)).clone())) <= 191) || a.get(&int!((&i).clone())) == 244 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 143) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 3)).clone())) && a.get(&int!((&(i + 3)).clone())) <= 191)) { + i = i + 4; + } else { + _hresult = false; + return _hresult; + } + } + } + } + }; + _hresult = true; + return _hresult; + } + /// ../mpl/StandardLibrary/src/UTF8.dfy(303,3) pub fn ValidUTF8Seq(s: &Sequence) -> bool { _default::ValidUTF8Range(s, &int!(0), &s.cardinality()) } @@ -101545,8 +101830,9 @@ pub mod _V1HeaderBody_Compile { pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody; - pub use ::dafny_runtime::int; pub use ::dafny_runtime::seq; + pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::DafnyCharUTF16; pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo; @@ -101628,7 +101914,7 @@ pub mod _V1HeaderBody_Compile { encryptionContext: encryptionContext.data().clone(), encryptedDataKeys: encryptedDataKeys.data().clone(), contentType: contentType.data().clone(), - headerIvLength: int!(headerIvLength.data().clone()), + headerIvLength: headerIvLength.data().clone() as u64, frameLength: frameLength.data().clone() }); Arc::new(Result::>, MoreNeeded>::Success { @@ -101656,14 +101942,14 @@ pub mod _V1HeaderBody_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(239,3) pub fn ReadV1MessageType(buffer: &Arc) -> Arc>>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!(1)); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>>() } else { let mut __let_tmp_rhs0: Arc>> = valueOrError0.Extract(); let mut raw: Sequence = __let_tmp_rhs0.data().clone(); let mut tail: Arc = __let_tmp_rhs0.tail().clone(); - let mut valueOrError1: Arc, Arc>> = MessageType::Get(raw.get(&int!(0))).MapFailure::>(&({ + let mut valueOrError1: Arc, Arc>> = MessageType::Get(raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))).MapFailure::>(&({ Arc::new(move |e: &Sequence| -> Arc{ Arc::new(ReadProblems::Error { message: e.clone() @@ -101689,7 +101975,7 @@ pub mod _V1HeaderBody_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(262,3) pub fn ReadV1ReservedBytes(buffer: &Arc) -> Arc>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &_default::RESERVED_BYTES().cardinality()); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, truncate!(_default::RESERVED_BYTES().cardinality(), u64)); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { @@ -101718,14 +102004,14 @@ pub mod _V1HeaderBody_Compile { } /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(282,3) pub fn ReadV1HeaderIvLength(buffer: &Arc, suite: &Arc) -> Arc>, Arc>> { - let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, &int!(1)); + let mut valueOrError0: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>>() } else { let mut __let_tmp_rhs0: Arc>> = valueOrError0.Extract(); let mut raw: Sequence = __let_tmp_rhs0.data().clone(); let mut tail: Arc = __let_tmp_rhs0.tail().clone(); - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(raw.get(&int!(0)) == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite), &Arc::new(ReadProblems::Error { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite), &Arc::new(ReadProblems::Error { message: string_utf16_of("HeaderIv Length does not match Algorithm Suite.") })); if valueOrError1.IsFailure() { @@ -101733,7 +102019,7 @@ pub mod _V1HeaderBody_Compile { } else { Arc::new(Result::>, Arc>::Success { value: Arc::new(SuccessfulRead::::SuccessfulRead { - data: raw.get(&int!(0)), + data: raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), tail: tail.clone() }) }) @@ -101781,9 +102067,9 @@ pub mod _V2HeaderBody_Compile { pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16; pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType; - pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody; - pub use ::dafny_runtime::DafnyInt; + pub use ::dafny_runtime::truncate; + pub use ::dafny_runtime::int; pub struct _default {} @@ -101841,7 +102127,7 @@ pub mod _V2HeaderBody_Compile { valueOrError8.PropagateFailure::>>() } else { let mut frameLength: Arc> = valueOrError8.Extract(); - let mut valueOrError9: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(frameLength.tail(), &int!(suite.data().commitment().HKDF().outputKeyLength().clone())); + let mut valueOrError9: Arc>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(frameLength.tail(), suite.data().commitment().HKDF().outputKeyLength().clone() as u64); if valueOrError9.IsFailure() { valueOrError9.PropagateFailure::>>() } else { @@ -101873,8 +102159,8 @@ pub mod _V2HeaderBody_Compile { } } /// dafny/AwsEncryptionSdk/src/Serialize/V2HeaderBody.dfy(179,3) - pub fn headerBytesToAADStart() -> DafnyInt { - int!(1) + int!(2) + int!(32) + pub fn headerBytesToAADStart() -> u64 { + truncate!(int!(1) + int!(2) + int!(32), u64) } } @@ -101891,13 +102177,13 @@ pub mod _WrappedHKDF_Compile { pub use ::dafny_runtime::MaybePlacebo; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option; pub use ::dafny_runtime::Object; pub use crate::implementation_from_dafny::HMAC::HMac; - pub use ::dafny_runtime::truncate; + pub use ::dafny_runtime::int; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfInput; @@ -101905,10 +102191,10 @@ pub mod _WrappedHKDF_Compile { pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(21,3) + /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(22,3) pub fn Extract(input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>((matches!(input.salt().as_ref(), None{ .. }) || input.salt().value().cardinality() != int!(0)) && input.ikm().cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>((matches!(input.salt().as_ref(), None{ .. }) || truncate!(input.salt().value().cardinality(), u64) != 0) && truncate!(input.ikm().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("HKDF Extract needs a salt and reasonable ikm.") })); if valueOrError0.IsFailure() { @@ -101928,17 +102214,17 @@ pub mod _WrappedHKDF_Compile { }; let mut hmac: Object = valueOrError1.Extract(); let mut prk: Sequence; - let mut _out1: Sequence = crate::implementation_from_dafny::_HKDF_Compile::_default::Extract(&hmac, &salt.UnwrapOr(&crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Fill::(&truncate!((&int!(0)).clone(), u8), &crate::implementation_from_dafny::_Digest_Compile::_default::Length(&digestAlgorithm))), &ikm); + let mut _out1: Sequence = crate::implementation_from_dafny::_HKDF_Compile::_default::Extract(&hmac, &salt.UnwrapOr(&crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Fill::(&truncate!((&int!(0)).clone(), u8), &int!((&crate::implementation_from_dafny::_Digest_Compile::_default::Length(&digestAlgorithm)).clone()))), &ikm); prk = _out1.clone(); output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: prk.clone() })); return output.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(44,3) + /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(46,3) pub fn Expand(input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(1) <= int!(input.expectedLength().clone()) && int!(input.expectedLength().clone()) <= int!(255) * crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm()) && input.info().cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT() && crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm()) == input.prk().cardinality(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(1 <= input.expectedLength().clone() as u64 && (input.expectedLength().clone() as u64) <= (255 * crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm())) && truncate!(input.info().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64) && crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm()) == truncate!(input.prk().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("HKDF Expand needs valid input.") })); if valueOrError0.IsFailure() { @@ -101959,17 +102245,17 @@ pub mod _WrappedHKDF_Compile { }; let mut hmac: Object = valueOrError1.Extract(); let mut omk: Sequence; - let mut _out1: Sequence = crate::implementation_from_dafny::_HKDF_Compile::_default::Expand(&hmac, &prk, &info, &int!((&expectedLength).clone()), &digestAlgorithm); + let mut _out1: Sequence = crate::implementation_from_dafny::_HKDF_Compile::_default::Expand(&hmac, &prk, &info, expectedLength as u64, &digestAlgorithm); omk = _out1.clone(); output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: omk.clone() })); return output.read(); } - /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(72,3) + /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(75,3) pub fn Hkdf(input: &Arc) -> Arc, Arc>> { let mut output = MaybePlacebo::, Arc>>>::new(); - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(1) <= int!(input.expectedLength().clone()) && int!(input.expectedLength().clone()) <= int!(255) * crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm()) && (matches!(input.salt().as_ref(), None{ .. }) || input.salt().value().cardinality() != int!(0)) && input.info().cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT() && input.ikm().cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(1 <= input.expectedLength().clone() as u64 && (input.expectedLength().clone() as u64) <= (255 * crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm())) && (matches!(input.salt().as_ref(), None{ .. }) || truncate!(input.salt().value().cardinality(), u64) != 0) && truncate!(input.info().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64) && truncate!(input.ikm().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Wrapped Hkdf input is invalid.") })); if valueOrError0.IsFailure() { @@ -101983,7 +102269,7 @@ pub mod _WrappedHKDF_Compile { let mut info: Sequence = __let_tmp_rhs0.info().clone(); let mut expectedLength: PositiveInteger = __let_tmp_rhs0.expectedLength().clone(); let mut okm: Sequence; - let mut _out0: Sequence = crate::implementation_from_dafny::_HKDF_Compile::_default::Hkdf(&digest, &salt, &ikm, &info, &int!((&expectedLength).clone())); + let mut _out0: Sequence = crate::implementation_from_dafny::_HKDF_Compile::_default::Hkdf(&digest, &salt, &ikm, &info, expectedLength as u64); okm = _out0.clone(); output = MaybePlacebo::from(Arc::new(Result::, Arc>::Success { value: okm.clone() @@ -102000,21 +102286,21 @@ pub mod _WrappedHMAC_Compile { pub use ::dafny_runtime::Sequence; pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome; - pub use ::dafny_runtime::int; + pub use ::dafny_runtime::truncate; pub use ::dafny_runtime::string_utf16_of; pub struct _default {} impl _default { - /// ../mpl/AwsCryptographyPrimitives/src/WrappedHMAC.dfy(14,3) + /// ../mpl/AwsCryptographyPrimitives/src/WrappedHMAC.dfy(15,3) pub fn Digest(input: &Arc) -> Arc, Arc>> { - let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(int!(0) < input.key().cardinality(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError0: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(0 < truncate!(input.key().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Key MUST NOT be 0 bytes.") })); if valueOrError0.IsFailure() { valueOrError0.PropagateFailure::>() } else { - let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(input.message().cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), &Arc::new(Error::AwsCryptographicPrimitivesError { + let mut valueOrError1: Arc>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::>(truncate!(input.message().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError { message: string_utf16_of("Message over INT32_MAX_LIMIT") })); if valueOrError1.IsFailure() { @@ -102042,6 +102328,8 @@ pub mod _WrappedHMAC_Compile { pub mod _Wrappers_Compile { pub use ::dafny_runtime::DafnyType; pub use ::std::sync::Arc; + pub use ::std::marker::Sync; + pub use ::std::marker::Send; pub use ::dafny_runtime::Sequence; pub use ::dafny_runtime::DafnyCharUTF16; pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None; @@ -102056,8 +102344,6 @@ pub mod _Wrappers_Compile { pub use ::std::convert::AsRef; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success; pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure; - pub use ::std::marker::Sync; - pub use ::std::marker::Send; pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome::Fail; pub struct _default {} @@ -102073,6 +102359,16 @@ pub mod _Wrappers_Compile { }) } } + /// ../mpl/libraries/src/Wrappers.dfy(111,3) + pub fn FNeed<_E: DafnyType>(condition: bool, error: &Arc _E + Sync + Send>) -> Arc> { + if condition { + Arc::new(Outcome::<_E>::Pass {}) + } else { + Arc::new(Outcome::<_E>::Fail { + error: error() + }) + } + } } /// ../mpl/libraries/src/Wrappers.dfy(10,3) diff --git a/releases/rust/esdk/src/kms.rs b/releases/rust/esdk/src/kms.rs index a18e397ed..6778551e9 100644 --- a/releases/rust/esdk/src/kms.rs +++ b/releases/rust/esdk/src/kms.rs @@ -26,11 +26,11 @@ impl crate::r#software::amazon::cryptography::services::kms::internaldafny::_def let shared_config = match tokio::runtime::Handle::try_current() { Ok(curr) => tokio::task::block_in_place(|| { curr.block_on(async { - aws_config::load_defaults(aws_config::BehaviorVersion::v2024_03_28()).await + aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await }) }), Err(_) => DAFNY_TOKIO_RUNTIME.block_on(aws_config::load_defaults( - aws_config::BehaviorVersion::v2024_03_28(), + aws_config::BehaviorVersion::latest(), )), }; @@ -51,11 +51,11 @@ impl crate::r#software::amazon::cryptography::services::kms::internaldafny::_def let shared_config = match tokio::runtime::Handle::try_current() { Ok(curr) => tokio::task::block_in_place(|| { curr.block_on(async { - aws_config::load_defaults(aws_config::BehaviorVersion::v2024_03_28()).await + aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await }) }), Err(_) => DAFNY_TOKIO_RUNTIME.block_on(aws_config::load_defaults( - aws_config::BehaviorVersion::v2024_03_28(), + aws_config::BehaviorVersion::latest(), )), }; diff --git a/releases/rust/esdk/src/random.rs b/releases/rust/esdk/src/random.rs index ae8edf95a..0aedbbae8 100644 --- a/releases/rust/esdk/src/random.rs +++ b/releases/rust/esdk/src/random.rs @@ -25,7 +25,7 @@ impl crate::ExternRandom::_default { Ok(_) => { ::dafny_runtime::Rc::new( _Wrappers_Compile::Result::Success{value : - dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&rand_bytes, |x| *x) + dafny_runtime::Sequence::from_array_owned(rand_bytes) } ) } diff --git a/releases/rust/esdk/src/rsa.rs b/releases/rust/esdk/src/rsa.rs index 5edfda2a6..72bd24ca9 100644 --- a/releases/rust/esdk/src/rsa.rs +++ b/releases/rust/esdk/src/rsa.rs @@ -71,7 +71,10 @@ pub mod RSAEncryption { length_bits: i32, ) -> (::dafny_runtime::Sequence, ::dafny_runtime::Sequence) { match generate_key_pair(length_bits) { - Ok(x) => (x.0.iter().cloned().collect(), x.1.iter().cloned().collect()), + Ok(x) => ( + dafny_runtime::Sequence::from_array_owned(x.0), + dafny_runtime::Sequence::from_array_owned(x.1), + ), Err(e) => { panic!("Unexpected error generating RSA Key Pair{}", e); } @@ -102,8 +105,8 @@ pub mod RSAEncryption { pub fn GetRSAKeyModulusLengthExtern( public_key: &::dafny_runtime::Sequence, ) -> Rc>> { - let public_key: Vec = public_key.iter().collect(); - match get_modulus(&public_key) { + let public_key = &public_key.to_array(); + match get_modulus(public_key) { Ok(v) => Rc::new(Wrappers::Result::Success { value: v }), Err(e) => Rc::new(Wrappers::Result::Failure { error: error(&e) }), } @@ -140,11 +143,11 @@ pub mod RSAEncryption { private_key: &::dafny_runtime::Sequence, cipher_text: &::dafny_runtime::Sequence, ) -> Rc, Rc>> { - let private_key: Vec = private_key.iter().collect(); - let cipher_text: Vec = cipher_text.iter().collect(); - match decrypt_extern(mode, &private_key, &cipher_text) { + let private_key = &private_key.to_array(); + let cipher_text = &cipher_text.to_array(); + match decrypt_extern(mode, private_key, cipher_text) { Ok(x) => Rc::new(Wrappers::Result::Success { - value: x.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(x), }), Err(e) => { let msg = format!("RSA Decrypt : {}", e); @@ -182,11 +185,11 @@ pub mod RSAEncryption { public_key: &::dafny_runtime::Sequence, message: &::dafny_runtime::Sequence, ) -> Rc, Rc>> { - let public_key: Vec = public_key.iter().collect(); - let message: Vec = message.iter().collect(); - match encrypt_extern(mode, &public_key, &message) { + let public_key = &public_key.to_array(); + let message = &message.to_array(); + match encrypt_extern(mode, public_key, message) { Ok(x) => Rc::new(Wrappers::Result::Success { - value: x.iter().cloned().collect(), + value: dafny_runtime::Sequence::from_array_owned(x), }), Err(e) => { let msg = format!("RSA Encrypt : {}", e); @@ -235,7 +238,7 @@ pub mod RSAEncryption { let mode = RSAPaddingMode::OAEP_SHA256 {}; let plain_text: ::dafny_runtime::Sequence = - [1u8, 2, 3, 4, 5].iter().cloned().collect(); + dafny_runtime::Sequence::from_array_owned(vec![1u8, 2, 3, 4, 5]); let cipher: ::dafny_runtime::Sequence = match &*EncryptExtern(&mode, &public_key, &plain_text) { diff --git a/releases/rust/esdk/src/sets.rs b/releases/rust/esdk/src/sets.rs index 6c9fb380c..6ac6a71cc 100644 --- a/releases/rust/esdk/src/sets.rs +++ b/releases/rust/esdk/src/sets.rs @@ -25,7 +25,7 @@ pub mod SortedSets { ) -> ::dafny_runtime::Sequence<::dafny_runtime::Sequence> { let mut vec = elems.iter().cloned().collect::>(); vec.sort_by(|a, b| Self::order(a, b, less)); - dafny_runtime::dafny_runtime_conversions::vec_to_dafny_sequence(&vec, |x| x.clone()) + dafny_runtime::Sequence::from_array_owned(vec) } pub fn SetToOrderedSequence2( diff --git a/releases/rust/esdk/src/uuid.rs b/releases/rust/esdk/src/uuid.rs index 2a75c8bab..56f330dbc 100644 --- a/releases/rust/esdk/src/uuid.rs +++ b/releases/rust/esdk/src/uuid.rs @@ -26,7 +26,7 @@ impl crate::UUID::_default { Ok(u) => { let b = u.as_bytes(); dafny_runtime::Rc::new(_Wrappers_Compile::Result::Success { value : - b.iter().cloned().collect() + dafny_runtime::Sequence::from_array_owned(b.to_vec()) }) } Err(e) => { @@ -47,7 +47,7 @@ impl crate::UUID::_default { ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16>, >, > { - let vec: Vec = bytes.iter().collect(); + let vec = &bytes.to_array(); if vec.len() != 16 { return dafny_runtime::Rc::new(_Wrappers_Compile::Result::Failure{ error : dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string("Not 16 bytes of input to FromByteArray.")