github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl@v0.2.0/awscryptographymaterialproviderssmithygenerated/to_native.go (about) 1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package awscryptographymaterialproviderssmithygenerated 4 5 import ( 6 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/dynamodb/comamazonawsdynamodbsmithygenerated" 7 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/kms/ComAmazonawsKmsTypes" 8 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/kms/KMSwrapped" 9 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/kms/comamazonawskmssmithygenerated" 10 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/AwsCryptographyKeyStoreTypes" 11 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/AwsCryptographyMaterialProvidersTypes" 12 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographykeystoresmithygenerated" 13 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographykeystoresmithygeneratedtypes" 14 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographymaterialproviderssmithygeneratedtypes" 15 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/AwsCryptographyPrimitivesTypes" 16 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/awscryptographyprimitivessmithygenerated" 17 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/awscryptographyprimitivessmithygeneratedtypes" 18 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/UTF8" 19 "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers" 20 "github.com/aws/aws-sdk-go-v2/service/kms" 21 kmstypes "github.com/aws/aws-sdk-go-v2/service/kms/types" 22 "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" 23 ) 24 25 func CreateAwsKmsDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput { 26 27 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput{KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), 28 DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), 29 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 30 } 31 32 } 33 34 func CreateAwsKmsDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput { 35 36 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput{Regions: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(dafnyInput.Dtor_regions()), 37 DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), 38 ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { 39 if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { 40 return nil 41 } 42 return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) 43 }(), 44 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 45 } 46 47 } 48 49 func CreateAwsKmsEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput { 50 51 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), 52 CurveSpec: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), 53 KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), 54 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 55 } 56 57 } 58 59 func CreateAwsKmsHierarchicalKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput { 60 61 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput{BranchKeyId: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(dafnyInput.Dtor_branchKeyId().UnwrapOr(nil)), 62 BranchKeyIdSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { 63 if dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil) == nil { 64 return nil 65 } 66 return BranchKeyIdSupplier_FromDafny(dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier)) 67 }(), 68 KeyStore: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(dafnyInput.Dtor_keyStore()), 69 TtlSeconds: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(dafnyInput.Dtor_ttlSeconds()), 70 Cache: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(dafnyInput.Dtor_cache().UnwrapOr(nil)), 71 PartitionId: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(dafnyInput.Dtor_partitionId().UnwrapOr(nil)), 72 } 73 74 } 75 76 func CreateAwsKmsKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput { 77 78 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput{KmsKeyId: Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), 79 KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), 80 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 81 } 82 83 } 84 85 func CreateAwsKmsMrkDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkDiscoveryKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryKeyringInput { 86 87 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryKeyringInput{KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), 88 DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), 89 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 90 Region: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(dafnyInput.Dtor_region()), 91 } 92 93 } 94 95 func CreateAwsKmsMrkDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkDiscoveryMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryMultiKeyringInput { 96 97 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryMultiKeyringInput{Regions: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(dafnyInput.Dtor_regions()), 98 DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), 99 ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { 100 if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { 101 return nil 102 } 103 return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) 104 }(), 105 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 106 } 107 108 } 109 110 func CreateAwsKmsMrkKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput { 111 112 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput{KmsKeyId: Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), 113 KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), 114 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 115 } 116 117 } 118 119 func CreateAwsKmsMrkMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput { 120 121 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput{Generator: Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), 122 KmsKeyIds: Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), 123 ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { 124 if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { 125 return nil 126 } 127 return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) 128 }(), 129 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 130 } 131 132 } 133 134 func CreateAwsKmsMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput { 135 136 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput{Generator: Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), 137 KmsKeyIds: Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), 138 ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { 139 if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { 140 return nil 141 } 142 return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) 143 }(), 144 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 145 } 146 147 } 148 149 func CreateAwsKmsRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsRsaKeyringInput { 150 151 return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsRsaKeyringInput{PublicKey: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), 152 KmsKeyId: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), 153 EncryptionAlgorithm: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_FromDafny(dafnyInput.Dtor_encryptionAlgorithm()), 154 KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient().UnwrapOr(nil)), 155 GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), 156 } 157 158 } 159 160 func CreateCryptographicMaterialsCacheInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput { 161 162 return awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput{Cache: Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(dafnyInput.Dtor_cache())} 163 164 } 165 166 func CreateDefaultClientSupplierInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput { 167 168 return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput{} 169 170 } 171 172 func CreateDefaultCryptographicMaterialsManagerInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput { 173 174 return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput{Keyring: Keyring_FromDafny(dafnyInput.Dtor_keyring())} 175 176 } 177 178 func CreateMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateMultiKeyringInput { 179 180 return awscryptographymaterialproviderssmithygeneratedtypes.CreateMultiKeyringInput{Generator: func() awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { 181 if dafnyInput.Dtor_generator().UnwrapOr(nil) == nil { 182 return nil 183 } 184 return Keyring_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IKeyring)) 185 }(), 186 ChildKeyrings: Aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(dafnyInput.Dtor_childKeyrings()), 187 } 188 189 } 190 191 func CreateRawAesKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawAesKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawAesKeyringInput { 192 193 return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawAesKeyringInput{KeyNamespace: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), 194 KeyName: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), 195 WrappingKey: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(dafnyInput.Dtor_wrappingKey()), 196 WrappingAlg: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(dafnyInput.Dtor_wrappingAlg()), 197 } 198 199 } 200 201 func CreateRawEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput { 202 203 return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput{KeyAgreementScheme: Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), 204 CurveSpec: Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), 205 } 206 207 } 208 209 func CreateRawRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput { 210 211 return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput{KeyNamespace: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), 212 KeyName: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), 213 PaddingScheme: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(dafnyInput.Dtor_paddingScheme()), 214 PublicKey: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), 215 PrivateKey: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey().UnwrapOr(nil)), 216 } 217 218 } 219 220 func CreateRequiredEncryptionContextCMMInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRequiredEncryptionContextCMMInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRequiredEncryptionContextCMMInput { 221 222 return awscryptographymaterialproviderssmithygeneratedtypes.CreateRequiredEncryptionContextCMMInput{UnderlyingCMM: func() awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { 223 if dafnyInput.Dtor_underlyingCMM().UnwrapOr(nil) == nil { 224 return nil 225 } 226 return CryptographicMaterialsManager_FromDafny(dafnyInput.Dtor_underlyingCMM().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager)) 227 }(), 228 Keyring: func() awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { 229 if dafnyInput.Dtor_keyring().UnwrapOr(nil) == nil { 230 return nil 231 } 232 return Keyring_FromDafny(dafnyInput.Dtor_keyring().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IKeyring)) 233 }(), 234 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), 235 } 236 237 } 238 239 func DecryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 240 241 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), 242 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), 243 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), 244 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), 245 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), 246 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(dafnyInput.Dtor_symmetricSigningKey().UnwrapOr(nil)), 247 } 248 249 } 250 251 func EncryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.EncryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 252 253 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), 254 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), 255 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), 256 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), 257 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), 258 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), 259 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(dafnyInput.Dtor_symmetricSigningKeys().UnwrapOr(nil)), 260 } 261 262 } 263 264 func GetAlgorithmSuiteInfoInput_FromDafny(dafnyInput dafny.Sequence) awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput { 265 266 return awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput{BinaryId: Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(dafnyInput)} 267 268 } 269 270 func AlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { 271 272 return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(dafnyOutput.Dtor_id()), 273 BinaryId: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(dafnyOutput.Dtor_binaryId()), 274 MessageVersion: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(dafnyOutput.Dtor_messageVersion()), 275 Encrypt: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(dafnyOutput.Dtor_encrypt()), 276 Kdf: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(dafnyOutput.Dtor_kdf()), 277 Commitment: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(dafnyOutput.Dtor_commitment()), 278 Signature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(dafnyOutput.Dtor_signature()), 279 SymmetricSignature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(dafnyOutput.Dtor_symmetricSignature()), 280 EdkWrapping: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(dafnyOutput.Dtor_edkWrapping()), 281 } 282 283 } 284 285 func InitializeDecryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeDecryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeDecryptionMaterialsInput { 286 287 return awscryptographymaterialproviderssmithygeneratedtypes.InitializeDecryptionMaterialsInput{AlgorithmSuiteId: Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), 288 EncryptionContext: Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), 289 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), 290 } 291 292 } 293 294 func InitializeEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput { 295 296 return awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput{AlgorithmSuiteId: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), 297 EncryptionContext: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), 298 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), 299 SigningKey: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), 300 VerificationKey: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), 301 } 302 303 } 304 305 func ValidateCommitmentPolicyOnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput { 306 307 return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput{Algorithm: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), 308 CommitmentPolicy: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), 309 } 310 311 } 312 313 func ValidateCommitmentPolicyOnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput { 314 315 return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput{Algorithm: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), 316 CommitmentPolicy: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), 317 } 318 319 } 320 321 func ValidDecryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput { 322 323 return awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput{Start: Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), 324 Stop: Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), 325 } 326 327 } 328 329 func ValidEncryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput { 330 331 return awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput{Start: Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), 332 Stop: Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), 333 } 334 335 } 336 337 func GetBranchKeyIdInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetBranchKeyIdInput) awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdInput { 338 339 return awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdInput{EncryptionContext: Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext())} 340 341 } 342 343 func GetBranchKeyIdOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetBranchKeyIdOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdOutput { 344 345 return awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdOutput{BranchKeyId: Aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(dafnyOutput.Dtor_branchKeyId())} 346 347 } 348 349 func BranchKeyIdSupplier_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier) awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { 350 val, ok := dafnyResource.(*BranchKeyIdSupplierNativeWrapper) 351 if ok { 352 return val.Impl 353 } 354 355 return &BranchKeyIdSupplier{dafnyResource} 356 } 357 358 func GetClientInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetClientInput) awscryptographymaterialproviderssmithygeneratedtypes.GetClientInput { 359 360 return awscryptographymaterialproviderssmithygeneratedtypes.GetClientInput{Region: Aws_cryptography_materialProviders_GetClientInput_region_FromDafny(dafnyInput.Dtor_region())} 361 362 } 363 364 func ClientSupplier_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IClientSupplier) awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { 365 val, ok := dafnyResource.(*ClientSupplierNativeWrapper) 366 if ok { 367 return val.Impl 368 } 369 370 return &ClientSupplier{dafnyResource} 371 } 372 373 func DeleteCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput { 374 375 return awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput{Identifier: Aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier())} 376 377 } 378 379 func GetCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput { 380 381 return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput{Identifier: Aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), 382 BytesUsed: Aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), 383 } 384 385 } 386 387 func GetCacheEntryOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput { 388 389 return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput{Materials: Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(dafnyOutput.Dtor_materials()), 390 CreationTime: Aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(dafnyOutput.Dtor_creationTime()), 391 ExpiryTime: Aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(dafnyOutput.Dtor_expiryTime()), 392 MessagesUsed: Aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(dafnyOutput.Dtor_messagesUsed()), 393 BytesUsed: Aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(dafnyOutput.Dtor_bytesUsed()), 394 } 395 396 } 397 398 func PutCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.PutCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.PutCacheEntryInput { 399 400 return awscryptographymaterialproviderssmithygeneratedtypes.PutCacheEntryInput{Identifier: Aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), 401 Materials: Aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(dafnyInput.Dtor_materials()), 402 CreationTime: Aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(dafnyInput.Dtor_creationTime()), 403 ExpiryTime: Aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(dafnyInput.Dtor_expiryTime()), 404 MessagesUsed: Aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(dafnyInput.Dtor_messagesUsed().UnwrapOr(nil)), 405 BytesUsed: Aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), 406 } 407 408 } 409 410 func UpdateUsageMetadataInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput { 411 412 return awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput{Identifier: Aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), 413 BytesUsed: Aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed()), 414 } 415 416 } 417 418 func CryptographicMaterialsCache_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache { 419 val, ok := dafnyResource.(*CryptographicMaterialsCacheNativeWrapper) 420 if ok { 421 return val.Impl 422 } 423 424 return &CryptographicMaterialsCache{dafnyResource} 425 } 426 427 func DecryptMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput { 428 429 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput{AlgorithmSuiteId: Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), 430 CommitmentPolicy: Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), 431 EncryptedDataKeys: Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), 432 EncryptionContext: Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), 433 ReproducedEncryptionContext: Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(dafnyInput.Dtor_reproducedEncryptionContext().UnwrapOr(nil)), 434 } 435 436 } 437 438 func DecryptMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput { 439 440 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput{DecryptionMaterials: Aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(dafnyOutput.Dtor_decryptionMaterials())} 441 442 } 443 444 func GetEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput { 445 446 return awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput{EncryptionContext: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), 447 CommitmentPolicy: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), 448 AlgorithmSuiteId: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId().UnwrapOr(nil)), 449 MaxPlaintextLength: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(dafnyInput.Dtor_maxPlaintextLength().UnwrapOr(nil)), 450 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys().UnwrapOr(nil)), 451 } 452 453 } 454 455 func GetEncryptionMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsOutput { 456 457 return awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsOutput{EncryptionMaterials: Aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(dafnyOutput.Dtor_encryptionMaterials())} 458 459 } 460 461 func CryptographicMaterialsManager_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { 462 val, ok := dafnyResource.(*CryptographicMaterialsManagerNativeWrapper) 463 if ok { 464 return val.Impl 465 } 466 467 return &CryptographicMaterialsManager{dafnyResource} 468 } 469 470 func OnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput { 471 472 return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput{Materials: Aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(dafnyInput.Dtor_materials()), 473 EncryptedDataKeys: Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), 474 } 475 476 } 477 478 func OnDecryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnDecryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput { 479 480 return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput{Materials: Aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} 481 482 } 483 484 func OnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput { 485 486 return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput{Materials: Aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(dafnyInput.Dtor_materials())} 487 488 } 489 490 func OnEncryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnEncryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput { 491 492 return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput{Materials: Aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} 493 494 } 495 496 func Keyring_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IKeyring) awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { 497 val, ok := dafnyResource.(*KeyringNativeWrapper) 498 if ok { 499 return val.Impl 500 } 501 502 return &Keyring{dafnyResource} 503 } 504 505 func AwsCryptographicMaterialProvidersException_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException { 506 return awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException{Message: Aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(dafnyOutput.Dtor_message())} 507 508 } 509 510 func EntryAlreadyExists_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists { 511 return awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists{Message: Aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(dafnyOutput.Dtor_message())} 512 513 } 514 515 func EntryDoesNotExist_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist { 516 return awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist{Message: Aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(dafnyOutput.Dtor_message())} 517 518 } 519 520 func InFlightTTLExceeded_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded { 521 return awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded{Message: Aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(dafnyOutput.Dtor_message())} 522 523 } 524 525 func InvalidAlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo { 526 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo{Message: Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(dafnyOutput.Dtor_message())} 527 528 } 529 530 func InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt { 531 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt{Message: Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(dafnyOutput.Dtor_message())} 532 533 } 534 535 func InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt { 536 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt{Message: Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(dafnyOutput.Dtor_message())} 537 538 } 539 540 func InvalidDecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials { 541 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials{Message: Aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} 542 543 } 544 545 func InvalidDecryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition { 546 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition{Message: Aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} 547 548 } 549 550 func InvalidEncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials { 551 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials{Message: Aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} 552 553 } 554 555 func InvalidEncryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition { 556 return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition{Message: Aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} 557 558 } 559 560 func CollectionOfErrors_Output_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.CollectionOfErrors { 561 listOfErrors := dafnyOutput.Dtor_list() 562 message := dafnyOutput.Dtor_message() 563 t := awscryptographymaterialproviderssmithygeneratedtypes.CollectionOfErrors{} 564 for i := dafny.Iterate(listOfErrors); ; { 565 val, ok := i() 566 if !ok { 567 break 568 } 569 err := val.(AwsCryptographyMaterialProvidersTypes.Error) 570 t.ListOfErrors = append(t.ListOfErrors, Error_FromDafny(err)) 571 572 } 573 t.Message = func() string { 574 a := UTF8.Encode(message.(dafny.Sequence)).Dtor_value() 575 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 576 return s 577 }() 578 return t 579 } 580 func OpaqueError_Output_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.OpaqueError { 581 return awscryptographymaterialproviderssmithygeneratedtypes.OpaqueError{ 582 ErrObject: dafnyOutput.Dtor_obj(), 583 } 584 } 585 586 func Error_FromDafny(err AwsCryptographyMaterialProvidersTypes.Error) error { 587 // Service Errors 588 if err.Is_AwsCryptographicMaterialProvidersException() { 589 return AwsCryptographicMaterialProvidersException_FromDafny(err) 590 } 591 592 if err.Is_EntryAlreadyExists() { 593 return EntryAlreadyExists_FromDafny(err) 594 } 595 596 if err.Is_EntryDoesNotExist() { 597 return EntryDoesNotExist_FromDafny(err) 598 } 599 600 if err.Is_InFlightTTLExceeded() { 601 return InFlightTTLExceeded_FromDafny(err) 602 } 603 604 if err.Is_InvalidAlgorithmSuiteInfo() { 605 return InvalidAlgorithmSuiteInfo_FromDafny(err) 606 } 607 608 if err.Is_InvalidAlgorithmSuiteInfoOnDecrypt() { 609 return InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(err) 610 } 611 612 if err.Is_InvalidAlgorithmSuiteInfoOnEncrypt() { 613 return InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(err) 614 } 615 616 if err.Is_InvalidDecryptionMaterials() { 617 return InvalidDecryptionMaterials_FromDafny(err) 618 } 619 620 if err.Is_InvalidDecryptionMaterialsTransition() { 621 return InvalidDecryptionMaterialsTransition_FromDafny(err) 622 } 623 624 if err.Is_InvalidEncryptionMaterials() { 625 return InvalidEncryptionMaterials_FromDafny(err) 626 } 627 628 if err.Is_InvalidEncryptionMaterialsTransition() { 629 return InvalidEncryptionMaterialsTransition_FromDafny(err) 630 } 631 632 //DependentErrors 633 if err.Is_AwsCryptographyPrimitives() { 634 return awscryptographyprimitivessmithygenerated.Error_FromDafny(err.Dtor_AwsCryptographyPrimitives()) 635 } 636 637 if err.Is_ComAmazonawsDynamodb() { 638 return comamazonawsdynamodbsmithygenerated.Error_FromDafny(err.Dtor_ComAmazonawsDynamodb()) 639 } 640 641 if err.Is_ComAmazonawsKms() { 642 return comamazonawskmssmithygenerated.Error_FromDafny(err.Dtor_ComAmazonawsKms()) 643 } 644 645 if err.Is_AwsCryptographyKeyStore() { 646 return awscryptographykeystoresmithygenerated.Error_FromDafny(err.Dtor_AwsCryptographyKeyStore()) 647 } 648 649 //Unmodelled Errors 650 if err.Is_CollectionOfErrors() { 651 return CollectionOfErrors_Output_FromDafny(err) 652 } 653 654 return OpaqueError_Output_FromDafny(err) 655 } 656 657 func MaterialProvidersConfig_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.MaterialProvidersConfig) awscryptographymaterialproviderssmithygeneratedtypes.MaterialProvidersConfig { 658 return awscryptographymaterialproviderssmithygeneratedtypes.MaterialProvidersConfig{} 659 660 } 661 662 func Materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { 663 var union awscryptographymaterialproviderssmithygeneratedtypes.Materials 664 665 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { 666 667 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ 668 Value: (Aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), 669 } 670 } 671 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { 672 673 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ 674 Value: (Aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), 675 } 676 } 677 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { 678 679 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ 680 Value: (Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), 681 } 682 } 683 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { 684 685 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ 686 Value: (Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), 687 } 688 } 689 690 return union 691 692 } 693 694 func StaticConfigurations_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations { 695 var union awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations 696 697 if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_AWS__KMS__ECDH() { 698 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_AWS__KMS__ECDH()) 699 union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberAWS_KMS_ECDH{ 700 Value: (Aws_cryptography_materialProviders_StaticConfigurations_AWS_KMS_ECDH_FromDafny(dataSource.UnwrapOr(nil))), 701 } 702 } 703 if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_RAW__ECDH() { 704 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_RAW__ECDH()) 705 union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberRAW_ECDH{ 706 Value: (Aws_cryptography_materialProviders_StaticConfigurations_RAW_ECDH_FromDafny(dataSource.UnwrapOr(nil))), 707 } 708 } 709 710 return union 711 712 } 713 714 func KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KeyAgreementScheme { 715 var union awscryptographymaterialproviderssmithygeneratedtypes.KeyAgreementScheme 716 717 if (input.(AwsCryptographyMaterialProvidersTypes.KeyAgreementScheme)).Is_StaticConfiguration() { 718 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.KeyAgreementScheme)).Dtor_StaticConfiguration()) 719 union = &awscryptographymaterialproviderssmithygeneratedtypes.KeyAgreementSchemeMemberStaticConfiguration{ 720 Value: (Aws_cryptography_materialProviders_KeyAgreementScheme_StaticConfiguration_FromDafny(dataSource.UnwrapOr(nil))), 721 } 722 } 723 724 return union 725 726 } 727 728 func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { 729 shim, ok := input.(*KMSwrapped.Shim) 730 if !ok { 731 panic("Not able to convert client to native") 732 } 733 return shim.Client 734 735 } 736 func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { 737 if input == nil { 738 return nil 739 } 740 return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), 741 Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), 742 } 743 } 744 func Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { 745 fieldValue := make([]string, 0) 746 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 747 val, ok := i() 748 if !ok { 749 break 750 } 751 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) 752 } 753 return fieldValue 754 } 755 func Aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { 756 return func() string { 757 758 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 759 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 760 761 return s 762 }() 763 } 764 func Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { 765 return func() string { 766 767 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 768 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 769 770 return s 771 }() 772 } 773 func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { 774 if input == nil { 775 return nil 776 } 777 fieldValue := make([]string, 0) 778 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 779 val, ok := i() 780 if !ok { 781 break 782 } 783 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 784 } 785 return fieldValue 786 } 787 func Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(input interface{}) string { 788 return func() string { 789 790 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 791 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 792 793 return s 794 }() 795 } 796 func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { 797 fieldValue := make([]string, 0) 798 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 799 val, ok := i() 800 if !ok { 801 break 802 } 803 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) 804 } 805 return fieldValue 806 } 807 func Aws_cryptography_materialProviders_RegionList_member_FromDafny(input interface{}) string { 808 return func() string { 809 810 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 811 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 812 813 return s 814 }() 815 } 816 func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { 817 if input == nil { 818 return nil 819 } 820 return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), 821 Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), 822 } 823 } 824 func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { 825 if input == nil { 826 return nil 827 } 828 fieldValue := make([]string, 0) 829 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 830 val, ok := i() 831 if !ok { 832 break 833 } 834 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 835 } 836 return fieldValue 837 } 838 func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { 839 var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations 840 841 if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { 842 843 union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ 844 Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), 845 } 846 } 847 if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { 848 849 union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ 850 Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), 851 } 852 } 853 854 return union 855 856 } 857 func Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput { 858 return awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput{RecipientKmsIdentifier: Aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput).Dtor_recipientKmsIdentifier())} 859 } 860 func Aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input interface{}) string { 861 return func() string { 862 863 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 864 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 865 866 return s 867 }() 868 } 869 func Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput { 870 return awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput{SenderKmsIdentifier: Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderKmsIdentifier()), 871 SenderPublicKey: Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderPublicKey().UnwrapOr(nil)), 872 RecipientPublicKey: Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), 873 } 874 } 875 func Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input interface{}) string { 876 return func() string { 877 878 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 879 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 880 881 return s 882 }() 883 } 884 func Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input interface{}) []byte { 885 return func() []byte { 886 b := []byte{} 887 if input == nil { 888 return nil 889 } 890 for i := dafny.Iterate(input); ; { 891 val, ok := i() 892 if !ok { 893 return b 894 } else { 895 b = append(b, val.(byte)) 896 } 897 } 898 }() 899 } 900 func Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { 901 return func() []byte { 902 b := []byte{} 903 if input == nil { 904 return nil 905 } 906 for i := dafny.Iterate(input); ; { 907 val, ok := i() 908 if !ok { 909 return b 910 } else { 911 b = append(b, val.(byte)) 912 } 913 } 914 }() 915 } 916 func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { 917 return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { 918 var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec 919 inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) 920 index := -1 921 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { 922 enum, ok := allEnums() 923 if ok { 924 index++ 925 if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { 926 break 927 } 928 } 929 } 930 931 return u.Values()[index] 932 }() 933 } 934 func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { 935 shim, ok := input.(*KMSwrapped.Shim) 936 if !ok { 937 panic("Not able to convert client to native") 938 } 939 return shim.Client 940 941 } 942 func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(input interface{}) []string { 943 if input == nil { 944 return nil 945 } 946 fieldValue := make([]string, 0) 947 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 948 val, ok := i() 949 if !ok { 950 break 951 } 952 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 953 } 954 return fieldValue 955 } 956 func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(input interface{}) *string { 957 return func() *string { 958 if input == nil { 959 return nil 960 } 961 962 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 963 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 964 965 return &s 966 }() 967 } 968 func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(input interface{}) *awscryptographykeystoresmithygenerated.Client { 969 value, ok := input.(AwsCryptographyKeyStoreTypes.IKeyStoreClient) 970 if !ok { 971 panic("invalid type found.") 972 } 973 return &awscryptographykeystoresmithygenerated.Client{value} 974 975 } 976 func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(input interface{}) int64 { 977 return func() int64 { 978 var b = input.(int64) 979 return b 980 }() 981 982 } 983 func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { 984 var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType 985 if input == nil { 986 return nil 987 } 988 989 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { 990 991 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ 992 Value: (Aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), 993 } 994 } 995 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { 996 997 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ 998 Value: (Aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), 999 } 1000 } 1001 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { 1002 1003 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ 1004 Value: (Aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), 1005 } 1006 } 1007 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { 1008 1009 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ 1010 Value: (Aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), 1011 } 1012 } 1013 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { 1014 1015 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ 1016 Value: (Aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), 1017 } 1018 } 1019 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { 1020 1021 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ 1022 Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), 1023 } 1024 } 1025 1026 return union 1027 1028 } 1029 func Aws_cryptography_materialProviders_CacheType_Default_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache { 1030 return awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache{EntryCapacity: Aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DefaultCache).Dtor_entryCapacity())} 1031 } 1032 func Aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input interface{}) int32 { 1033 return func() int32 { 1034 var b = input.(int32) 1035 return b 1036 }() 1037 } 1038 func Aws_cryptography_materialProviders_CacheType_No_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.NoCache { 1039 return awscryptographymaterialproviderssmithygeneratedtypes.NoCache{} 1040 } 1041 func Aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache { 1042 return awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache{EntryCapacity: Aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryCapacity()), 1043 EntryPruningTailSize: Aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), 1044 } 1045 } 1046 func Aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { 1047 return func() int32 { 1048 var b = input.(int32) 1049 return b 1050 }() 1051 } 1052 func Aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { 1053 return func() *int32 { 1054 var b int32 1055 if input == nil { 1056 return nil 1057 } 1058 b = input.(int32) 1059 return &b 1060 }() 1061 } 1062 func Aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache { 1063 return awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache{EntryCapacity: Aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryCapacity()), 1064 EntryPruningTailSize: Aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), 1065 } 1066 } 1067 func Aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { 1068 return func() int32 { 1069 var b = input.(int32) 1070 return b 1071 }() 1072 } 1073 func Aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { 1074 return func() *int32 { 1075 var b int32 1076 if input == nil { 1077 return nil 1078 } 1079 b = input.(int32) 1080 return &b 1081 }() 1082 } 1083 func Aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache { 1084 return awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache{EntryCapacity: Aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryCapacity()), 1085 EntryPruningTailSize: Aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), 1086 GracePeriod: Aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_gracePeriod()), 1087 GraceInterval: Aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_graceInterval()), 1088 FanOut: Aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_fanOut()), 1089 InFlightTTL: Aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_inFlightTTL()), 1090 SleepMilli: Aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_sleepMilli()), 1091 TimeUnits: Aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_timeUnits().UnwrapOr(nil)), 1092 } 1093 } 1094 func Aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input interface{}) int32 { 1095 return func() int32 { 1096 var b = input.(int32) 1097 return b 1098 }() 1099 } 1100 func Aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { 1101 return func() *int32 { 1102 var b int32 1103 if input == nil { 1104 return nil 1105 } 1106 b = input.(int32) 1107 return &b 1108 }() 1109 } 1110 func Aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input interface{}) int32 { 1111 return func() int32 { 1112 var b = input.(int32) 1113 return b 1114 }() 1115 } 1116 func Aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input interface{}) int32 { 1117 return func() int32 { 1118 var b = input.(int32) 1119 return b 1120 }() 1121 } 1122 func Aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input interface{}) int32 { 1123 return func() int32 { 1124 var b = input.(int32) 1125 return b 1126 }() 1127 } 1128 func Aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input interface{}) int32 { 1129 return func() int32 { 1130 var b = input.(int32) 1131 return b 1132 }() 1133 } 1134 func Aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input interface{}) int32 { 1135 return func() int32 { 1136 var b = input.(int32) 1137 return b 1138 }() 1139 } 1140 func Aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { 1141 return func() *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { 1142 var u awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits 1143 if input == nil { 1144 return nil 1145 } 1146 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.TimeUnits) 1147 index := -1 1148 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()); ; { 1149 enum, ok := allEnums() 1150 if ok { 1151 index++ 1152 if enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits).Equals(inputEnum) { 1153 break 1154 } 1155 } 1156 } 1157 1158 return &u.Values()[index] 1159 }() 1160 } 1161 func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(input interface{}) *string { 1162 return func() *string { 1163 if input == nil { 1164 return nil 1165 } 1166 1167 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1168 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1169 1170 return &s 1171 }() 1172 } 1173 func Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(input interface{}) string { 1174 return func() string { 1175 1176 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1177 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1178 1179 return s 1180 }() 1181 } 1182 func Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { 1183 shim, ok := input.(*KMSwrapped.Shim) 1184 if !ok { 1185 panic("Not able to convert client to native") 1186 } 1187 return shim.Client 1188 1189 } 1190 func Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1191 if input == nil { 1192 return nil 1193 } 1194 fieldValue := make([]string, 0) 1195 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1196 val, ok := i() 1197 if !ok { 1198 break 1199 } 1200 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1201 } 1202 return fieldValue 1203 } 1204 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { 1205 shim, ok := input.(*KMSwrapped.Shim) 1206 if !ok { 1207 panic("Not able to convert client to native") 1208 } 1209 return shim.Client 1210 1211 } 1212 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { 1213 if input == nil { 1214 return nil 1215 } 1216 return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), 1217 Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), 1218 } 1219 } 1220 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1221 if input == nil { 1222 return nil 1223 } 1224 fieldValue := make([]string, 0) 1225 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1226 val, ok := i() 1227 if !ok { 1228 break 1229 } 1230 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1231 } 1232 return fieldValue 1233 } 1234 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(input interface{}) string { 1235 return func() string { 1236 1237 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1238 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1239 1240 return s 1241 }() 1242 } 1243 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { 1244 fieldValue := make([]string, 0) 1245 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1246 val, ok := i() 1247 if !ok { 1248 break 1249 } 1250 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) 1251 } 1252 return fieldValue 1253 } 1254 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { 1255 if input == nil { 1256 return nil 1257 } 1258 return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), 1259 Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), 1260 } 1261 } 1262 func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1263 if input == nil { 1264 return nil 1265 } 1266 fieldValue := make([]string, 0) 1267 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1268 val, ok := i() 1269 if !ok { 1270 break 1271 } 1272 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1273 } 1274 return fieldValue 1275 } 1276 func Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(input interface{}) string { 1277 return func() string { 1278 1279 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1280 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1281 1282 return s 1283 }() 1284 } 1285 func Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { 1286 shim, ok := input.(*KMSwrapped.Shim) 1287 if !ok { 1288 panic("Not able to convert client to native") 1289 } 1290 return shim.Client 1291 1292 } 1293 func Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1294 if input == nil { 1295 return nil 1296 } 1297 fieldValue := make([]string, 0) 1298 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1299 val, ok := i() 1300 if !ok { 1301 break 1302 } 1303 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1304 } 1305 return fieldValue 1306 } 1307 func Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(input interface{}) *string { 1308 return func() *string { 1309 if input == nil { 1310 return nil 1311 } 1312 1313 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1314 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1315 1316 return &s 1317 }() 1318 } 1319 func Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { 1320 if input == nil { 1321 return nil 1322 } 1323 fieldValue := make([]string, 0) 1324 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1325 val, ok := i() 1326 if !ok { 1327 break 1328 } 1329 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) 1330 } 1331 return fieldValue 1332 } 1333 func Aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(input interface{}) string { 1334 return func() string { 1335 1336 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1337 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1338 1339 return s 1340 }() 1341 } 1342 func Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1343 if input == nil { 1344 return nil 1345 } 1346 fieldValue := make([]string, 0) 1347 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1348 val, ok := i() 1349 if !ok { 1350 break 1351 } 1352 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1353 } 1354 return fieldValue 1355 } 1356 func Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(input interface{}) *string { 1357 return func() *string { 1358 if input == nil { 1359 return nil 1360 } 1361 1362 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1363 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1364 1365 return &s 1366 }() 1367 } 1368 func Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { 1369 if input == nil { 1370 return nil 1371 } 1372 fieldValue := make([]string, 0) 1373 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1374 val, ok := i() 1375 if !ok { 1376 break 1377 } 1378 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) 1379 } 1380 return fieldValue 1381 } 1382 func Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1383 if input == nil { 1384 return nil 1385 } 1386 fieldValue := make([]string, 0) 1387 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1388 val, ok := i() 1389 if !ok { 1390 break 1391 } 1392 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1393 } 1394 return fieldValue 1395 } 1396 func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { 1397 return func() []byte { 1398 b := []byte{} 1399 if input == nil { 1400 return nil 1401 } 1402 for i := dafny.Iterate(input); ; { 1403 val, ok := i() 1404 if !ok { 1405 return b 1406 } else { 1407 b = append(b, val.(byte)) 1408 } 1409 } 1410 }() 1411 } 1412 func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(input interface{}) string { 1413 return func() string { 1414 1415 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1416 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1417 1418 return s 1419 }() 1420 } 1421 func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_FromDafny(input interface{}) kmstypes.EncryptionAlgorithmSpec { 1422 return func() kmstypes.EncryptionAlgorithmSpec { 1423 var u kmstypes.EncryptionAlgorithmSpec 1424 inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) 1425 index := -1 1426 for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { 1427 enum, ok := allEnums() 1428 if ok { 1429 index++ 1430 if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { 1431 break 1432 } 1433 } 1434 } 1435 1436 return u.Values()[index] 1437 }() 1438 } 1439 func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { 1440 shim, ok := input.(*KMSwrapped.Shim) 1441 if !ok { 1442 panic("Not able to convert client to native") 1443 } 1444 return shim.Client 1445 1446 } 1447 func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(input interface{}) []string { 1448 if input == nil { 1449 return nil 1450 } 1451 fieldValue := make([]string, 0) 1452 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1453 val, ok := i() 1454 if !ok { 1455 break 1456 } 1457 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) 1458 } 1459 return fieldValue 1460 } 1461 func Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { 1462 var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType 1463 1464 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { 1465 1466 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ 1467 Value: (Aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), 1468 } 1469 } 1470 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { 1471 1472 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ 1473 Value: (Aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), 1474 } 1475 } 1476 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { 1477 1478 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ 1479 Value: (Aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), 1480 } 1481 } 1482 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { 1483 1484 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ 1485 Value: (Aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), 1486 } 1487 } 1488 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { 1489 1490 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ 1491 Value: (Aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), 1492 } 1493 } 1494 if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { 1495 1496 union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ 1497 Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), 1498 } 1499 } 1500 1501 return union 1502 1503 } 1504 func Aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { 1505 fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.IKeyring, 0) 1506 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1507 val, ok := i() 1508 if !ok { 1509 break 1510 } 1511 fieldValue = append(fieldValue, Keyring_FromDafny(val.(AwsCryptographyMaterialProvidersTypes.IKeyring))) 1512 } 1513 return fieldValue 1514 } 1515 func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(input interface{}) string { 1516 return func() string { 1517 1518 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1519 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1520 1521 return s 1522 }() 1523 } 1524 func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(input interface{}) string { 1525 return func() string { 1526 1527 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1528 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1529 1530 return s 1531 }() 1532 } 1533 func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(input interface{}) []byte { 1534 return func() []byte { 1535 b := []byte{} 1536 if input == nil { 1537 return nil 1538 } 1539 for i := dafny.Iterate(input); ; { 1540 val, ok := i() 1541 if !ok { 1542 return b 1543 } else { 1544 b = append(b, val.(byte)) 1545 } 1546 } 1547 }() 1548 } 1549 func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { 1550 return func() awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { 1551 var u awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg 1552 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) 1553 index := -1 1554 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()); ; { 1555 enum, ok := allEnums() 1556 if ok { 1557 index++ 1558 if enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg).Equals(inputEnum) { 1559 break 1560 } 1561 } 1562 } 1563 1564 return u.Values()[index] 1565 }() 1566 } 1567 func Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { 1568 var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations 1569 1570 if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { 1571 1572 union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ 1573 Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), 1574 } 1575 } 1576 if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { 1577 1578 union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ 1579 Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), 1580 } 1581 } 1582 if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { 1583 1584 union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ 1585 Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), 1586 } 1587 } 1588 1589 return union 1590 1591 } 1592 func Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput { 1593 return awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput{RecipientStaticPrivateKey: Aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput).Dtor_recipientStaticPrivateKey())} 1594 } 1595 func Aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input interface{}) []byte { 1596 return func() []byte { 1597 b := []byte{} 1598 if input == nil { 1599 return nil 1600 } 1601 for i := dafny.Iterate(input); ; { 1602 val, ok := i() 1603 if !ok { 1604 return b 1605 } else { 1606 b = append(b, val.(byte)) 1607 } 1608 } 1609 }() 1610 } 1611 func Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput { 1612 return awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput{SenderStaticPrivateKey: Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_senderStaticPrivateKey()), 1613 RecipientPublicKey: Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), 1614 } 1615 } 1616 func Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input interface{}) []byte { 1617 return func() []byte { 1618 b := []byte{} 1619 if input == nil { 1620 return nil 1621 } 1622 for i := dafny.Iterate(input); ; { 1623 val, ok := i() 1624 if !ok { 1625 return b 1626 } else { 1627 b = append(b, val.(byte)) 1628 } 1629 } 1630 }() 1631 } 1632 func Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { 1633 return func() []byte { 1634 b := []byte{} 1635 if input == nil { 1636 return nil 1637 } 1638 for i := dafny.Iterate(input); ; { 1639 val, ok := i() 1640 if !ok { 1641 return b 1642 } else { 1643 b = append(b, val.(byte)) 1644 } 1645 } 1646 }() 1647 } 1648 func Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput { 1649 return awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput{RecipientPublicKey: Aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey())} 1650 } 1651 func Aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { 1652 return func() []byte { 1653 b := []byte{} 1654 if input == nil { 1655 return nil 1656 } 1657 for i := dafny.Iterate(input); ; { 1658 val, ok := i() 1659 if !ok { 1660 return b 1661 } else { 1662 b = append(b, val.(byte)) 1663 } 1664 } 1665 }() 1666 } 1667 func Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { 1668 return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { 1669 var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec 1670 inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) 1671 index := -1 1672 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { 1673 enum, ok := allEnums() 1674 if ok { 1675 index++ 1676 if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { 1677 break 1678 } 1679 } 1680 } 1681 1682 return u.Values()[index] 1683 }() 1684 } 1685 func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(input interface{}) string { 1686 return func() string { 1687 1688 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1689 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1690 1691 return s 1692 }() 1693 } 1694 func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(input interface{}) string { 1695 return func() string { 1696 1697 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 1698 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 1699 1700 return s 1701 }() 1702 } 1703 func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { 1704 return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { 1705 var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme 1706 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) 1707 index := -1 1708 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { 1709 enum, ok := allEnums() 1710 if ok { 1711 index++ 1712 if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { 1713 break 1714 } 1715 } 1716 } 1717 1718 return u.Values()[index] 1719 }() 1720 } 1721 func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { 1722 return func() []byte { 1723 b := []byte{} 1724 if input == nil { 1725 return nil 1726 } 1727 for i := dafny.Iterate(input); ; { 1728 val, ok := i() 1729 if !ok { 1730 return b 1731 } else { 1732 b = append(b, val.(byte)) 1733 } 1734 } 1735 }() 1736 } 1737 func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(input interface{}) []byte { 1738 return func() []byte { 1739 b := []byte{} 1740 if input == nil { 1741 return nil 1742 } 1743 for i := dafny.Iterate(input); ; { 1744 val, ok := i() 1745 if !ok { 1746 return b 1747 } else { 1748 b = append(b, val.(byte)) 1749 } 1750 } 1751 }() 1752 } 1753 func Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { 1754 fieldValue := make([]string, 0) 1755 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 1756 val, ok := i() 1757 if !ok { 1758 break 1759 } 1760 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) 1761 } 1762 return fieldValue 1763 } 1764 func Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { 1765 return func() string { 1766 1767 // UTF bytes should be always converted from bytes to string in go 1768 // Otherwise go treats the string as a unicode codepoint 1769 1770 s := string(dafny.ToByteArray(input.(dafny.Sequence))) 1771 1772 return s 1773 }() 1774 } 1775 func Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { 1776 return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), 1777 BinaryId: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), 1778 MessageVersion: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), 1779 Encrypt: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), 1780 Kdf: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), 1781 Commitment: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), 1782 Signature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), 1783 SymmetricSignature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), 1784 EdkWrapping: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), 1785 } 1786 } 1787 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 1788 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 1789 1790 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 1791 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 1792 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 1793 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 1794 } 1795 } 1796 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 1797 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 1798 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 1799 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 1800 } 1801 } 1802 1803 return union 1804 1805 } 1806 func Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { 1807 return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { 1808 var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId 1809 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId) 1810 index := -1 1811 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { 1812 enum, ok := allEnums() 1813 if ok { 1814 index++ 1815 if enum.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId).Equals(inputEnum) { 1816 break 1817 } 1818 } 1819 } 1820 1821 return u.Values()[index] 1822 }() 1823 } 1824 func Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { 1825 return func() awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { 1826 var u awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId 1827 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId) 1828 index := -1 1829 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { 1830 enum, ok := allEnums() 1831 if ok { 1832 index++ 1833 if enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId).Equals(inputEnum) { 1834 break 1835 } 1836 } 1837 } 1838 1839 return u.Values()[index] 1840 }() 1841 } 1842 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input interface{}) []byte { 1843 return func() []byte { 1844 b := []byte{} 1845 if input == nil { 1846 return nil 1847 } 1848 for i := dafny.Iterate(input); ; { 1849 val, ok := i() 1850 if !ok { 1851 return b 1852 } else { 1853 b = append(b, val.(byte)) 1854 } 1855 } 1856 }() 1857 } 1858 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input interface{}) int32 { 1859 return func() int32 { 1860 var b = input.(int32) 1861 return b 1862 }() 1863 } 1864 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { 1865 var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt 1866 1867 if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { 1868 1869 union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ 1870 Value: (Aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), 1871 } 1872 } 1873 1874 return union 1875 1876 } 1877 func Aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { 1878 return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: awscryptographyprimitivessmithygenerated.Aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), 1879 TagLength: awscryptographyprimitivessmithygenerated.Aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), 1880 IvLength: awscryptographyprimitivessmithygenerated.Aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), 1881 } 1882 } 1883 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { 1884 var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm 1885 1886 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { 1887 1888 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ 1889 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), 1890 } 1891 } 1892 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { 1893 1894 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ 1895 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), 1896 } 1897 } 1898 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { 1899 1900 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ 1901 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), 1902 } 1903 } 1904 1905 return union 1906 1907 } 1908 func Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.HKDF { 1909 return awscryptographymaterialproviderssmithygeneratedtypes.HKDF{Hmac: Aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_hmac()), 1910 SaltLength: Aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_saltLength()), 1911 InputKeyLength: Aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_inputKeyLength()), 1912 OutputKeyLength: Aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_outputKeyLength()), 1913 } 1914 } 1915 func Aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { 1916 return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { 1917 var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm 1918 inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) 1919 index := -1 1920 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { 1921 enum, ok := allEnums() 1922 if ok { 1923 index++ 1924 if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { 1925 break 1926 } 1927 } 1928 } 1929 1930 return u.Values()[index] 1931 }() 1932 } 1933 func Aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input interface{}) int32 { 1934 return func() int32 { 1935 var b = input.(int32) 1936 return b 1937 }() 1938 } 1939 func Aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input interface{}) int32 { 1940 return func() int32 { 1941 var b = input.(int32) 1942 return b 1943 }() 1944 } 1945 func Aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input interface{}) int32 { 1946 return func() int32 { 1947 var b = input.(int32) 1948 return b 1949 }() 1950 } 1951 func Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY { 1952 return awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY{} 1953 } 1954 func Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { 1955 return awscryptographymaterialproviderssmithygeneratedtypes.None{} 1956 } 1957 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { 1958 var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm 1959 1960 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { 1961 1962 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ 1963 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), 1964 } 1965 } 1966 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { 1967 1968 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ 1969 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), 1970 } 1971 } 1972 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { 1973 1974 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ 1975 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), 1976 } 1977 } 1978 1979 return union 1980 1981 } 1982 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm { 1983 var union awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm 1984 1985 if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_ECDSA() { 1986 1987 union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA{ 1988 Value: (Aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_ECDSA())), 1989 } 1990 } 1991 if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_None() { 1992 1993 union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone{ 1994 Value: (Aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_None())), 1995 } 1996 } 1997 1998 return union 1999 2000 } 2001 func Aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ECDSA { 2002 return awscryptographymaterialproviderssmithygeneratedtypes.ECDSA{Curve: Aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.ECDSA).Dtor_curve())} 2003 } 2004 func Aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { 2005 return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { 2006 var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm 2007 inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) 2008 index := -1 2009 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { 2010 enum, ok := allEnums() 2011 if ok { 2012 index++ 2013 if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { 2014 break 2015 } 2016 } 2017 } 2018 2019 return u.Values()[index] 2020 }() 2021 } 2022 func Aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { 2023 return awscryptographymaterialproviderssmithygeneratedtypes.None{} 2024 } 2025 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm { 2026 var union awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm 2027 2028 if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_HMAC() { 2029 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_HMAC()) 2030 union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC{ 2031 Value: (Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(dataSource.UnwrapOr(nil))), 2032 } 2033 } 2034 if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_None() { 2035 2036 union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone{ 2037 Value: (Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_None())), 2038 } 2039 } 2040 2041 return union 2042 2043 } 2044 func Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { 2045 return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { 2046 var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm 2047 inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) 2048 index := -1 2049 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { 2050 enum, ok := allEnums() 2051 if ok { 2052 index++ 2053 if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { 2054 break 2055 } 2056 } 2057 } 2058 2059 return u.Values()[index] 2060 }() 2061 } 2062 func Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { 2063 return awscryptographymaterialproviderssmithygeneratedtypes.None{} 2064 } 2065 func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm { 2066 var union awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm 2067 2068 if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_DIRECT__KEY__WRAPPING() { 2069 2070 union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING{ 2071 Value: (Aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_DIRECT__KEY__WRAPPING())), 2072 } 2073 } 2074 if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_IntermediateKeyWrapping() { 2075 2076 union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping{ 2077 Value: (Aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_IntermediateKeyWrapping())), 2078 } 2079 } 2080 2081 return union 2082 2083 } 2084 func Aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING { 2085 return awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING{} 2086 } 2087 func Aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping { 2088 return awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping{KeyEncryptionKeyKdf: Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_keyEncryptionKeyKdf()), 2089 MacKeyKdf: Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_macKeyKdf()), 2090 PdkEncryptAlgorithm: Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_pdkEncryptAlgorithm()), 2091 } 2092 } 2093 func Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { 2094 var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm 2095 2096 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { 2097 2098 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ 2099 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), 2100 } 2101 } 2102 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { 2103 2104 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ 2105 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), 2106 } 2107 } 2108 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { 2109 2110 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ 2111 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), 2112 } 2113 } 2114 2115 return union 2116 2117 } 2118 func Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { 2119 var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm 2120 2121 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { 2122 2123 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ 2124 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), 2125 } 2126 } 2127 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { 2128 2129 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ 2130 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), 2131 } 2132 } 2133 if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { 2134 2135 union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ 2136 Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), 2137 } 2138 } 2139 2140 return union 2141 2142 } 2143 func Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { 2144 var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt 2145 2146 if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { 2147 2148 union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ 2149 Value: (Aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), 2150 } 2151 } 2152 2153 return union 2154 2155 } 2156 func Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { 2157 var m map[string]string = make(map[string]string) 2158 if input == nil { 2159 return nil 2160 } 2161 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 2162 val, ok := i() 2163 if !ok { 2164 break 2165 } 2166 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 2167 } 2168 return m 2169 2170 } 2171 func Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny(input interface{}) string { 2172 return func() string { 2173 2174 // UTF bytes should be always converted from bytes to string in go 2175 // Otherwise go treats the string as a unicode codepoint 2176 2177 s := string(dafny.ToByteArray(input.(dafny.Sequence))) 2178 2179 return s 2180 }() 2181 } 2182 func Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input interface{}) string { 2183 return func() string { 2184 2185 // UTF bytes should be always converted from bytes to string in go 2186 // Otherwise go treats the string as a unicode codepoint 2187 2188 s := string(dafny.ToByteArray(input.(dafny.Sequence))) 2189 2190 return s 2191 }() 2192 } 2193 func Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { 2194 fieldValue := make([]string, 0) 2195 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 2196 val, ok := i() 2197 if !ok { 2198 break 2199 } 2200 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) 2201 } 2202 return fieldValue 2203 } 2204 func Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { 2205 return func() []byte { 2206 b := []byte{} 2207 if input == nil { 2208 return nil 2209 } 2210 for i := dafny.Iterate(input); ; { 2211 val, ok := i() 2212 if !ok { 2213 return b 2214 } else { 2215 b = append(b, val.(byte)) 2216 } 2217 } 2218 }() 2219 } 2220 func Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input interface{}) []byte { 2221 return func() []byte { 2222 b := []byte{} 2223 if input == nil { 2224 return nil 2225 } 2226 for i := dafny.Iterate(input); ; { 2227 val, ok := i() 2228 if !ok { 2229 return b 2230 } else { 2231 b = append(b, val.(byte)) 2232 } 2233 } 2234 }() 2235 } 2236 func Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input interface{}) []byte { 2237 return func() []byte { 2238 b := []byte{} 2239 if input == nil { 2240 return nil 2241 } 2242 for i := dafny.Iterate(input); ; { 2243 val, ok := i() 2244 if !ok { 2245 return b 2246 } else { 2247 b = append(b, val.(byte)) 2248 } 2249 } 2250 }() 2251 } 2252 func Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { 2253 return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), 2254 BinaryId: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), 2255 MessageVersion: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), 2256 Encrypt: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), 2257 Kdf: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), 2258 Commitment: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), 2259 Signature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), 2260 SymmetricSignature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), 2261 EdkWrapping: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), 2262 } 2263 } 2264 func Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { 2265 var m map[string]string = make(map[string]string) 2266 if input == nil { 2267 return nil 2268 } 2269 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 2270 val, ok := i() 2271 if !ok { 2272 break 2273 } 2274 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 2275 } 2276 return m 2277 2278 } 2279 func Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { 2280 fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) 2281 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 2282 val, ok := i() 2283 if !ok { 2284 break 2285 } 2286 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) 2287 } 2288 return fieldValue 2289 } 2290 func Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { 2291 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey{KeyProviderId: Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderId()), 2292 KeyProviderInfo: Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderInfo()), 2293 Ciphertext: Aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_ciphertext()), 2294 } 2295 } 2296 func Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input interface{}) string { 2297 return func() string { 2298 2299 // UTF bytes should be always converted from bytes to string in go 2300 // Otherwise go treats the string as a unicode codepoint 2301 2302 s := string(dafny.ToByteArray(input.(dafny.Sequence))) 2303 2304 return s 2305 }() 2306 } 2307 func Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input interface{}) []byte { 2308 return func() []byte { 2309 b := []byte{} 2310 if input == nil { 2311 return nil 2312 } 2313 for i := dafny.Iterate(input); ; { 2314 val, ok := i() 2315 if !ok { 2316 return b 2317 } else { 2318 b = append(b, val.(byte)) 2319 } 2320 } 2321 }() 2322 } 2323 func Aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input interface{}) []byte { 2324 return func() []byte { 2325 b := []byte{} 2326 if input == nil { 2327 return nil 2328 } 2329 for i := dafny.Iterate(input); ; { 2330 val, ok := i() 2331 if !ok { 2332 return b 2333 } else { 2334 b = append(b, val.(byte)) 2335 } 2336 } 2337 }() 2338 } 2339 func Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { 2340 fieldValue := make([]string, 0) 2341 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 2342 val, ok := i() 2343 if !ok { 2344 break 2345 } 2346 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) 2347 } 2348 return fieldValue 2349 } 2350 func Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { 2351 return func() []byte { 2352 b := []byte{} 2353 if input == nil { 2354 return nil 2355 } 2356 for i := dafny.Iterate(input); ; { 2357 val, ok := i() 2358 if !ok { 2359 return b 2360 } else { 2361 b = append(b, val.(byte)) 2362 } 2363 } 2364 }() 2365 } 2366 func Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input interface{}) []byte { 2367 return func() []byte { 2368 b := []byte{} 2369 if input == nil { 2370 return nil 2371 } 2372 for i := dafny.Iterate(input); ; { 2373 val, ok := i() 2374 if !ok { 2375 return b 2376 } else { 2377 b = append(b, val.(byte)) 2378 } 2379 } 2380 }() 2381 } 2382 func Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input interface{}) [][]byte { 2383 if input == nil { 2384 return nil 2385 } 2386 fieldValue := make([][]byte, 0) 2387 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 2388 val, ok := i() 2389 if !ok { 2390 break 2391 } 2392 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(val)) 2393 } 2394 return fieldValue 2395 } 2396 func Aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(input interface{}) []byte { 2397 return func() []byte { 2398 b := []byte{} 2399 if input == nil { 2400 return nil 2401 } 2402 for i := dafny.Iterate(input); ; { 2403 val, ok := i() 2404 if !ok { 2405 return b 2406 } else { 2407 b = append(b, val.(byte)) 2408 } 2409 } 2410 }() 2411 } 2412 func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(input interface{}) []byte { 2413 return func() []byte { 2414 b := []byte{} 2415 if input == nil { 2416 return nil 2417 } 2418 for i := dafny.Iterate(input); ; { 2419 val, ok := i() 2420 if !ok { 2421 return b 2422 } else { 2423 b = append(b, val.(byte)) 2424 } 2425 } 2426 }() 2427 } 2428 func Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 2429 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 2430 2431 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 2432 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 2433 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 2434 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2435 } 2436 } 2437 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 2438 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 2439 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 2440 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2441 } 2442 } 2443 2444 return union 2445 2446 } 2447 func Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { 2448 var m map[string]string = make(map[string]string) 2449 if input == nil { 2450 return nil 2451 } 2452 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 2453 val, ok := i() 2454 if !ok { 2455 break 2456 } 2457 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 2458 } 2459 return m 2460 2461 } 2462 func Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { 2463 fieldValue := make([]string, 0) 2464 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 2465 val, ok := i() 2466 if !ok { 2467 break 2468 } 2469 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) 2470 } 2471 return fieldValue 2472 } 2473 func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 2474 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 2475 2476 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 2477 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 2478 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 2479 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2480 } 2481 } 2482 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 2483 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 2484 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 2485 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2486 } 2487 } 2488 2489 return union 2490 2491 } 2492 func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { 2493 var m map[string]string = make(map[string]string) 2494 if input == nil { 2495 return nil 2496 } 2497 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 2498 val, ok := i() 2499 if !ok { 2500 break 2501 } 2502 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 2503 } 2504 return m 2505 2506 } 2507 func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { 2508 fieldValue := make([]string, 0) 2509 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 2510 val, ok := i() 2511 if !ok { 2512 break 2513 } 2514 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) 2515 } 2516 return fieldValue 2517 } 2518 func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(input interface{}) []byte { 2519 return func() []byte { 2520 b := []byte{} 2521 if input == nil { 2522 return nil 2523 } 2524 for i := dafny.Iterate(input); ; { 2525 val, ok := i() 2526 if !ok { 2527 return b 2528 } else { 2529 b = append(b, val.(byte)) 2530 } 2531 } 2532 }() 2533 } 2534 func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(input interface{}) []byte { 2535 return func() []byte { 2536 b := []byte{} 2537 if input == nil { 2538 return nil 2539 } 2540 for i := dafny.Iterate(input); ; { 2541 val, ok := i() 2542 if !ok { 2543 return b 2544 } else { 2545 b = append(b, val.(byte)) 2546 } 2547 } 2548 }() 2549 } 2550 func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 2551 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 2552 2553 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 2554 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 2555 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 2556 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2557 } 2558 } 2559 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 2560 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 2561 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 2562 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2563 } 2564 } 2565 2566 return union 2567 2568 } 2569 func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { 2570 var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy 2571 2572 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { 2573 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) 2574 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ 2575 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2576 } 2577 } 2578 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { 2579 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) 2580 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ 2581 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2582 } 2583 } 2584 2585 return union 2586 2587 } 2588 func Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { 2589 return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { 2590 var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy 2591 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy) 2592 index := -1 2593 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()); ; { 2594 enum, ok := allEnums() 2595 if ok { 2596 index++ 2597 if enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy).Equals(inputEnum) { 2598 break 2599 } 2600 } 2601 } 2602 2603 return u.Values()[index] 2604 }() 2605 } 2606 func Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy { 2607 return func() awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy { 2608 var u awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy 2609 inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy) 2610 index := -1 2611 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBECommitmentPolicy_{}.AllSingletonConstructors()); ; { 2612 enum, ok := allEnums() 2613 if ok { 2614 index++ 2615 if enum.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy).Equals(inputEnum) { 2616 break 2617 } 2618 } 2619 } 2620 2621 return u.Values()[index] 2622 }() 2623 } 2624 func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 2625 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 2626 2627 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 2628 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 2629 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 2630 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2631 } 2632 } 2633 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 2634 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 2635 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 2636 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2637 } 2638 } 2639 2640 return union 2641 2642 } 2643 func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { 2644 var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy 2645 2646 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { 2647 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) 2648 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ 2649 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2650 } 2651 } 2652 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { 2653 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) 2654 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ 2655 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2656 } 2657 } 2658 2659 return union 2660 2661 } 2662 func Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 2663 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), 2664 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), 2665 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), 2666 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 2667 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), 2668 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), 2669 } 2670 } 2671 func Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 2672 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), 2673 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), 2674 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), 2675 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 2676 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), 2677 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), 2678 } 2679 } 2680 func Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 2681 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), 2682 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), 2683 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), 2684 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), 2685 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 2686 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), 2687 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), 2688 } 2689 } 2690 func Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 2691 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), 2692 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), 2693 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), 2694 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), 2695 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 2696 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), 2697 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), 2698 } 2699 } 2700 func Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(input interface{}) map[string]string { 2701 var m map[string]string = make(map[string]string) 2702 if input == nil { 2703 return nil 2704 } 2705 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 2706 val, ok := i() 2707 if !ok { 2708 break 2709 } 2710 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 2711 } 2712 return m 2713 2714 } 2715 func Aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(input interface{}) string { 2716 return func() string { 2717 2718 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 2719 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 2720 2721 return s 2722 }() 2723 } 2724 func Aws_cryptography_materialProviders_GetClientInput_region_FromDafny(input interface{}) string { 2725 return func() string { 2726 2727 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 2728 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 2729 2730 return s 2731 }() 2732 } 2733 func Aws_cryptography_materialProviders_GetClientOutput_client_FromDafny(input interface{}) *kms.Client { 2734 shim, ok := input.(*KMSwrapped.Shim) 2735 if !ok { 2736 panic("Not able to convert client to native") 2737 } 2738 return shim.Client 2739 2740 } 2741 func Aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(input interface{}) []byte { 2742 return func() []byte { 2743 b := []byte{} 2744 if input == nil { 2745 return nil 2746 } 2747 for i := dafny.Iterate(input); ; { 2748 val, ok := i() 2749 if !ok { 2750 return b 2751 } else { 2752 b = append(b, val.(byte)) 2753 } 2754 } 2755 }() 2756 } 2757 func Aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(input interface{}) []byte { 2758 return func() []byte { 2759 b := []byte{} 2760 if input == nil { 2761 return nil 2762 } 2763 for i := dafny.Iterate(input); ; { 2764 val, ok := i() 2765 if !ok { 2766 return b 2767 } else { 2768 b = append(b, val.(byte)) 2769 } 2770 } 2771 }() 2772 } 2773 func Aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int64 { 2774 return func() *int64 { 2775 var b int64 2776 if input == nil { 2777 return nil 2778 } 2779 b = input.(int64) 2780 return &b 2781 }() 2782 } 2783 func Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { 2784 var union awscryptographymaterialproviderssmithygeneratedtypes.Materials 2785 2786 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { 2787 2788 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ 2789 Value: (Aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), 2790 } 2791 } 2792 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { 2793 2794 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ 2795 Value: (Aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), 2796 } 2797 } 2798 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { 2799 2800 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ 2801 Value: (Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), 2802 } 2803 } 2804 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { 2805 2806 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ 2807 Value: (Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), 2808 } 2809 } 2810 2811 return union 2812 2813 } 2814 func Aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 2815 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), 2816 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), 2817 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), 2818 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), 2819 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 2820 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), 2821 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), 2822 } 2823 } 2824 func Aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 2825 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), 2826 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), 2827 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), 2828 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 2829 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), 2830 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), 2831 } 2832 } 2833 func Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { 2834 return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), 2835 BranchKeyVersion: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), 2836 EncryptionContext: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), 2837 BranchKey: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), 2838 } 2839 } 2840 func Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { 2841 return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), 2842 EncryptionContext: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), 2843 BeaconKey: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), 2844 HmacKeys: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), 2845 } 2846 } 2847 func Aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(input interface{}) int64 { 2848 return func() int64 { 2849 var b = input.(int64) 2850 return b 2851 }() 2852 2853 } 2854 func Aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(input interface{}) int64 { 2855 return func() int64 { 2856 var b = input.(int64) 2857 return b 2858 }() 2859 2860 } 2861 func Aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(input interface{}) int32 { 2862 return func() int32 { 2863 var b = input.(int32) 2864 return b 2865 }() 2866 } 2867 func Aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(input interface{}) int32 { 2868 return func() int32 { 2869 var b = input.(int32) 2870 return b 2871 }() 2872 } 2873 func Aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(input interface{}) []byte { 2874 return func() []byte { 2875 b := []byte{} 2876 if input == nil { 2877 return nil 2878 } 2879 for i := dafny.Iterate(input); ; { 2880 val, ok := i() 2881 if !ok { 2882 return b 2883 } else { 2884 b = append(b, val.(byte)) 2885 } 2886 } 2887 }() 2888 } 2889 func Aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { 2890 var union awscryptographymaterialproviderssmithygeneratedtypes.Materials 2891 2892 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { 2893 2894 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ 2895 Value: (Aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), 2896 } 2897 } 2898 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { 2899 2900 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ 2901 Value: (Aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), 2902 } 2903 } 2904 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { 2905 2906 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ 2907 Value: (Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), 2908 } 2909 } 2910 if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { 2911 2912 union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ 2913 Value: (Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), 2914 } 2915 } 2916 2917 return union 2918 2919 } 2920 func Aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(input interface{}) int64 { 2921 return func() int64 { 2922 var b = input.(int64) 2923 return b 2924 }() 2925 2926 } 2927 func Aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(input interface{}) int64 { 2928 return func() int64 { 2929 var b = input.(int64) 2930 return b 2931 }() 2932 2933 } 2934 func Aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(input interface{}) *int32 { 2935 return func() *int32 { 2936 var b int32 2937 if input == nil { 2938 return nil 2939 } 2940 b = input.(int32) 2941 return &b 2942 }() 2943 } 2944 func Aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int32 { 2945 return func() *int32 { 2946 var b int32 2947 if input == nil { 2948 return nil 2949 } 2950 b = input.(int32) 2951 return &b 2952 }() 2953 } 2954 func Aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(input interface{}) []byte { 2955 return func() []byte { 2956 b := []byte{} 2957 if input == nil { 2958 return nil 2959 } 2960 for i := dafny.Iterate(input); ; { 2961 val, ok := i() 2962 if !ok { 2963 return b 2964 } else { 2965 b = append(b, val.(byte)) 2966 } 2967 } 2968 }() 2969 } 2970 func Aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(input interface{}) int32 { 2971 return func() int32 { 2972 var b = input.(int32) 2973 return b 2974 }() 2975 } 2976 func Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 2977 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 2978 2979 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 2980 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 2981 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 2982 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 2983 } 2984 } 2985 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 2986 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 2987 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 2988 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 2989 } 2990 } 2991 2992 return union 2993 2994 } 2995 func Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { 2996 var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy 2997 2998 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { 2999 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) 3000 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ 3001 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 3002 } 3003 } 3004 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { 3005 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) 3006 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ 3007 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), 3008 } 3009 } 3010 3011 return union 3012 3013 } 3014 func Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { 3015 fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) 3016 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 3017 val, ok := i() 3018 if !ok { 3019 break 3020 } 3021 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) 3022 } 3023 return fieldValue 3024 } 3025 func Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { 3026 var m map[string]string = make(map[string]string) 3027 if input == nil { 3028 return nil 3029 } 3030 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 3031 val, ok := i() 3032 if !ok { 3033 break 3034 } 3035 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 3036 } 3037 return m 3038 3039 } 3040 func Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(input interface{}) map[string]string { 3041 var m map[string]string = make(map[string]string) 3042 if input == nil { 3043 return nil 3044 } 3045 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 3046 val, ok := i() 3047 if !ok { 3048 break 3049 } 3050 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 3051 } 3052 return m 3053 3054 } 3055 func Aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 3056 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), 3057 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), 3058 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), 3059 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 3060 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), 3061 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), 3062 } 3063 } 3064 func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { 3065 var m map[string]string = make(map[string]string) 3066 if input == nil { 3067 return nil 3068 } 3069 for i := dafny.Iterate(input.(dafny.Map).Items()); ; { 3070 val, ok := i() 3071 if !ok { 3072 break 3073 } 3074 m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) 3075 } 3076 return m 3077 3078 } 3079 func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { 3080 var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy 3081 3082 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { 3083 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) 3084 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ 3085 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 3086 } 3087 } 3088 if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { 3089 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) 3090 union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ 3091 Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), 3092 } 3093 } 3094 3095 return union 3096 3097 } 3098 func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { 3099 var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId 3100 if input == nil { 3101 return nil 3102 } 3103 3104 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { 3105 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) 3106 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ 3107 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), 3108 } 3109 } 3110 if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { 3111 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) 3112 union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ 3113 Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), 3114 } 3115 } 3116 3117 return union 3118 3119 } 3120 func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(input interface{}) *int64 { 3121 return func() *int64 { 3122 var b int64 3123 if input == nil { 3124 return nil 3125 } 3126 b = input.(int64) 3127 return &b 3128 }() 3129 } 3130 func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { 3131 if input == nil { 3132 return nil 3133 } 3134 fieldValue := make([]string, 0) 3135 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 3136 val, ok := i() 3137 if !ok { 3138 break 3139 } 3140 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) 3141 } 3142 return fieldValue 3143 } 3144 func Aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 3145 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), 3146 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), 3147 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), 3148 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), 3149 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 3150 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), 3151 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), 3152 } 3153 } 3154 func Aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 3155 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), 3156 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), 3157 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), 3158 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 3159 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), 3160 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), 3161 } 3162 } 3163 func Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { 3164 fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) 3165 for i := dafny.Iterate(input.(dafny.Sequence)); ; { 3166 val, ok := i() 3167 if !ok { 3168 break 3169 } 3170 fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) 3171 } 3172 return fieldValue 3173 } 3174 func Aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { 3175 return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), 3176 EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), 3177 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), 3178 PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 3179 VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), 3180 SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), 3181 } 3182 } 3183 func Aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 3184 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), 3185 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), 3186 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), 3187 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), 3188 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 3189 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), 3190 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), 3191 } 3192 } 3193 func Aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { 3194 return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), 3195 EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), 3196 EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), 3197 RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), 3198 PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), 3199 SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), 3200 SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), 3201 } 3202 } 3203 func Aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(input interface{}) string { 3204 return func() string { 3205 3206 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3207 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3208 3209 return s 3210 }() 3211 } 3212 func Aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(input interface{}) string { 3213 return func() string { 3214 3215 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3216 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3217 3218 return s 3219 }() 3220 } 3221 func Aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(input interface{}) string { 3222 return func() string { 3223 3224 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3225 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3226 3227 return s 3228 }() 3229 } 3230 func Aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(input interface{}) string { 3231 return func() string { 3232 3233 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3234 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3235 3236 return s 3237 }() 3238 } 3239 func Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(input interface{}) string { 3240 return func() string { 3241 3242 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3243 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3244 3245 return s 3246 }() 3247 } 3248 func Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(input interface{}) string { 3249 return func() string { 3250 3251 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3252 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3253 3254 return s 3255 }() 3256 } 3257 func Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(input interface{}) string { 3258 return func() string { 3259 3260 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3261 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3262 3263 return s 3264 }() 3265 } 3266 func Aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(input interface{}) string { 3267 return func() string { 3268 3269 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3270 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3271 3272 return s 3273 }() 3274 } 3275 func Aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(input interface{}) string { 3276 return func() string { 3277 3278 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3279 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3280 3281 return s 3282 }() 3283 } 3284 func Aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(input interface{}) string { 3285 return func() string { 3286 3287 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3288 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3289 3290 return s 3291 }() 3292 } 3293 func Aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(input interface{}) string { 3294 return func() string { 3295 3296 a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() 3297 s := string(dafny.ToByteArray(a.(dafny.Sequence))) 3298 3299 return s 3300 }() 3301 } 3302 func Aws_cryptography_materialProviders_StaticConfigurations_AWS_KMS_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { 3303 var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations 3304 3305 if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { 3306 3307 union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ 3308 Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), 3309 } 3310 } 3311 if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { 3312 3313 union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ 3314 Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), 3315 } 3316 } 3317 3318 return union 3319 3320 } 3321 func Aws_cryptography_materialProviders_StaticConfigurations_RAW_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { 3322 var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations 3323 3324 if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { 3325 3326 union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ 3327 Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), 3328 } 3329 } 3330 if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { 3331 3332 union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ 3333 Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), 3334 } 3335 } 3336 if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { 3337 3338 union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ 3339 Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), 3340 } 3341 } 3342 3343 return union 3344 3345 } 3346 func Aws_cryptography_materialProviders_KeyAgreementScheme_StaticConfiguration_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations { 3347 var union awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations 3348 3349 if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_AWS__KMS__ECDH() { 3350 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_AWS__KMS__ECDH()) 3351 union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberAWS_KMS_ECDH{ 3352 Value: (Aws_cryptography_materialProviders_StaticConfigurations_AWS_KMS_ECDH_FromDafny(dataSource.UnwrapOr(nil))), 3353 } 3354 } 3355 if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_RAW__ECDH() { 3356 var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_RAW__ECDH()) 3357 union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberRAW_ECDH{ 3358 Value: (Aws_cryptography_materialProviders_StaticConfigurations_RAW_ECDH_FromDafny(dataSource.UnwrapOr(nil))), 3359 } 3360 } 3361 3362 return union 3363 3364 }