All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Structure_Compile.__default Maven / Gradle / Ivy

The newest version!
// Class __default
// Dafny class __default compiled into Java
package Structure_Compile;

import software.amazon.cryptography.keystore.internaldafny.types.*;
import software.amazon.cryptography.materialproviders.internaldafny.types.*;
import AwsArnParsing_Compile.*;
import AwsKmsMrkMatchForDecrypt_Compile.*;
import AwsKmsUtils_Compile.*;
import KeyStoreErrorMessages_Compile.*;
import KmsArn_Compile.*;

@SuppressWarnings({"unchecked", "deprecation"})
public class __default {
  public __default() {
  }
  public static boolean BranchKeyContext_q(dafny.DafnyMap, ? extends dafny.DafnySequence> m) {
    return ((((((((((((((m).>contains(__default.BRANCH__KEY__IDENTIFIER__FIELD())) && ((m).>contains(__default.TYPE__FIELD()))) && ((m).>contains(__default.KEY__CREATE__TIME()))) && ((m).>contains(__default.HIERARCHY__VERSION()))) && ((m).>contains(__default.TABLE__FIELD()))) && ((m).>contains(__default.KMS__FIELD()))) && (software.amazon.cryptography.services.kms.internaldafny.types.__default.IsValid__KeyIdType(((dafny.DafnySequence)(java.lang.Object)((m).get(__default.KMS__FIELD())))))) && (!((m).keySet()).>contains(__default.BRANCH__KEY__FIELD()))) && ((java.math.BigInteger.valueOf((((dafny.DafnySequence)(java.lang.Object)((m).get(__default.BRANCH__KEY__IDENTIFIER__FIELD())))).length())).signum() == 1)) && ((java.math.BigInteger.valueOf((((dafny.DafnySequence)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).length())).signum() == 1)) && (((java.util.function.Function, ? extends dafny.DafnySequence>, Boolean>)(_0_m) -> dafny.Helpers.Quantifier(((_0_m).keySet()).Elements(), true, ((_forall_var_0_boxed0) -> {
      dafny.DafnySequence _forall_var_0 = ((dafny.DafnySequence)(java.lang.Object)(_forall_var_0_boxed0));
      dafny.DafnySequence _1_k = (dafny.DafnySequence)_forall_var_0;
      return !(((_0_m).keySet()).>contains(_1_k)) || (software.amazon.cryptography.services.dynamodb.internaldafny.types.__default.IsValid__AttributeName(_1_k));
    }))).apply(m))) && (((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == ((true) && ((((dafny.DafnySequence)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).equals(__default.BRANCH__KEY__ACTIVE__TYPE()))))) && (!((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) || ((true) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf(((dafny.DafnySequence)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))))))) && ((!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == (((((dafny.DafnySequence)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).equals(__default.BEACON__KEY__TYPE__VALUE())) || ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf(((dafny.DafnySequence)(java.lang.Object)((m).get(__default.TYPE__FIELD())))))));
  }
  public static dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> ToAttributeMap(dafny.DafnyMap, ? extends dafny.DafnySequence> encryptionContext, dafny.DafnySequence encryptedKey)
  {
    return ((dafny.Function2, ? extends dafny.DafnySequence>, dafny.DafnySequence, dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>)(_0_encryptionContext, _1_encryptedKey) -> ((dafny.Function0, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>)(() -> {
      java.util.HashMap, software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> _coll0 = new java.util.HashMap<>();
      for (dafny.DafnySequence _compr_0_boxed0 : (dafny.DafnySet.>difference(dafny.DafnySet.>union((_0_encryptionContext).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).Elements()) {
        dafny.DafnySequence _compr_0 = ((dafny.DafnySequence)(java.lang.Object)(_compr_0_boxed0));
        if (true) {
          dafny.DafnySequence _2_k = (dafny.DafnySequence)_compr_0;
          if (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeName._Is(_2_k)) {
            if ((dafny.DafnySet.>difference(dafny.DafnySet.>union((_0_encryptionContext).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).>contains(_2_k)) {
              _coll0.put(_2_k,(((_2_k).equals(__default.HIERARCHY__VERSION())) ? (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_N(((dafny.DafnySequence)(java.lang.Object)((_0_encryptionContext).get(__default.HIERARCHY__VERSION()))))) : ((((_2_k).equals(__default.BRANCH__KEY__FIELD())) ? (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_B(_1_encryptedKey)) : (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_S(((dafny.DafnySequence)(java.lang.Object)((_0_encryptionContext).get(_2_k)))))))));
            }
          }
        }
      }
      return new dafny.DafnyMap,software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>(_coll0);
    })).apply()).apply(encryptionContext, encryptedKey);
  }
  public static dafny.DafnyMap, ? extends dafny.DafnySequence> ToBranchKeyContext(dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> item, dafny.DafnySequence logicalKeyStoreName)
  {
    return ((dafny.Function2, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>, dafny.DafnySequence, dafny.DafnyMap, ? extends dafny.DafnySequence>>)(_0_item, _1_logicalKeyStoreName) -> ((dafny.Function0, ? extends dafny.DafnySequence>>)(() -> {
      java.util.HashMap, dafny.DafnySequence> _coll0 = new java.util.HashMap<>();
      for (dafny.DafnySequence _compr_0_boxed0 : (dafny.DafnySet.>union(dafny.DafnySet.>difference((_0_item).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).Elements()) {
        dafny.DafnySequence _compr_0 = ((dafny.DafnySequence)(java.lang.Object)(_compr_0_boxed0));
        dafny.DafnySequence _2_k = (dafny.DafnySequence)_compr_0;
        if ((dafny.DafnySet.>union(dafny.DafnySet.>difference((_0_item).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).>contains(_2_k)) {
          _coll0.put(_2_k,(((_2_k).equals(__default.HIERARCHY__VERSION())) ? ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((_0_item).get(_2_k)))).dtor_N()) : ((((_2_k).equals(__default.TABLE__FIELD())) ? (_1_logicalKeyStoreName) : ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((_0_item).get(_2_k)))).dtor_S())))));
        }
      }
      return new dafny.DafnyMap,dafny.DafnySequence>(_coll0);
    })).apply()).apply(item, logicalKeyStoreName);
  }
  public static Wrappers_Compile.Result ToBranchKeyMaterials(dafny.DafnyMap, ? extends dafny.DafnySequence> encryptionContext, dafny.DafnySequence plaintextKey)
  {
    dafny.DafnySequence _0_versionInformation = (((encryptionContext).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) ? (((dafny.DafnySequence)(java.lang.Object)((encryptionContext).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))) : (((dafny.DafnySequence)(java.lang.Object)((encryptionContext).get(__default.TYPE__FIELD())))));
    dafny.DafnySequence _1_branchKeyVersion = (_0_versionInformation).drop(java.math.BigInteger.valueOf((__default.BRANCH__KEY__TYPE__PREFIX()).length()));
    Wrappers_Compile.Result, software.amazon.cryptography.keystore.internaldafny.types.Error> _2_valueOrError0 = (UTF8.__default.Encode(_1_branchKeyVersion)).MapFailure(UTF8.ValidUTF8Bytes._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function, software.amazon.cryptography.keystore.internaldafny.types.Error>)(_3_e_boxed0) -> {
      dafny.DafnySequence _3_e = ((dafny.DafnySequence)(java.lang.Object)(_3_e_boxed0));
      return software.amazon.cryptography.keystore.internaldafny.types.Error.create_KeyStoreException(_3_e);
    }));
    if ((_2_valueOrError0).IsFailure(UTF8.ValidUTF8Bytes._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
      return (_2_valueOrError0).PropagateFailure(UTF8.ValidUTF8Bytes._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials._typeDescriptor());
    } else {
      dafny.DafnySequence _4_branchKeyVersionUtf8 = (_2_valueOrError0).Extract(UTF8.ValidUTF8Bytes._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor());
      Wrappers_Compile.Result, ? extends dafny.DafnySequence>, software.amazon.cryptography.keystore.internaldafny.types.Error> _5_valueOrError1 = __default.ExtractCustomEncryptionContext(encryptionContext);
      if ((_5_valueOrError1).IsFailure(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
        return (_5_valueOrError1).PropagateFailure(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials._typeDescriptor());
      } else {
        dafny.DafnyMap, ? extends dafny.DafnySequence> _6_customEncryptionContext = (_5_valueOrError1).Extract(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor());
        return Wrappers_Compile.Result.create_Success(software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials.create(((dafny.DafnySequence)(java.lang.Object)((encryptionContext).get(__default.BRANCH__KEY__IDENTIFIER__FIELD()))), _4_branchKeyVersionUtf8, _6_customEncryptionContext, plaintextKey));
      }
    }
  }
  public static Wrappers_Compile.Result ToBeaconKeyMaterials(dafny.DafnyMap, ? extends dafny.DafnySequence> encryptionContext, dafny.DafnySequence plaintextKey)
  {
    Wrappers_Compile.Result, ? extends dafny.DafnySequence>, software.amazon.cryptography.keystore.internaldafny.types.Error> _0_valueOrError0 = __default.ExtractCustomEncryptionContext(encryptionContext);
    if ((_0_valueOrError0).IsFailure(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
      return (_0_valueOrError0).PropagateFailure(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials._typeDescriptor());
    } else {
      dafny.DafnyMap, ? extends dafny.DafnySequence> _1_customEncryptionContext = (_0_valueOrError0).Extract(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor());
      return Wrappers_Compile.Result.create_Success(software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials.create(((dafny.DafnySequence)(java.lang.Object)((encryptionContext).get(__default.BRANCH__KEY__IDENTIFIER__FIELD()))), _1_customEncryptionContext, Wrappers_Compile.Option.>create_Some(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), plaintextKey), Wrappers_Compile.Option., ? extends dafny.DafnySequence>>create_None(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor())))));
    }
  }
  public static Wrappers_Compile.Result, ? extends dafny.DafnySequence>, software.amazon.cryptography.keystore.internaldafny.types.Error> ExtractCustomEncryptionContext(dafny.DafnyMap, ? extends dafny.DafnySequence> encryptionContext) {
    dafny.DafnySet, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>> _0_encodedEncryptionContext = ((java.util.function.Function, ? extends dafny.DafnySequence>, dafny.DafnySet, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>>)(_1_encryptionContext) -> ((dafny.Function0, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>>)(() -> {
      java.util.ArrayList, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>> _coll0 = new java.util.ArrayList<>();
      for (dafny.DafnySequence _compr_0_boxed0 : (_1_encryptionContext).keySet().Elements()) {
        dafny.DafnySequence _compr_0 = ((dafny.DafnySequence)(java.lang.Object)(_compr_0_boxed0));
        dafny.DafnySequence _2_k = (dafny.DafnySequence)_compr_0;
        if (((_1_encryptionContext).>contains(_2_k)) && ((__default.ENCRYPTION__CONTEXT__PREFIX()).isProperPrefixOf(_2_k))) {
          _coll0.add(dafny.Tuple2., dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>create(UTF8.__default.Encode((_2_k).drop(java.math.BigInteger.valueOf((__default.ENCRYPTION__CONTEXT__PREFIX()).length()))), UTF8.__default.Encode(((dafny.DafnySequence)(java.lang.Object)((_1_encryptionContext).get(_2_k))))));
        }
      }
      return new dafny.DafnySet, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>(_coll0);
    })).apply()).apply(encryptionContext);
    Wrappers_Compile.Outcome _3_valueOrError0 = Wrappers_Compile.__default.Need(software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>, Boolean>)(_4_encodedEncryptionContext) -> dafny.Helpers.Quantifier((_4_encodedEncryptionContext).Elements(), true, ((_forall_var_0_boxed0) -> {
      dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>> _forall_var_0 = ((dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>)(java.lang.Object)(_forall_var_0_boxed0));
      dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>> _5_i = (dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>)_forall_var_0;
      return !((_4_encodedEncryptionContext)., dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>contains(_5_i)) || ((((_5_i).dtor__0()).is_Success()) && (((_5_i).dtor__1()).is_Success()));
    }))).apply(_0_encodedEncryptionContext), software.amazon.cryptography.keystore.internaldafny.types.Error.create_KeyStoreException(dafny.DafnySequence.asString("Unable to encode string")));
    if ((_3_valueOrError0).IsFailure(software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
      return (_3_valueOrError0)., ? extends dafny.DafnySequence>>PropagateFailure(software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()));
    } else {
      return Wrappers_Compile.Result., ? extends dafny.DafnySequence>, software.amazon.cryptography.keystore.internaldafny.types.Error>create_Success(dafny.DafnyMap., dafny.DafnySequence>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>, dafny.DafnyMap, ? extends dafny.DafnySequence>>)(_6_encodedEncryptionContext) -> ((dafny.Function0, ? extends dafny.DafnySequence>>)(() -> {
  java.util.HashMap, dafny.DafnySequence> _coll1 = new java.util.HashMap<>();
  for (dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>> _compr_1_boxed0 : (_6_encodedEncryptionContext).Elements()) {
    dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>> _compr_1 = ((dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>)(java.lang.Object)(_compr_1_boxed0));
    dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>> _7_i = (dafny.Tuple2, dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>)_compr_1;
    if ((_6_encodedEncryptionContext)., dafny.DafnySequence>, Wrappers_Compile.Result, dafny.DafnySequence>>>contains(_7_i)) {
      _coll1.put(((_7_i).dtor__0()).dtor_value(),((_7_i).dtor__1()).dtor_value());
    }
  }
  return new dafny.DafnyMap,dafny.DafnySequence>(_coll1);
})).apply()).apply(_0_encodedEncryptionContext));
    }
  }
  public static dafny.DafnyMap, ? extends dafny.DafnySequence> DecryptOnlyBranchKeyEncryptionContext(dafny.DafnySequence branchKeyId, dafny.DafnySequence branchKeyVersion, dafny.DafnySequence timestamp, dafny.DafnySequence logicalKeyStoreName, dafny.DafnySequence kmsKeyArn, dafny.DafnyMap, ? extends dafny.DafnySequence> customEncryptionContext)
  {
    return dafny.DafnyMap., dafny.DafnySequence>merge(dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.BRANCH__KEY__IDENTIFIER__FIELD(), branchKeyId), new dafny.Tuple2(__default.TYPE__FIELD(), dafny.DafnySequence.concatenate(__default.BRANCH__KEY__TYPE__PREFIX(), branchKeyVersion)), new dafny.Tuple2(__default.KEY__CREATE__TIME(), timestamp), new dafny.Tuple2(__default.TABLE__FIELD(), logicalKeyStoreName), new dafny.Tuple2(__default.KMS__FIELD(), kmsKeyArn), new dafny.Tuple2(__default.HIERARCHY__VERSION(), dafny.DafnySequence.asString("1"))), ((java.util.function.Function, ? extends dafny.DafnySequence>, dafny.DafnyMap, ? extends dafny.DafnySequence>>)(_0_customEncryptionContext) -> ((dafny.Function0, ? extends dafny.DafnySequence>>)(() -> {
      java.util.HashMap, dafny.DafnySequence> _coll0 = new java.util.HashMap<>();
      for (dafny.DafnySequence _compr_0_boxed0 : (_0_customEncryptionContext).keySet().Elements()) {
        dafny.DafnySequence _compr_0 = ((dafny.DafnySequence)(java.lang.Object)(_compr_0_boxed0));
        dafny.DafnySequence _1_k = (dafny.DafnySequence)_compr_0;
        if ((_0_customEncryptionContext).>contains(_1_k)) {
          _coll0.put(dafny.DafnySequence.concatenate(__default.ENCRYPTION__CONTEXT__PREFIX(), _1_k),((dafny.DafnySequence)(java.lang.Object)((_0_customEncryptionContext).get(_1_k))));
        }
      }
      return new dafny.DafnyMap,dafny.DafnySequence>(_coll0);
    })).apply()).apply(customEncryptionContext));
  }
  public static dafny.DafnyMap, ? extends dafny.DafnySequence> ActiveBranchKeyEncryptionContext(dafny.DafnyMap, ? extends dafny.DafnySequence> decryptOnlyEncryptionContext) {
    return dafny.DafnyMap., dafny.DafnySequence>merge(decryptOnlyEncryptionContext, dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD(), ((dafny.DafnySequence)(java.lang.Object)((decryptOnlyEncryptionContext).get(__default.TYPE__FIELD())))), new dafny.Tuple2(__default.TYPE__FIELD(), __default.BRANCH__KEY__ACTIVE__TYPE())));
  }
  public static dafny.DafnyMap, ? extends dafny.DafnySequence> BeaconKeyEncryptionContext(dafny.DafnyMap, ? extends dafny.DafnySequence> decryptOnlyEncryptionContext) {
    return dafny.DafnyMap., dafny.DafnySequence>merge(decryptOnlyEncryptionContext, dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.TYPE__FIELD(), __default.BEACON__KEY__TYPE__VALUE())));
  }
  public static dafny.DafnyMap, ? extends dafny.DafnySequence> NewVersionFromActiveBranchKeyEncryptionContext(dafny.DafnyMap, ? extends dafny.DafnySequence> activeBranchKeyEncryptionContext, dafny.DafnySequence branchKeyVersion, dafny.DafnySequence timestamp)
  {
    return dafny.DafnyMap., dafny.DafnySequence>subtract(dafny.DafnyMap., dafny.DafnySequence>merge(activeBranchKeyEncryptionContext, dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.TYPE__FIELD(), dafny.DafnySequence.concatenate(__default.BRANCH__KEY__TYPE__PREFIX(), branchKeyVersion)), new dafny.Tuple2(__default.KEY__CREATE__TIME(), timestamp))), dafny.DafnySet.> of(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()));
  }
  public static boolean BranchKeyItem_q(dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
    return (((((((((((((((((((((m).>contains(__default.BRANCH__KEY__IDENTIFIER__FIELD())) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__IDENTIFIER__FIELD())))).is_S())) && ((m).>contains(__default.TYPE__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).is_S())) && ((m).>contains(__default.KEY__CREATE__TIME()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.KEY__CREATE__TIME())))).is_S())) && ((m).>contains(__default.HIERARCHY__VERSION()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.HIERARCHY__VERSION())))).is_N())) && (!(m).>contains(__default.TABLE__FIELD()))) && ((m).>contains(__default.KMS__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.KMS__FIELD())))).is_S())) && (software.amazon.cryptography.services.kms.internaldafny.types.__default.IsValid__KeyIdType((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.KMS__FIELD())))).dtor_S()))) && ((m).>contains(__default.BRANCH__KEY__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__FIELD())))).is_B())) && ((java.math.BigInteger.valueOf(((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__IDENTIFIER__FIELD())))).dtor_S()).length())).signum() == 1)) && ((java.math.BigInteger.valueOf(((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).length())).signum() == 1)) && (((java.util.function.Function, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>, Boolean>)(_0_m) -> dafny.Helpers.Quantifier((dafny.DafnySet.>difference((_0_m).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD(), __default.HIERARCHY__VERSION()))).Elements(), true, ((_forall_var_0_boxed0) -> {
      dafny.DafnySequence _forall_var_0 = ((dafny.DafnySequence)(java.lang.Object)(_forall_var_0_boxed0));
      dafny.DafnySequence _1_k = (dafny.DafnySequence)_forall_var_0;
      return !((dafny.DafnySet.>difference((_0_m).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD(), __default.HIERARCHY__VERSION()))).>contains(_1_k)) || ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((_0_m).get(_1_k)))).is_S());
    }))).apply(m))) && (((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == ((true) && (((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BRANCH__KEY__ACTIVE__TYPE()))))) && (!((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) || ((true) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))).dtor_S()))))) && ((!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == ((((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BEACON__KEY__TYPE__VALUE())) || ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()))))) && (software.amazon.cryptography.services.kms.internaldafny.types.__default.IsValid__CiphertextType((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__FIELD())))).dtor_B()));
  }
  public static boolean ActiveBranchKeyItem_q(dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
    return ((((__default.BranchKeyItem_q(m)) && (((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BRANCH__KEY__ACTIVE__TYPE()))) && ((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))).is_S())) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))).dtor_S()));
  }
  public static boolean VersionBranchKeyItem_q(dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
    return ((__default.BranchKeyItem_q(m)) && (!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()))) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()));
  }
  public static boolean BeaconKeyItem_q(dafny.DafnyMap, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
    return ((__default.BranchKeyItem_q(m)) && (!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()))) && (((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BEACON__KEY__TYPE__VALUE()));
  }
  public static dafny.DafnySequence BRANCH__KEY__IDENTIFIER__FIELD()
  {
    return dafny.DafnySequence.asString("branch-key-id");
  }
  public static dafny.DafnySequence TYPE__FIELD()
  {
    return dafny.DafnySequence.asString("type");
  }
  public static dafny.DafnySequence KEY__CREATE__TIME()
  {
    return dafny.DafnySequence.asString("create-time");
  }
  public static dafny.DafnySequence HIERARCHY__VERSION()
  {
    return dafny.DafnySequence.asString("hierarchy-version");
  }
  public static dafny.DafnySequence TABLE__FIELD()
  {
    return dafny.DafnySequence.asString("tablename");
  }
  public static dafny.DafnySequence KMS__FIELD()
  {
    return dafny.DafnySequence.asString("kms-arn");
  }
  public static dafny.DafnySequence BRANCH__KEY__FIELD()
  {
    return dafny.DafnySequence.asString("enc");
  }
  public static dafny.DafnySequence BRANCH__KEY__ACTIVE__VERSION__FIELD()
  {
    return dafny.DafnySequence.asString("version");
  }
  public static dafny.DafnySequence BRANCH__KEY__ACTIVE__TYPE()
  {
    return dafny.DafnySequence.asString("branch:ACTIVE");
  }
  public static dafny.DafnySequence BRANCH__KEY__TYPE__PREFIX()
  {
    return dafny.DafnySequence.asString("branch:version:");
  }
  public static dafny.DafnySequence BEACON__KEY__TYPE__VALUE()
  {
    return dafny.DafnySequence.asString("beacon:ACTIVE");
  }
  public static dafny.DafnySequence ENCRYPTION__CONTEXT__PREFIX()
  {
    return dafny.DafnySequence.asString("aws-crypto-ec:");
  }
  @Override
  public java.lang.String toString() {
    return "Structure._default";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy