AwsCryptographicMaterialProviders/runtimes/go/ImplementationFromDafny-go/awscryptographymaterialproviderssmithygenerated/to_native.go (2,821 lines of code) (raw):

// Code generated by smithy-go-codegen DO NOT EDIT. package awscryptographymaterialproviderssmithygenerated import ( "github.com/aws/aws-cryptographic-material-providers-library/releases/go/dynamodb/comamazonawsdynamodbsmithygenerated" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/kms/ComAmazonawsKmsTypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/kms/KMSwrapped" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/kms/comamazonawskmssmithygenerated" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/AwsCryptographyKeyStoreTypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/AwsCryptographyMaterialProvidersTypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographykeystoresmithygenerated" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographykeystoresmithygeneratedtypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographymaterialproviderssmithygeneratedtypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/AwsCryptographyPrimitivesTypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/awscryptographyprimitivessmithygenerated" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/primitives/awscryptographyprimitivessmithygeneratedtypes" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/UTF8" "github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers" "github.com/aws/aws-sdk-go-v2/service/kms" kmstypes "github.com/aws/aws-sdk-go-v2/service/kms/types" "github.com/dafny-lang/DafnyRuntimeGo/v4/dafny" ) func CreateAwsKmsDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryKeyringInput{KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsDiscoveryMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsDiscoveryMultiKeyringInput{Regions: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(dafnyInput.Dtor_regions()), DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { return nil } return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) }(), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), CurveSpec: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsHierarchicalKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsHierarchicalKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsHierarchicalKeyringInput{BranchKeyId: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(dafnyInput.Dtor_branchKeyId().UnwrapOr(nil)), BranchKeyIdSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { if dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil) == nil { return nil } return BranchKeyIdSupplier_FromDafny(dafnyInput.Dtor_branchKeyIdSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier)) }(), KeyStore: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(dafnyInput.Dtor_keyStore()), TtlSeconds: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(dafnyInput.Dtor_ttlSeconds()), Cache: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(dafnyInput.Dtor_cache().UnwrapOr(nil)), PartitionId: Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(dafnyInput.Dtor_partitionId().UnwrapOr(nil)), } } func CreateAwsKmsKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsKeyringInput{KmsKeyId: Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsMrkDiscoveryKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkDiscoveryKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryKeyringInput{KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), Region: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(dafnyInput.Dtor_region()), } } func CreateAwsKmsMrkDiscoveryMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkDiscoveryMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkDiscoveryMultiKeyringInput{Regions: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(dafnyInput.Dtor_regions()), DiscoveryFilter: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(dafnyInput.Dtor_discoveryFilter().UnwrapOr(nil)), ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { return nil } return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) }(), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsMrkKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkKeyringInput{KmsKeyId: Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient()), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsMrkMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMrkMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMrkMultiKeyringInput{Generator: Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), KmsKeyIds: Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { return nil } return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) }(), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsMultiKeyringInput{Generator: Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil)), KmsKeyIds: Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(dafnyInput.Dtor_kmsKeyIds().UnwrapOr(nil)), ClientSupplier: func() awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { if dafnyInput.Dtor_clientSupplier().UnwrapOr(nil) == nil { return nil } return ClientSupplier_FromDafny(dafnyInput.Dtor_clientSupplier().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IClientSupplier)) }(), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateAwsKmsRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateAwsKmsRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsRsaKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateAwsKmsRsaKeyringInput{PublicKey: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), KmsKeyId: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(dafnyInput.Dtor_kmsKeyId()), EncryptionAlgorithm: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_FromDafny(dafnyInput.Dtor_encryptionAlgorithm()), KmsClient: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(dafnyInput.Dtor_kmsClient().UnwrapOr(nil)), GrantTokens: Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(dafnyInput.Dtor_grantTokens().UnwrapOr(nil)), } } func CreateCryptographicMaterialsCacheInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateCryptographicMaterialsCacheInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateCryptographicMaterialsCacheInput{Cache: Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(dafnyInput.Dtor_cache())} } func CreateDefaultClientSupplierInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultClientSupplierInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultClientSupplierInput{} } func CreateDefaultCryptographicMaterialsManagerInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateDefaultCryptographicMaterialsManagerInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateDefaultCryptographicMaterialsManagerInput{Keyring: Keyring_FromDafny(dafnyInput.Dtor_keyring())} } func CreateMultiKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateMultiKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateMultiKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateMultiKeyringInput{Generator: func() awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { if dafnyInput.Dtor_generator().UnwrapOr(nil) == nil { return nil } return Keyring_FromDafny(dafnyInput.Dtor_generator().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IKeyring)) }(), ChildKeyrings: Aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(dafnyInput.Dtor_childKeyrings()), } } func CreateRawAesKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawAesKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawAesKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawAesKeyringInput{KeyNamespace: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), KeyName: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), WrappingKey: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(dafnyInput.Dtor_wrappingKey()), WrappingAlg: Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(dafnyInput.Dtor_wrappingAlg()), } } func CreateRawEcdhKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawEcdhKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawEcdhKeyringInput{KeyAgreementScheme: Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(dafnyInput.Dtor_KeyAgreementScheme()), CurveSpec: Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(dafnyInput.Dtor_curveSpec()), } } func CreateRawRsaKeyringInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRawRsaKeyringInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateRawRsaKeyringInput{KeyNamespace: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(dafnyInput.Dtor_keyNamespace()), KeyName: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(dafnyInput.Dtor_keyName()), PaddingScheme: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(dafnyInput.Dtor_paddingScheme()), PublicKey: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(dafnyInput.Dtor_publicKey().UnwrapOr(nil)), PrivateKey: Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(dafnyInput.Dtor_privateKey().UnwrapOr(nil)), } } func CreateRequiredEncryptionContextCMMInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.CreateRequiredEncryptionContextCMMInput) awscryptographymaterialproviderssmithygeneratedtypes.CreateRequiredEncryptionContextCMMInput { return awscryptographymaterialproviderssmithygeneratedtypes.CreateRequiredEncryptionContextCMMInput{UnderlyingCMM: func() awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { if dafnyInput.Dtor_underlyingCMM().UnwrapOr(nil) == nil { return nil } return CryptographicMaterialsManager_FromDafny(dafnyInput.Dtor_underlyingCMM().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager)) }(), Keyring: func() awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { if dafnyInput.Dtor_keyring().UnwrapOr(nil) == nil { return nil } return Keyring_FromDafny(dafnyInput.Dtor_keyring().UnwrapOr(nil).(AwsCryptographyMaterialProvidersTypes.IKeyring)) }(), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), } } func DecryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(dafnyInput.Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func EncryptionMaterials_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.EncryptionMaterials) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(dafnyInput.Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(dafnyInput.Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(dafnyInput.Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func GetAlgorithmSuiteInfoInput_FromDafny(dafnyInput dafny.Sequence) awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput { return awscryptographymaterialproviderssmithygeneratedtypes.GetAlgorithmSuiteInfoInput{BinaryId: Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(dafnyInput)} } func AlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(dafnyOutput.Dtor_id()), BinaryId: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(dafnyOutput.Dtor_binaryId()), MessageVersion: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(dafnyOutput.Dtor_messageVersion()), Encrypt: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(dafnyOutput.Dtor_encrypt()), Kdf: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(dafnyOutput.Dtor_kdf()), Commitment: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(dafnyOutput.Dtor_commitment()), Signature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(dafnyOutput.Dtor_signature()), SymmetricSignature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(dafnyOutput.Dtor_symmetricSignature()), EdkWrapping: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(dafnyOutput.Dtor_edkWrapping()), } } func InitializeDecryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeDecryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeDecryptionMaterialsInput { return awscryptographymaterialproviderssmithygeneratedtypes.InitializeDecryptionMaterialsInput{AlgorithmSuiteId: Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), EncryptionContext: Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), } } func InitializeEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.InitializeEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput { return awscryptographymaterialproviderssmithygeneratedtypes.InitializeEncryptionMaterialsInput{AlgorithmSuiteId: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), EncryptionContext: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys()), SigningKey: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(dafnyInput.Dtor_signingKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(dafnyInput.Dtor_verificationKey().UnwrapOr(nil)), } } func ValidateCommitmentPolicyOnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput { return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnDecryptInput{Algorithm: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), CommitmentPolicy: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), } } func ValidateCommitmentPolicyOnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidateCommitmentPolicyOnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput { return awscryptographymaterialproviderssmithygeneratedtypes.ValidateCommitmentPolicyOnEncryptInput{Algorithm: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(dafnyInput.Dtor_algorithm()), CommitmentPolicy: Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), } } func ValidDecryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidDecryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput { return awscryptographymaterialproviderssmithygeneratedtypes.ValidDecryptionMaterialsTransitionInput{Start: Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), Stop: Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), } } func ValidEncryptionMaterialsTransitionInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.ValidEncryptionMaterialsTransitionInput) awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput { return awscryptographymaterialproviderssmithygeneratedtypes.ValidEncryptionMaterialsTransitionInput{Start: Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(dafnyInput.Dtor_start()), Stop: Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(dafnyInput.Dtor_stop()), } } func GetBranchKeyIdInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetBranchKeyIdInput) awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdInput { return awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdInput{EncryptionContext: Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext())} } func GetBranchKeyIdOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetBranchKeyIdOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdOutput { return awscryptographymaterialproviderssmithygeneratedtypes.GetBranchKeyIdOutput{BranchKeyId: Aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(dafnyOutput.Dtor_branchKeyId())} } func BranchKeyIdSupplier_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier) awscryptographymaterialproviderssmithygeneratedtypes.IBranchKeyIdSupplier { val, ok := dafnyResource.(*BranchKeyIdSupplierNativeWrapper) if ok { return val.Impl } return &BranchKeyIdSupplier{dafnyResource} } func GetClientInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetClientInput) awscryptographymaterialproviderssmithygeneratedtypes.GetClientInput { return awscryptographymaterialproviderssmithygeneratedtypes.GetClientInput{Region: Aws_cryptography_materialProviders_GetClientInput_region_FromDafny(dafnyInput.Dtor_region())} } func ClientSupplier_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IClientSupplier) awscryptographymaterialproviderssmithygeneratedtypes.IClientSupplier { val, ok := dafnyResource.(*ClientSupplierNativeWrapper) if ok { return val.Impl } return &ClientSupplier{dafnyResource} } func DeleteCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput { return awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput{Identifier: Aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier())} } func GetCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput { return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput{Identifier: Aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), BytesUsed: Aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), } } func GetCacheEntryOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput { return awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput{Materials: Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(dafnyOutput.Dtor_materials()), CreationTime: Aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(dafnyOutput.Dtor_creationTime()), ExpiryTime: Aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(dafnyOutput.Dtor_expiryTime()), MessagesUsed: Aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(dafnyOutput.Dtor_messagesUsed()), BytesUsed: Aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(dafnyOutput.Dtor_bytesUsed()), } } func PutCacheEntryInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.PutCacheEntryInput) awscryptographymaterialproviderssmithygeneratedtypes.PutCacheEntryInput { return awscryptographymaterialproviderssmithygeneratedtypes.PutCacheEntryInput{Identifier: Aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), Materials: Aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(dafnyInput.Dtor_materials()), CreationTime: Aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(dafnyInput.Dtor_creationTime()), ExpiryTime: Aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(dafnyInput.Dtor_expiryTime()), MessagesUsed: Aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(dafnyInput.Dtor_messagesUsed().UnwrapOr(nil)), BytesUsed: Aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed().UnwrapOr(nil)), } } func UpdateUsageMetadataInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput { return awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput{Identifier: Aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(dafnyInput.Dtor_identifier()), BytesUsed: Aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(dafnyInput.Dtor_bytesUsed()), } } func CryptographicMaterialsCache_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache { val, ok := dafnyResource.(*CryptographicMaterialsCacheNativeWrapper) if ok { return val.Impl } return &CryptographicMaterialsCache{dafnyResource} } func DecryptMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput{AlgorithmSuiteId: Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId()), CommitmentPolicy: Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), EncryptedDataKeys: Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), EncryptionContext: Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), ReproducedEncryptionContext: Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(dafnyInput.Dtor_reproducedEncryptionContext().UnwrapOr(nil)), } } func DecryptMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput{DecryptionMaterials: Aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(dafnyOutput.Dtor_decryptionMaterials())} } func GetEncryptionMaterialsInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput) awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput { return awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput{EncryptionContext: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(dafnyInput.Dtor_encryptionContext()), CommitmentPolicy: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(dafnyInput.Dtor_commitmentPolicy()), AlgorithmSuiteId: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(dafnyInput.Dtor_algorithmSuiteId().UnwrapOr(nil)), MaxPlaintextLength: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(dafnyInput.Dtor_maxPlaintextLength().UnwrapOr(nil)), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(dafnyInput.Dtor_requiredEncryptionContextKeys().UnwrapOr(nil)), } } func GetEncryptionMaterialsOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsOutput) awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsOutput { return awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsOutput{EncryptionMaterials: Aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(dafnyOutput.Dtor_encryptionMaterials())} } func CryptographicMaterialsManager_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager) awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsManager { val, ok := dafnyResource.(*CryptographicMaterialsManagerNativeWrapper) if ok { return val.Impl } return &CryptographicMaterialsManager{dafnyResource} } func OnDecryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnDecryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput { return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptInput{Materials: Aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(dafnyInput.Dtor_materials()), EncryptedDataKeys: Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(dafnyInput.Dtor_encryptedDataKeys()), } } func OnDecryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnDecryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput { return awscryptographymaterialproviderssmithygeneratedtypes.OnDecryptOutput{Materials: Aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} } func OnEncryptInput_FromDafny(dafnyInput AwsCryptographyMaterialProvidersTypes.OnEncryptInput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput { return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptInput{Materials: Aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(dafnyInput.Dtor_materials())} } func OnEncryptOutput_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.OnEncryptOutput) awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput { return awscryptographymaterialproviderssmithygeneratedtypes.OnEncryptOutput{Materials: Aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(dafnyOutput.Dtor_materials())} } func Keyring_FromDafny(dafnyResource AwsCryptographyMaterialProvidersTypes.IKeyring) awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { val, ok := dafnyResource.(*KeyringNativeWrapper) if ok { return val.Impl } return &Keyring{dafnyResource} } func AwsCryptographicMaterialProvidersException_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException { return awscryptographymaterialproviderssmithygeneratedtypes.AwsCryptographicMaterialProvidersException{Message: Aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(dafnyOutput.Dtor_message())} } func EntryAlreadyExists_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists { return awscryptographymaterialproviderssmithygeneratedtypes.EntryAlreadyExists{Message: Aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(dafnyOutput.Dtor_message())} } func EntryDoesNotExist_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist { return awscryptographymaterialproviderssmithygeneratedtypes.EntryDoesNotExist{Message: Aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(dafnyOutput.Dtor_message())} } func InFlightTTLExceeded_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded { return awscryptographymaterialproviderssmithygeneratedtypes.InFlightTTLExceeded{Message: Aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidAlgorithmSuiteInfo_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfo{Message: Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnDecrypt{Message: Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidAlgorithmSuiteInfoOnEncrypt{Message: Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidDecryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterials{Message: Aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidDecryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidDecryptionMaterialsTransition{Message: Aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidEncryptionMaterials_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterials{Message: Aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(dafnyOutput.Dtor_message())} } func InvalidEncryptionMaterialsTransition_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition { return awscryptographymaterialproviderssmithygeneratedtypes.InvalidEncryptionMaterialsTransition{Message: Aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(dafnyOutput.Dtor_message())} } func CollectionOfErrors_Output_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.CollectionOfErrors { listOfErrors := dafnyOutput.Dtor_list() message := dafnyOutput.Dtor_message() t := awscryptographymaterialproviderssmithygeneratedtypes.CollectionOfErrors{} for i := dafny.Iterate(listOfErrors); ; { val, ok := i() if !ok { break } err := val.(AwsCryptographyMaterialProvidersTypes.Error) t.ListOfErrors = append(t.ListOfErrors, Error_FromDafny(err)) } t.Message = func() string { a := UTF8.Encode(message.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() return t } func OpaqueError_Output_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.Error) awscryptographymaterialproviderssmithygeneratedtypes.OpaqueError { return awscryptographymaterialproviderssmithygeneratedtypes.OpaqueError{ ErrObject: dafnyOutput.Dtor_obj(), } } func Error_FromDafny(err AwsCryptographyMaterialProvidersTypes.Error) error { // Service Errors if err.Is_AwsCryptographicMaterialProvidersException() { return AwsCryptographicMaterialProvidersException_FromDafny(err) } if err.Is_EntryAlreadyExists() { return EntryAlreadyExists_FromDafny(err) } if err.Is_EntryDoesNotExist() { return EntryDoesNotExist_FromDafny(err) } if err.Is_InFlightTTLExceeded() { return InFlightTTLExceeded_FromDafny(err) } if err.Is_InvalidAlgorithmSuiteInfo() { return InvalidAlgorithmSuiteInfo_FromDafny(err) } if err.Is_InvalidAlgorithmSuiteInfoOnDecrypt() { return InvalidAlgorithmSuiteInfoOnDecrypt_FromDafny(err) } if err.Is_InvalidAlgorithmSuiteInfoOnEncrypt() { return InvalidAlgorithmSuiteInfoOnEncrypt_FromDafny(err) } if err.Is_InvalidDecryptionMaterials() { return InvalidDecryptionMaterials_FromDafny(err) } if err.Is_InvalidDecryptionMaterialsTransition() { return InvalidDecryptionMaterialsTransition_FromDafny(err) } if err.Is_InvalidEncryptionMaterials() { return InvalidEncryptionMaterials_FromDafny(err) } if err.Is_InvalidEncryptionMaterialsTransition() { return InvalidEncryptionMaterialsTransition_FromDafny(err) } //DependentErrors if err.Is_AwsCryptographyPrimitives() { return awscryptographyprimitivessmithygenerated.Error_FromDafny(err.Dtor_AwsCryptographyPrimitives()) } if err.Is_ComAmazonawsDynamodb() { return comamazonawsdynamodbsmithygenerated.Error_FromDafny(err.Dtor_ComAmazonawsDynamodb()) } if err.Is_ComAmazonawsKms() { return comamazonawskmssmithygenerated.Error_FromDafny(err.Dtor_ComAmazonawsKms()) } if err.Is_AwsCryptographyKeyStore() { return awscryptographykeystoresmithygenerated.Error_FromDafny(err.Dtor_AwsCryptographyKeyStore()) } //Unmodelled Errors if err.Is_CollectionOfErrors() { return CollectionOfErrors_Output_FromDafny(err) } return OpaqueError_Output_FromDafny(err) } func MaterialProvidersConfig_FromDafny(dafnyOutput AwsCryptographyMaterialProvidersTypes.MaterialProvidersConfig) awscryptographymaterialproviderssmithygeneratedtypes.MaterialProvidersConfig { return awscryptographymaterialproviderssmithygeneratedtypes.MaterialProvidersConfig{} } func Materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { var union awscryptographymaterialproviderssmithygeneratedtypes.Materials if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ Value: (Aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ Value: (Aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ Value: (Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ Value: (Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), } } return union } func StaticConfigurations_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations { var union awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_AWS__KMS__ECDH() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_AWS__KMS__ECDH()) union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberAWS_KMS_ECDH{ Value: (Aws_cryptography_materialProviders_StaticConfigurations_AWS_KMS_ECDH_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_RAW__ECDH() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_RAW__ECDH()) union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberRAW_ECDH{ Value: (Aws_cryptography_materialProviders_StaticConfigurations_RAW_ECDH_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KeyAgreementScheme { var union awscryptographymaterialproviderssmithygeneratedtypes.KeyAgreementScheme if (input.(AwsCryptographyMaterialProvidersTypes.KeyAgreementScheme)).Is_StaticConfiguration() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.KeyAgreementScheme)).Dtor_StaticConfiguration()) union = &awscryptographymaterialproviderssmithygeneratedtypes.KeyAgreementSchemeMemberStaticConfiguration{ Value: (Aws_cryptography_materialProviders_KeyAgreementScheme_StaticConfiguration_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { if input == nil { return nil } return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } func Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_AccountIdList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_AccountIdList_member_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_RegionList_member_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { if input == nil { return nil } return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } func Aws_cryptography_materialProviders_CreateAwsKmsDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), } } if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), } } return union } func Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput { return awscryptographymaterialproviderssmithygeneratedtypes.KmsPublicKeyDiscoveryInput{RecipientKmsIdentifier: Aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPublicKeyDiscoveryInput).Dtor_recipientKmsIdentifier())} } func Aws_cryptography_materialProviders_KmsPublicKeyDiscoveryInput_recipientKmsIdentifier_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput { return awscryptographymaterialproviderssmithygeneratedtypes.KmsPrivateKeyToStaticPublicKeyInput{SenderKmsIdentifier: Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderKmsIdentifier()), SenderPublicKey: Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_senderPublicKey().UnwrapOr(nil)), RecipientPublicKey: Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.KmsPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), } } func Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderKmsIdentifier_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_senderPublicKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_KmsPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) index := -1 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_CreateAwsKmsEcdhKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_branchKeyId_FromDafny(input interface{}) *string { return func() *string { if input == nil { return nil } a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return &s }() } func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_keyStore_FromDafny(input interface{}) *awscryptographykeystoresmithygenerated.Client { value, ok := input.(AwsCryptographyKeyStoreTypes.IKeyStoreClient) if !ok { panic("invalid type found.") } return &awscryptographykeystoresmithygenerated.Client{value} } func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_ttlSeconds_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType if input == nil { return nil } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ Value: (Aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ Value: (Aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ Value: (Aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ Value: (Aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ Value: (Aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), } } return union } func Aws_cryptography_materialProviders_CacheType_Default_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache { return awscryptographymaterialproviderssmithygeneratedtypes.DefaultCache{EntryCapacity: Aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DefaultCache).Dtor_entryCapacity())} } func Aws_cryptography_materialProviders_DefaultCache_entryCapacity_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_CacheType_No_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.NoCache { return awscryptographymaterialproviderssmithygeneratedtypes.NoCache{} } func Aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache { return awscryptographymaterialproviderssmithygeneratedtypes.SingleThreadedCache{EntryCapacity: Aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryCapacity()), EntryPruningTailSize: Aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.SingleThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_SingleThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_SingleThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { return nil } b = input.(int32) return &b }() } func Aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache { return awscryptographymaterialproviderssmithygeneratedtypes.MultiThreadedCache{EntryCapacity: Aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryCapacity()), EntryPruningTailSize: Aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.MultiThreadedCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_MultiThreadedCache_entryCapacity_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_MultiThreadedCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { return nil } b = input.(int32) return &b }() } func Aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache { return awscryptographymaterialproviderssmithygeneratedtypes.StormTrackingCache{EntryCapacity: Aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryCapacity()), EntryPruningTailSize: Aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_entryPruningTailSize().UnwrapOr(nil)), GracePeriod: Aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_gracePeriod()), GraceInterval: Aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_graceInterval()), FanOut: Aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_fanOut()), InFlightTTL: Aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_inFlightTTL()), SleepMilli: Aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_sleepMilli()), TimeUnits: Aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.StormTrackingCache).Dtor_timeUnits().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_StormTrackingCache_entryCapacity_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_StormTrackingCache_entryPruningTailSize_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { return nil } b = input.(int32) return &b }() } func Aws_cryptography_materialProviders_StormTrackingCache_gracePeriod_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_StormTrackingCache_graceInterval_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_StormTrackingCache_fanOut_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_StormTrackingCache_inFlightTTL_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_StormTrackingCache_sleepMilli_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_StormTrackingCache_timeUnits_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { return func() *awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits { var u awscryptographymaterialproviderssmithygeneratedtypes.TimeUnits if input == nil { return nil } inputEnum := input.(AwsCryptographyMaterialProvidersTypes.TimeUnits) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_TimeUnits_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.TimeUnits).Equals(inputEnum) { break } } } return &u.Values()[index] }() } func Aws_cryptography_materialProviders_CreateAwsKmsHierarchicalKeyringInput_partitionId_FromDafny(input interface{}) *string { return func() *string { if input == nil { return nil } a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return &s }() } func Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_CreateAwsKmsKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { if input == nil { return nil } return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryKeyringInput_region_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_regions_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_RegionList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_discoveryFilter_FromDafny(input interface{}) *awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter { if input == nil { return nil } return &awscryptographymaterialproviderssmithygeneratedtypes.DiscoveryFilter{AccountIds: Aws_cryptography_materialProviders_DiscoveryFilter_accountIds_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_accountIds()), Partition: Aws_cryptography_materialProviders_DiscoveryFilter_partition_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DiscoveryFilter).Dtor_partition()), } } func Aws_cryptography_materialProviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_CreateAwsKmsMrkKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_generator_FromDafny(input interface{}) *string { return func() *string { if input == nil { return nil } a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return &s }() } func Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsMrkMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_generator_FromDafny(input interface{}) *string { return func() *string { if input == nil { return nil } a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return &s }() } func Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_kmsKeyIds_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_KmsKeyIdList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsMultiKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsKeyId_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_encryptionAlgorithm_FromDafny(input interface{}) kmstypes.EncryptionAlgorithmSpec { return func() kmstypes.EncryptionAlgorithmSpec { var u kmstypes.EncryptionAlgorithmSpec inputEnum := input.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec) index := -1 for allEnums := dafny.Iterate(ComAmazonawsKmsTypes.CompanionStruct_EncryptionAlgorithmSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(ComAmazonawsKmsTypes.EncryptionAlgorithmSpec).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_kmsClient_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_CreateAwsKmsRsaKeyringInput_grantTokens_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_GrantTokenList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_CreateCryptographicMaterialsCacheInput_cache_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CacheType { var union awscryptographymaterialproviderssmithygeneratedtypes.CacheType if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Default() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberDefault{ Value: (Aws_cryptography_materialProviders_CacheType_Default_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Default())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_No() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberNo{ Value: (Aws_cryptography_materialProviders_CacheType_No_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_No())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_SingleThreaded() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberSingleThreaded{ Value: (Aws_cryptography_materialProviders_CacheType_SingleThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_SingleThreaded())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_MultiThreaded() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberMultiThreaded{ Value: (Aws_cryptography_materialProviders_CacheType_MultiThreaded_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_MultiThreaded())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_StormTracking() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberStormTracking{ Value: (Aws_cryptography_materialProviders_CacheType_StormTracking_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_StormTracking())), } } if (input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Is_Shared() { union = &awscryptographymaterialproviderssmithygeneratedtypes.CacheTypeMemberShared{ Value: (CryptographicMaterialsCache_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.CacheType)).Dtor_Shared().(AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache))), } } return union } func Aws_cryptography_materialProviders_CreateMultiKeyringInput_childKeyrings_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.IKeyring { fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.IKeyring, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Keyring_FromDafny(val.(AwsCryptographyMaterialProvidersTypes.IKeyring))) } return fieldValue } func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyNamespace_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_keyName_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_CreateRawAesKeyringInput_wrappingAlg_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { return func() awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg { var u awscryptographymaterialproviderssmithygeneratedtypes.AesWrappingAlg inputEnum := input.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_AesWrappingAlg_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.AesWrappingAlg).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_KeyAgreementScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), } } if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), } } if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), } } return union } func Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput { return awscryptographymaterialproviderssmithygeneratedtypes.PublicKeyDiscoveryInput{RecipientStaticPrivateKey: Aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.PublicKeyDiscoveryInput).Dtor_recipientStaticPrivateKey())} } func Aws_cryptography_materialProviders_PublicKeyDiscoveryInput_recipientStaticPrivateKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput { return awscryptographymaterialproviderssmithygeneratedtypes.RawPrivateKeyToStaticPublicKeyInput{SenderStaticPrivateKey: Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_senderStaticPrivateKey()), RecipientPublicKey: Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.RawPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey()), } } func Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_senderStaticPrivateKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_RawPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput { return awscryptographymaterialproviderssmithygeneratedtypes.EphemeralPrivateKeyToStaticPublicKeyInput{RecipientPublicKey: Aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EphemeralPrivateKeyToStaticPublicKeyInput).Dtor_recipientPublicKey())} } func Aws_cryptography_materialProviders_EphemeralPrivateKeyToStaticPublicKeyInput_recipientPublicKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_CreateRawEcdhKeyringInput_curveSpec_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { return func() awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec { var u awscryptographyprimitivessmithygeneratedtypes.ECDHCurveSpec inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec) index := -1 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDHCurveSpec_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyPrimitivesTypes.ECDHCurveSpec).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyNamespace_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_keyName_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_paddingScheme_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { return func() awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme { var u awscryptographymaterialproviderssmithygeneratedtypes.PaddingScheme inputEnum := input.(AwsCryptographyMaterialProvidersTypes.PaddingScheme) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_PaddingScheme_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.PaddingScheme).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_publicKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_CreateRawRsaKeyringInput_privateKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_CreateRequiredEncryptionContextCMMInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(input interface{}) string { return func() string { // UTF bytes should be always converted from bytes to string in go // Otherwise go treats the string as a unicode codepoint s := string(dafny.ToByteArray(input.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), BinaryId: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), MessageVersion: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), Encrypt: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), Kdf: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), Commitment: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), Signature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), SymmetricSignature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), EdkWrapping: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), } } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId { var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKAlgorithmSuiteId inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.ESDKAlgorithmSuiteId).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { return func() awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId { var u awscryptographymaterialproviderssmithygeneratedtypes.DBEAlgorithmSuiteId inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBEAlgorithmSuiteId_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.DBEAlgorithmSuiteId).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ Value: (Aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), } } return union } func Aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.AES_GCM { return awscryptographyprimitivessmithygeneratedtypes.AES_GCM{KeyLength: awscryptographyprimitivessmithygenerated.Aws_cryptography_primitives_AES_GCM_keyLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_keyLength()), TagLength: awscryptographyprimitivessmithygenerated.Aws_cryptography_primitives_AES_GCM_tagLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_tagLength()), IvLength: awscryptographyprimitivessmithygenerated.Aws_cryptography_primitives_AES_GCM_ivLength_FromDafny(input.(AwsCryptographyPrimitivesTypes.AES__GCM).Dtor_ivLength()), } } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), } } return union } func Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.HKDF { return awscryptographymaterialproviderssmithygeneratedtypes.HKDF{Hmac: Aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_hmac()), SaltLength: Aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_saltLength()), InputKeyLength: Aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_inputKeyLength()), OutputKeyLength: Aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.HKDF).Dtor_outputKeyLength()), } } func Aws_cryptography_materialProviders_HKDF_hmac_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) index := -1 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_HKDF_saltLength_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_HKDF_inputKeyLength_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_HKDF_outputKeyLength_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY { return awscryptographymaterialproviderssmithygeneratedtypes.IDENTITY{} } func Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { return awscryptographymaterialproviderssmithygeneratedtypes.None{} } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), } } return union } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_ECDSA() { union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberECDSA{ Value: (Aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_ECDSA())), } } if (input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Is_None() { union = &awscryptographymaterialproviderssmithygeneratedtypes.SignatureAlgorithmMemberNone{ Value: (Aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SignatureAlgorithm)).Dtor_None())), } } return union } func Aws_cryptography_materialProviders_SignatureAlgorithm_ECDSA_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ECDSA { return awscryptographymaterialproviderssmithygeneratedtypes.ECDSA{Curve: Aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.ECDSA).Dtor_curve())} } func Aws_cryptography_materialProviders_ECDSA_curve_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.ECDSASignatureAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm) index := -1 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_ECDSASignatureAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyPrimitivesTypes.ECDSASignatureAlgorithm).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_SignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { return awscryptographymaterialproviderssmithygeneratedtypes.None{} } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_HMAC() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_HMAC()) union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberHMAC{ Value: (Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Is_None() { union = &awscryptographymaterialproviderssmithygeneratedtypes.SymmetricSignatureAlgorithmMemberNone{ Value: (Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.SymmetricSignatureAlgorithm)).Dtor_None())), } } return union } func Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_HMAC_FromDafny(input interface{}) awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { return func() awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm { var u awscryptographyprimitivessmithygeneratedtypes.DigestAlgorithm inputEnum := input.(AwsCryptographyPrimitivesTypes.DigestAlgorithm) index := -1 for allEnums := dafny.Iterate(AwsCryptographyPrimitivesTypes.CompanionStruct_DigestAlgorithm_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyPrimitivesTypes.DigestAlgorithm).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_SymmetricSignatureAlgorithm_None_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.None { return awscryptographymaterialproviderssmithygeneratedtypes.None{} } func Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_DIRECT__KEY__WRAPPING() { union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberDIRECT_KEY_WRAPPING{ Value: (Aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_DIRECT__KEY__WRAPPING())), } } if (input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Is_IntermediateKeyWrapping() { union = &awscryptographymaterialproviderssmithygeneratedtypes.EdkWrappingAlgorithmMemberIntermediateKeyWrapping{ Value: (Aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.EdkWrappingAlgorithm)).Dtor_IntermediateKeyWrapping())), } } return union } func Aws_cryptography_materialProviders_EdkWrappingAlgorithm_DIRECT_KEY_WRAPPING_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING { return awscryptographymaterialproviderssmithygeneratedtypes.DIRECT_KEY_WRAPPING{} } func Aws_cryptography_materialProviders_EdkWrappingAlgorithm_IntermediateKeyWrapping_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping { return awscryptographymaterialproviderssmithygeneratedtypes.IntermediateKeyWrapping{KeyEncryptionKeyKdf: Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_keyEncryptionKeyKdf()), MacKeyKdf: Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_macKeyKdf()), PdkEncryptAlgorithm: Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.IntermediateKeyWrapping).Dtor_pdkEncryptAlgorithm()), } } func Aws_cryptography_materialProviders_IntermediateKeyWrapping_keyEncryptionKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), } } return union } func Aws_cryptography_materialProviders_IntermediateKeyWrapping_macKeyKdf_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm { var union awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithm if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_HKDF() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberHKDF{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_HKDF_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_HKDF())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_IDENTITY() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberIDENTITY{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_IDENTITY_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_IDENTITY())), } } if (input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Is_None() { union = &awscryptographymaterialproviderssmithygeneratedtypes.DerivationAlgorithmMemberNone{ Value: (Aws_cryptography_materialProviders_DerivationAlgorithm_None_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.DerivationAlgorithm)).Dtor_None())), } } return union } func Aws_cryptography_materialProviders_IntermediateKeyWrapping_pdkEncryptAlgorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Encrypt { var union awscryptographymaterialproviderssmithygeneratedtypes.Encrypt if (input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Is_AES__GCM() { union = &awscryptographymaterialproviderssmithygeneratedtypes.EncryptMemberAES_GCM{ Value: (Aws_cryptography_materialProviders_Encrypt_AES_GCM_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Encrypt)).Dtor_AES__GCM())), } } return union } func Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny(input interface{}) string { return func() string { // UTF bytes should be always converted from bytes to string in go // Otherwise go treats the string as a unicode codepoint s := string(dafny.ToByteArray(input.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny(input interface{}) string { return func() string { // UTF bytes should be always converted from bytes to string in go // Otherwise go treats the string as a unicode codepoint s := string(dafny.ToByteArray(input.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo { return awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteInfo{Id: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_id_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_id()), BinaryId: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_binaryId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_binaryId()), MessageVersion: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_messageVersion_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_messageVersion()), Encrypt: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_encrypt_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_encrypt()), Kdf: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_kdf_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_kdf()), Commitment: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_commitment_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_commitment()), Signature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_signature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_signature()), SymmetricSignature: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_symmetricSignature_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_symmetricSignature()), EdkWrapping: Aws_cryptography_materialProviders_AlgorithmSuiteInfo_edkWrapping_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteInfo).Dtor_edkWrapping()), } } func Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey{KeyProviderId: Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderId()), KeyProviderInfo: Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_keyProviderInfo()), Ciphertext: Aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptedDataKey).Dtor_ciphertext()), } } func Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderId_FromDafny(input interface{}) string { return func() string { // UTF bytes should be always converted from bytes to string in go // Otherwise go treats the string as a unicode codepoint s := string(dafny.ToByteArray(input.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_EncryptedDataKey_keyProviderInfo_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_EncryptedDataKey_ciphertext_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input interface{}) [][]byte { if input == nil { return nil } fieldValue := make([][]byte, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_SymmetricSigningKeyList_member_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_GetAlgorithmSuiteInfoInput_binaryId_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_InitializeDecryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_signingKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_InitializeEncryptionMaterialsInput_verificationKey_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnDecryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { return func() awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy { var u awscryptographymaterialproviderssmithygeneratedtypes.ESDKCommitmentPolicy inputEnum := input.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_ESDKCommitmentPolicy_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.ESDKCommitmentPolicy).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy { return func() awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy { var u awscryptographymaterialproviderssmithygeneratedtypes.DBECommitmentPolicy inputEnum := input.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy) index := -1 for allEnums := dafny.Iterate(AwsCryptographyMaterialProvidersTypes.CompanionStruct_DBECommitmentPolicy_{}.AllSingletonConstructors()); ; { enum, ok := allEnums() if ok { index++ if enum.(AwsCryptographyMaterialProvidersTypes.DBECommitmentPolicy).Equals(inputEnum) { break } } } return u.Values()[index] }() } func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_algorithm_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_ValidateCommitmentPolicyOnEncryptInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_ValidDecryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_start_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_ValidEncryptionMaterialsTransitionInput_stop_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_GetBranchKeyIdInput_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_GetBranchKeyIdOutput_branchKeyId_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_GetClientInput_region_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_GetClientOutput_client_FromDafny(input interface{}) *kms.Client { shim, ok := input.(*KMSwrapped.Shim) if !ok { panic("Not able to convert client to native") } return shim.Client } func Aws_cryptography_materialProviders_DeleteCacheEntryInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_GetCacheEntryInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_GetCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int64 { return func() *int64 { var b int64 if input == nil { return nil } b = input.(int64) return &b }() } func Aws_cryptography_materialProviders_GetCacheEntryOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { var union awscryptographymaterialproviderssmithygeneratedtypes.Materials if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ Value: (Aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ Value: (Aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ Value: (Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ Value: (Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), } } return union } func Aws_cryptography_materialProviders_Materials_Encryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_Materials_Decryption_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials { return awscryptographykeystoresmithygeneratedtypes.BranchKeyMaterials{BranchKeyIdentifier: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_branchKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyIdentifier()), BranchKeyVersion: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_branchKeyVersion_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKeyVersion()), EncryptionContext: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_encryptionContext()), BranchKey: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BranchKeyMaterials_branchKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BranchKeyMaterials).Dtor_branchKey()), } } func Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny(input interface{}) awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials { return awscryptographykeystoresmithygeneratedtypes.BeaconKeyMaterials{BeaconKeyIdentifier: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_beaconKeyIdentifier_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKeyIdentifier()), EncryptionContext: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_encryptionContext_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_encryptionContext()), BeaconKey: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_beaconKey_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_beaconKey().UnwrapOr(nil)), HmacKeys: awscryptographykeystoresmithygenerated.Aws_cryptography_keyStore_BeaconKeyMaterials_hmacKeys_FromDafny(input.(AwsCryptographyKeyStoreTypes.BeaconKeyMaterials).Dtor_hmacKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_GetCacheEntryOutput_creationTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } func Aws_cryptography_materialProviders_GetCacheEntryOutput_expiryTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } func Aws_cryptography_materialProviders_GetCacheEntryOutput_messagesUsed_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_GetCacheEntryOutput_bytesUsed_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_PutCacheEntryInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_PutCacheEntryInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.Materials { var union awscryptographymaterialproviderssmithygeneratedtypes.Materials if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Encryption() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberEncryption{ Value: (Aws_cryptography_materialProviders_Materials_Encryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Encryption())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_Decryption() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberDecryption{ Value: (Aws_cryptography_materialProviders_Materials_Decryption_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_Decryption())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BranchKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBranchKey{ Value: (Aws_cryptography_materialProviders_Materials_BranchKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BranchKey())), } } if (input.(AwsCryptographyMaterialProvidersTypes.Materials)).Is_BeaconKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.MaterialsMemberBeaconKey{ Value: (Aws_cryptography_materialProviders_Materials_BeaconKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.Materials)).Dtor_BeaconKey())), } } return union } func Aws_cryptography_materialProviders_PutCacheEntryInput_creationTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } func Aws_cryptography_materialProviders_PutCacheEntryInput_expiryTime_FromDafny(input interface{}) int64 { return func() int64 { var b = input.(int64) return b }() } func Aws_cryptography_materialProviders_PutCacheEntryInput_messagesUsed_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { return nil } b = input.(int32) return &b }() } func Aws_cryptography_materialProviders_PutCacheEntryInput_bytesUsed_FromDafny(input interface{}) *int32 { return func() *int32 { var b int32 if input == nil { return nil } b = input.(int32) return &b }() } func Aws_cryptography_materialProviders_UpdateUsageMetadataInput_identifier_FromDafny(input interface{}) []byte { return func() []byte { if input == nil { return nil } a := input.(dafny.Sequence).ToArray().(dafny.GoNativeArray) b := make([]byte, 0, a.Length()) for i := uint32(0); i < a.Length(); i++ { b = append(b, a.Select(i).(byte)) } return b }() } func Aws_cryptography_materialProviders_UpdateUsageMetadataInput_bytesUsed_FromDafny(input interface{}) int32 { return func() int32 { var b = input.(int32) return b }() } func Aws_cryptography_materialProviders_DecryptMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_DecryptMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_DecryptMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_DecryptMaterialsInput_reproducedEncryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_DecryptMaterialsOutput_decryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_encryptionContext_FromDafny(input interface{}) map[string]string { var m map[string]string = make(map[string]string) if input == nil { return nil } for i := dafny.Iterate(input.(dafny.Map).Items()); ; { val, ok := i() if !ok { break } m[Aws_cryptography_materialProviders_EncryptionContext_key_FromDafny((*val.(dafny.Tuple).IndexInt(0)))] = Aws_cryptography_materialProviders_EncryptionContext_value_FromDafny((*val.(dafny.Tuple).IndexInt(1))) } return m } func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_commitmentPolicy_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy { var union awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicy if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberESDK{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.CommitmentPolicy)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.CommitmentPolicyMemberDBE{ Value: (Aws_cryptography_materialProviders_CommitmentPolicy_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_algorithmSuiteId_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId { var union awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteId if input == nil { return nil } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_ESDK() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_ESDK()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberESDK{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_ESDK_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Is_DBE() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.AlgorithmSuiteId)).Dtor_DBE()) union = &awscryptographymaterialproviderssmithygeneratedtypes.AlgorithmSuiteIdMemberDBE{ Value: (Aws_cryptography_materialProviders_AlgorithmSuiteId_DBE_FromDafny(dataSource.UnwrapOr(nil))), } } return union } func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_maxPlaintextLength_FromDafny(input interface{}) *int64 { return func() *int64 { var b int64 if input == nil { return nil } b = input.(int64) return &b }() } func Aws_cryptography_materialProviders_GetEncryptionMaterialsInput_requiredEncryptionContextKeys_FromDafny(input interface{}) []string { if input == nil { return nil } fieldValue := make([]string, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptionContextKeys_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_GetEncryptionMaterialsOutput_encryptionMaterials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_OnDecryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_OnDecryptInput_encryptedDataKeys_FromDafny(input interface{}) []awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey { fieldValue := make([]awscryptographymaterialproviderssmithygeneratedtypes.EncryptedDataKey, 0) for i := dafny.Iterate(input.(dafny.Sequence)); ; { val, ok := i() if !ok { break } fieldValue = append(fieldValue, Aws_cryptography_materialProviders_EncryptedDataKeyList_member_FromDafny(val)) } return fieldValue } func Aws_cryptography_materialProviders_OnDecryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.DecryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_DecryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_DecryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_encryptionContext()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_DecryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_DecryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), VerificationKey: Aws_cryptography_materialProviders_DecryptionMaterials_verificationKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_verificationKey().UnwrapOr(nil)), SymmetricSigningKey: Aws_cryptography_materialProviders_DecryptionMaterials_symmetricSigningKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.DecryptionMaterials).Dtor_symmetricSigningKey().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_OnEncryptInput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_OnEncryptOutput_materials_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials { return awscryptographymaterialproviderssmithygeneratedtypes.EncryptionMaterials{AlgorithmSuite: Aws_cryptography_materialProviders_EncryptionMaterials_algorithmSuite_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_algorithmSuite()), EncryptionContext: Aws_cryptography_materialProviders_EncryptionMaterials_encryptionContext_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptionContext()), EncryptedDataKeys: Aws_cryptography_materialProviders_EncryptionMaterials_encryptedDataKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_encryptedDataKeys()), RequiredEncryptionContextKeys: Aws_cryptography_materialProviders_EncryptionMaterials_requiredEncryptionContextKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_requiredEncryptionContextKeys()), PlaintextDataKey: Aws_cryptography_materialProviders_EncryptionMaterials_plaintextDataKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_plaintextDataKey().UnwrapOr(nil)), SigningKey: Aws_cryptography_materialProviders_EncryptionMaterials_signingKey_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_signingKey().UnwrapOr(nil)), SymmetricSigningKeys: Aws_cryptography_materialProviders_EncryptionMaterials_symmetricSigningKeys_FromDafny(input.(AwsCryptographyMaterialProvidersTypes.EncryptionMaterials).Dtor_symmetricSigningKeys().UnwrapOr(nil)), } } func Aws_cryptography_materialProviders_AwsCryptographicMaterialProvidersException_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_EntryAlreadyExists_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_EntryDoesNotExist_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InFlightTTLExceeded_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfo_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnDecrypt_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidAlgorithmSuiteInfoOnEncrypt_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidDecryptionMaterials_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidDecryptionMaterialsTransition_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidEncryptionMaterials_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_InvalidEncryptionMaterialsTransition_message_FromDafny(input interface{}) string { return func() string { a := UTF8.Encode(input.(dafny.Sequence)).Dtor_value() s := string(dafny.ToByteArray(a.(dafny.Sequence))) return s }() } func Aws_cryptography_materialProviders_StaticConfigurations_AWS_KMS_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations { var union awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurations if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPublicKeyDiscovery() { union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPublicKeyDiscovery{ Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPublicKeyDiscovery())), } } if (input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Is_KmsPrivateKeyToStaticPublicKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.KmsEcdhStaticConfigurationsMemberKmsPrivateKeyToStaticPublicKey{ Value: (Aws_cryptography_materialProviders_KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.KmsEcdhStaticConfigurations)).Dtor_KmsPrivateKeyToStaticPublicKey())), } } return union } func Aws_cryptography_materialProviders_StaticConfigurations_RAW_ECDH_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations { var union awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurations if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_PublicKeyDiscovery() { union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberPublicKeyDiscovery{ Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_PublicKeyDiscovery_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_PublicKeyDiscovery())), } } if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_RawPrivateKeyToStaticPublicKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberRawPrivateKeyToStaticPublicKey{ Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_RawPrivateKeyToStaticPublicKey())), } } if (input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Is_EphemeralPrivateKeyToStaticPublicKey() { union = &awscryptographymaterialproviderssmithygeneratedtypes.RawEcdhStaticConfigurationsMemberEphemeralPrivateKeyToStaticPublicKey{ Value: (Aws_cryptography_materialProviders_RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey_FromDafny((input.(AwsCryptographyMaterialProvidersTypes.RawEcdhStaticConfigurations)).Dtor_EphemeralPrivateKeyToStaticPublicKey())), } } return union } func Aws_cryptography_materialProviders_KeyAgreementScheme_StaticConfiguration_FromDafny(input interface{}) awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations { var union awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurations if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_AWS__KMS__ECDH() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_AWS__KMS__ECDH()) union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberAWS_KMS_ECDH{ Value: (Aws_cryptography_materialProviders_StaticConfigurations_AWS_KMS_ECDH_FromDafny(dataSource.UnwrapOr(nil))), } } if (input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Is_RAW__ECDH() { var dataSource = Wrappers.Companion_Option_.Create_Some_((input.(AwsCryptographyMaterialProvidersTypes.StaticConfigurations)).Dtor_RAW__ECDH()) union = &awscryptographymaterialproviderssmithygeneratedtypes.StaticConfigurationsMemberRAW_ECDH{ Value: (Aws_cryptography_materialProviders_StaticConfigurations_RAW_ECDH_FromDafny(dataSource.UnwrapOr(nil))), } } return union }