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

EcdhEdkWrapping_Compile.__default Maven / Gradle / Ivy

// Class __default
// Dafny class __default compiled into Java
package EcdhEdkWrapping_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.*;
import Structure_Compile.*;
import KMSKeystoreOperations_Compile.*;
import DDBKeystoreOperations_Compile.*;
import CreateKeys_Compile.*;
import CreateKeyStoreTable_Compile.*;
import GetKeys_Compile.*;
import AwsCryptographyKeyStoreOperations_Compile.*;
import software.amazon.cryptography.keystore.internaldafny.*;
import AlgorithmSuites_Compile.*;
import Materials_Compile.*;
import Keyring_Compile.*;
import MultiKeyring_Compile.*;
import AwsKmsMrkAreUnique_Compile.*;
import Constants_Compile.*;
import MaterialWrapping_Compile.*;
import CanonicalEncryptionContext_Compile.*;
import IntermediateKeyWrapping_Compile.*;
import EdkWrapping_Compile.*;
import ErrorMessages_Compile.*;
import AwsKmsKeyring_Compile.*;
import StrictMultiKeyring_Compile.*;
import AwsKmsDiscoveryKeyring_Compile.*;
import DiscoveryMultiKeyring_Compile.*;
import AwsKmsMrkDiscoveryKeyring_Compile.*;
import MrkAwareDiscoveryMultiKeyring_Compile.*;
import AwsKmsMrkKeyring_Compile.*;
import MrkAwareStrictMultiKeyring_Compile.*;
import LocalCMC_Compile.*;
import StormTracker_Compile.*;
import software.amazon.cryptography.internaldafny.StormTrackingCMC.*;
import CacheConstants_Compile.*;
import AwsKmsHierarchicalKeyring_Compile.*;
import AwsKmsRsaKeyring_Compile.*;

@SuppressWarnings({"unchecked", "deprecation"})
public class __default {
  public __default() {
  }
  public static Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> DeriveSharedKeyingMaterial(dafny.DafnySequence sharedSecret, dafny.DafnySequence fixedInfo, dafny.DafnySequence salt, software.amazon.cryptography.primitives.internaldafny.AtomicPrimitivesClient crypto)
  {
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> res = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence. empty(BoundedInts_Compile.uint8._typeDescriptor()));
    if(true) {
      Wrappers_Compile.Result, software.amazon.cryptography.primitives.internaldafny.types.Error> _0_maybeDerivedKeyingMaterial;
      Wrappers_Compile.Result, software.amazon.cryptography.primitives.internaldafny.types.Error> _out0;
      _out0 = (crypto).KdfCounterMode(software.amazon.cryptography.primitives.internaldafny.types.KdfCtrInput.create(software.amazon.cryptography.primitives.internaldafny.types.DigestAlgorithm.create_SHA__384(), sharedSecret, Constants_Compile.__default.KDF__EXPECTED__LEN(), Wrappers_Compile.Option.>create_Some(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), fixedInfo), Wrappers_Compile.Option.>create_Some(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), salt)));
      _0_maybeDerivedKeyingMaterial = _out0;
      Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _1_valueOrError0 = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence. empty(BoundedInts_Compile.uint8._typeDescriptor()));
      _1_valueOrError0 = (_0_maybeDerivedKeyingMaterial).MapFailure(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.primitives.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function)(_2_e_boxed0) -> {
        software.amazon.cryptography.primitives.internaldafny.types.Error _2_e = ((software.amazon.cryptography.primitives.internaldafny.types.Error)(java.lang.Object)(_2_e_boxed0));
        return software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographyPrimitives(_2_e);
      }));
      if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
        res = (_1_valueOrError0).>PropagateFailure(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()));
        return res;
      }
      dafny.DafnySequence _3_derivedKeyingMaterial;
      _3_derivedKeyingMaterial = (_1_valueOrError0).Extract(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
      res = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>create_Success(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), _3_derivedKeyingMaterial);
    }
    return res;
  }
  public static dafny.DafnySequence SerializeFixedInfo(dafny.DafnySequence ecdhKeyDerivationUtf8, dafny.DafnySequence curveSpecUtf8, dafny.DafnySequence senderPublicKey, dafny.DafnySequence recipientPublicKey, dafny.DafnySequence canonicalizedEC, dafny.DafnySequence keyringVersion)
  {
    return dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(ecdhKeyDerivationUtf8, Constants_Compile.__default.ECDH__KDF__DELIMETER()), curveSpecUtf8), Constants_Compile.__default.ECDH__KDF__DELIMETER()), Constants_Compile.__default.ECDH__KDF__PRF__NAME()), Constants_Compile.__default.ECDH__KDF__DELIMETER()), senderPublicKey), recipientPublicKey), Constants_Compile.__default.ECDH__KDF__DELIMETER()), keyringVersion), Constants_Compile.__default.ECDH__KDF__DELIMETER()), canonicalizedEC);
  }
  public static dafny.DafnySequence CurveSpecTypeToString(software.amazon.cryptography.primitives.internaldafny.types.ECDHCurveSpec c) {
    software.amazon.cryptography.primitives.internaldafny.types.ECDHCurveSpec _source0 = c;
    if (_source0.is_ECC__NIST__P256()) {
      return dafny.DafnySequence.asString("p256");
    } else if (_source0.is_ECC__NIST__P384()) {
      return dafny.DafnySequence.asString("p384");
    } else if (_source0.is_ECC__NIST__P521()) {
      return dafny.DafnySequence.asString("p521");
    } else {
      return dafny.DafnySequence.asString("sm2");
    }
  }
  public static software.amazon.cryptography.materialproviders.internaldafny.types.Error E(dafny.DafnySequence s) {
    return software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographicMaterialProvidersException(s);
  }
  @Override
  public java.lang.String toString() {
    return "EcdhEdkWrapping._default";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy