/* * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved. * SPDX-License-Identifier: BSD-3-Clause */ syntax = "proto3"; package ts_crypto; /* Key types */ enum KeyType { KEY_TYPE_NONE = 0x0000; KEY_TYPE_RAW_DATA = 0x1001; KEY_TYPE_HMAC = 0x1100; KEY_TYPE_DERIVE = 0x1200; KEY_TYPE_AES = 0x2400; KEY_TYPE_DES = 0x2301; KEY_TYPE_CAMELLIA = 0x2403; KEY_TYPE_CHACHA20 = 0x2004; KEY_TYPE_RSA_PUBLIC_KEY = 0x4001; KEY_TYPE_RSA_KEY_PAIR = 0x7001; } /* ECC curves for use with ECC Key types */ enum EccCurve { ECC_FAMILY_NONE = 0x00; ECC_FAMILY_SECP_K1 = 0x17; ECC_FAMILY_SECP_R1 = 0x12; ECC_FAMILY_SECP_R2 = 0x1b; ECC_FAMILY_SECT_K1 = 0x27; ECC_FAMILY_SECT_R1 = 0x22; ECC_FAMILY_SECT_R2 = 0x2b; ECC_FAMILY_BRAINPOOL_P_R1 = 0x30; ECC_FAMILY_MONTGOMERY = 0x41; } /* Diffie-Hellman groups for use with DH key types */ enum DhGroup { DH_FAMILY_NONE = 0x00; DH_FAMILY_RFC7919 = 0x03; } /* Crypto algorithms */ enum Alg { ALG_NONE = 0x00000000; ALG_MD5 = 0x02000003; ALG_RIPEMD160 = 0x02000004; ALG_SHA_1 = 0x02000005; ALG_SHA_224 = 0x02000008; ALG_SHA_256 = 0x02000009; ALG_SHA_384 = 0x0200000a; ALG_SHA_512 = 0x0200000b; ALG_SHA_512_224 = 0x0200000c; ALG_SHA_512_256 = 0x0200000d; ALG_SHA3_224 = 0x02000010; ALG_SHA3_256 = 0x02000011; ALG_SHA3_384 = 0x02000012; ALG_SHA3_512 = 0x02000013; ALG_CBC_MAC = 0x03c00100; ALG_CMAC = 0x03c00200; ALG_STREAM_CIPHER = 0x04800100; ALG_CTR = 0x04c01000; ALG_CFB = 0x04c01100; ALG_OFB = 0x04c01200; ALG_XTS = 0x0440ff00; ALG_CBC_NO_PADDING = 0x04404000; ALG_CBC_PKCS7 = 0x04404100; ALG_CCM = 0x05500100; ALG_GCM = 0x05500200; ALG_CHACHA20_POLY1305 = 0x05100500; ALG_RSA_PKCS1V15_CRYPT = 0x07000200; ALG_FFDH = 0x09010000; ALG_ECDH = 0x09020000; } /* Key lifetime */ enum KeyLifetime { KEY_LIFETIME_VOLATILE = 0x00000000; KEY_LIFETIME_PERSISTENT = 0x00000001; } /* Key usage constraints */ enum KeyUsage { KEY_USAGE_NONE = 0x00000000; KEY_USAGE_EXPORT = 0x00000001; KEY_USAGE_COPY = 0x00000002; KEY_USAGE_ENCRYPT = 0x00000100; KEY_USAGE_DECRYPT = 0x00000200; KEY_USAGE_SIGN_HASH = 0x00001000; KEY_USAGE_VERIFY_HASH = 0x00002000; KEY_USAGE_DERIVE = 0x00004000; } /* Key policy to define what key can be used for */ message KeyPolicy { uint32 usage = 1; uint32 alg = 2; } /* Key attributes object */ message KeyAttributes { uint32 type = 1; uint32 key_bits = 2; uint32 lifetime = 3; uint32 id = 4; KeyPolicy policy = 5; }