How to use the tink.proto.common_pb2.SHA256 function in tink

To help you get started, we’ve selected a few tink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google / tink / python / signature / signature_key_templates.py View on Github external
key_template = tink_pb2.KeyTemplate(
      value=key_format.SerializeToString(),
      type_url=_RSA_PSS_KEY_TYPE_URL,
      output_prefix_type=tink_pb2.TINK)

  return key_template


ECDSA_P256 = create_ecdsa_key_template(common_pb2.SHA256, common_pb2.NIST_P256,
                                       ecdsa_pb2.DER)
ECDSA_P384 = create_ecdsa_key_template(common_pb2.SHA512, common_pb2.NIST_P384,
                                       ecdsa_pb2.DER)
ECDSA_P521 = create_ecdsa_key_template(common_pb2.SHA512, common_pb2.NIST_P521,
                                       ecdsa_pb2.DER)

ECDSA_P256_IEEE_P1363 = create_ecdsa_key_template(common_pb2.SHA256,
                                                  common_pb2.NIST_P256,
                                                  ecdsa_pb2.IEEE_P1363)
ECDSA_P384_IEEE_P1363 = create_ecdsa_key_template(common_pb2.SHA512,
                                                  common_pb2.NIST_P384,
                                                  ecdsa_pb2.IEEE_P1363)
ECDSA_P521_IEEE_P1363 = create_ecdsa_key_template(common_pb2.SHA512,
                                                  common_pb2.NIST_P521,
                                                  ecdsa_pb2.IEEE_P1363)

ED25519 = tink_pb2.KeyTemplate(
    type_url=_ED25519_KEY_TYPE_URL, output_prefix_type=tink_pb2.TINK)

RSA_SSA_PKCS1_3072_SHA256_F4 = create_rsa_ssa_pkcs1_key_template(
    common_pb2.SHA256, 3072, _RSA_F4)
RSA_SSA_PKCS1_4096_SHA512_F4 = create_rsa_ssa_pkcs1_key_template(
    common_pb2.SHA512, 4096, _RSA_F4)
github google / tink / python / hybrid / hybrid_key_templates.py View on Github external
key_format.params.kem_params.hkdf_hash_type = hash_type
  key_format.params.dem_params.aead_dem.CopyFrom(dem_key_template)
  key_format.params.ec_point_format = ec_point_format

  key_template = tink_pb2.KeyTemplate()
  key_template.type_url = (
      'type.googleapis.com/google.crypto.tink.EciesAeadHkdfPrivateKey')
  key_template.value = key_format.SerializeToString()
  key_template.output_prefix_type = tink_pb2.TINK
  return key_template


ECIES_P256_HKDF_HMAC_SHA256_AES128_GCM = create_ecies_aead_hkdf_key_template(
    curve_type=common_pb2.NIST_P256,
    ec_point_format=common_pb2.UNCOMPRESSED,
    hash_type=common_pb2.SHA256,
    dem_key_template=aead_key_templates.AES128_GCM)

ECIES_P256_HKDF_HMAC_SHA256_AES128_CTR_HMAC_SHA256 = (
    create_ecies_aead_hkdf_key_template(
        curve_type=common_pb2.NIST_P256,
        ec_point_format=common_pb2.UNCOMPRESSED,
        hash_type=common_pb2.SHA256,
        dem_key_template=aead_key_templates.AES128_CTR_HMAC_SHA256))
github google / tink / python / hybrid / hybrid_key_templates.py View on Github external
key_template.value = key_format.SerializeToString()
  key_template.output_prefix_type = tink_pb2.TINK
  return key_template


ECIES_P256_HKDF_HMAC_SHA256_AES128_GCM = create_ecies_aead_hkdf_key_template(
    curve_type=common_pb2.NIST_P256,
    ec_point_format=common_pb2.UNCOMPRESSED,
    hash_type=common_pb2.SHA256,
    dem_key_template=aead_key_templates.AES128_GCM)

ECIES_P256_HKDF_HMAC_SHA256_AES128_CTR_HMAC_SHA256 = (
    create_ecies_aead_hkdf_key_template(
        curve_type=common_pb2.NIST_P256,
        ec_point_format=common_pb2.UNCOMPRESSED,
        hash_type=common_pb2.SHA256,
        dem_key_template=aead_key_templates.AES128_CTR_HMAC_SHA256))