Vanetza
Loading...
Searching...
No Matches
SymmetricEncryptionKey.c
1/*
2 * Generated by asn1c
3 * From ASN.1 module "Ieee1609Dot2BaseTypes"
4 * found in "Ieee1609Dot2BaseTypes.asn"
5 * `asn1c -fcompound-names -fincludes-quoted -no-gen-example -fprefix=Vanetza_Security_ -R`
6 */
7
9
10static int
11memb_Vanetza_Security_aes128Ccm_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
14 size_t size;
15
16 if(!sptr) {
17 ASN__CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
21 }
22
23 size = st->size;
24
25 if((size == 16UL)) {
26 /* Constraint check succeeded */
27 return 0;
28 } else {
29 ASN__CTFAIL(app_key, td, sptr,
30 "%s: constraint failed (%s:%d)",
31 td->name, __FILE__, __LINE__);
32 return -1;
33 }
34}
35
36static int
37memb_Vanetza_Security_sm4Ccm_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
38 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
39 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
40 size_t size;
41
42 if(!sptr) {
43 ASN__CTFAIL(app_key, td, sptr,
44 "%s: value not given (%s:%d)",
45 td->name, __FILE__, __LINE__);
46 return -1;
47 }
48
49 size = st->size;
50
51 if((size == 16UL)) {
52 /* Constraint check succeeded */
53 return 0;
54 } else {
55 ASN__CTFAIL(app_key, td, sptr,
56 "%s: constraint failed (%s:%d)",
57 td->name, __FILE__, __LINE__);
58 return -1;
59 }
60}
61
62#if !defined(ASN_DISABLE_OER_SUPPORT)
63static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_aes128Ccm_constr_2 CC_NOTUSED = {
64 { 0, 0 },
65 16 /* (SIZE(16..16)) */};
66#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
67#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
68static asn_per_constraints_t asn_PER_memb_Vanetza_Security_aes128Ccm_constr_2 CC_NOTUSED = {
69 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
70 { APC_CONSTRAINED, 0, 0, 16, 16 } /* (SIZE(16..16)) */,
71 0, 0 /* No PER value map */
72};
73#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
74#if !defined(ASN_DISABLE_OER_SUPPORT)
75static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_sm4Ccm_constr_4 CC_NOTUSED = {
76 { 0, 0 },
77 16 /* (SIZE(16..16)) */};
78#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
79#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
80static asn_per_constraints_t asn_PER_memb_Vanetza_Security_sm4Ccm_constr_4 CC_NOTUSED = {
81 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
82 { APC_CONSTRAINED, 0, 0, 16, 16 } /* (SIZE(16..16)) */,
83 0, 0 /* No PER value map */
84};
85#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
86#if !defined(ASN_DISABLE_OER_SUPPORT)
87asn_oer_constraints_t asn_OER_type_Vanetza_Security_SymmetricEncryptionKey_constr_1 CC_NOTUSED = {
88 { 0, 0 },
89 -1};
90#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
91#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
92asn_per_constraints_t asn_PER_type_Vanetza_Security_SymmetricEncryptionKey_constr_1 CC_NOTUSED = {
93 { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */,
94 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
95 0, 0 /* No PER value map */
96};
97#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
98asn_TYPE_member_t asn_MBR_Vanetza_Security_SymmetricEncryptionKey_1[] = {
99 { ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_SymmetricEncryptionKey, choice.aes128Ccm),
100 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
101 -1, /* IMPLICIT tag at current level */
102 &asn_DEF_OCTET_STRING,
103 0,
104 {
105#if !defined(ASN_DISABLE_OER_SUPPORT)
106 &asn_OER_memb_Vanetza_Security_aes128Ccm_constr_2,
107#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
108#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
109 &asn_PER_memb_Vanetza_Security_aes128Ccm_constr_2,
110#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
111#if !defined(ASN_DISABLE_JER_SUPPORT)
112 0,
113#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
114 memb_Vanetza_Security_aes128Ccm_constraint_1
115 },
116 0, 0, /* No default value */
117 "aes128Ccm"
118 },
119 { ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_SymmetricEncryptionKey, choice.sm4Ccm),
120 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
121 -1, /* IMPLICIT tag at current level */
122 &asn_DEF_OCTET_STRING,
123 0,
124 {
125#if !defined(ASN_DISABLE_OER_SUPPORT)
126 &asn_OER_memb_Vanetza_Security_sm4Ccm_constr_4,
127#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
128#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
129 &asn_PER_memb_Vanetza_Security_sm4Ccm_constr_4,
130#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
131#if !defined(ASN_DISABLE_JER_SUPPORT)
132 0,
133#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
134 memb_Vanetza_Security_sm4Ccm_constraint_1
135 },
136 0, 0, /* No default value */
137 "sm4Ccm"
138 },
139};
140static const asn_TYPE_tag2member_t asn_MAP_Vanetza_Security_SymmetricEncryptionKey_tag2el_1[] = {
141 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aes128Ccm */
142 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sm4Ccm */
143};
144asn_CHOICE_specifics_t asn_SPC_Vanetza_Security_SymmetricEncryptionKey_specs_1 = {
145 sizeof(struct Vanetza_Security_SymmetricEncryptionKey),
146 offsetof(struct Vanetza_Security_SymmetricEncryptionKey, _asn_ctx),
147 offsetof(struct Vanetza_Security_SymmetricEncryptionKey, present),
148 sizeof(((struct Vanetza_Security_SymmetricEncryptionKey *)0)->present),
149 asn_MAP_Vanetza_Security_SymmetricEncryptionKey_tag2el_1,
150 2, /* Count of tags in the map */
151 0, 0,
152 1 /* Extensions start */
153};
154asn_TYPE_descriptor_t asn_DEF_Vanetza_Security_SymmetricEncryptionKey = {
155 "SymmetricEncryptionKey",
156 "SymmetricEncryptionKey",
157 &asn_OP_CHOICE,
158 0, /* No effective tags (pointer) */
159 0, /* No effective tags (count) */
160 0, /* No tags (pointer) */
161 0, /* No tags (count) */
162 {
163#if !defined(ASN_DISABLE_OER_SUPPORT)
164 &asn_OER_type_Vanetza_Security_SymmetricEncryptionKey_constr_1,
165#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
166#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
167 &asn_PER_type_Vanetza_Security_SymmetricEncryptionKey_constr_1,
168#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
169#if !defined(ASN_DISABLE_JER_SUPPORT)
170 0,
171#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
172 CHOICE_constraint
173 },
174 asn_MBR_Vanetza_Security_SymmetricEncryptionKey_1,
175 2, /* Elements count */
176 &asn_SPC_Vanetza_Security_SymmetricEncryptionKey_specs_1 /* Additional specs */
177};