Skip to content

Error Codes

Claudio Lucisano edited this page Sep 22, 2026 · 1 revision

Error Codes

Every OpenABE error is a value of oabe::OpenABE_ERROR, defined in src/include/openabe/utils/zerror.h. You meet them in three places:

  • C++ crypto box: as the message of a ZCryptoBoxException, produced by OpenABE_errorToString(code)
  • CLI tools: as the process exit code
  • Low-level API: as the return value of most functions

The ones you will actually see

Code Name Usual cause
32 DECRYPTION_FAILED The key does not satisfy the policy, or the ciphertext was tampered with. This is the expected result for an unauthorized key.
20 INVALID_POLICY Malformed policy string
42 SYNTAX_ERROR_IN_PARSER Policy or attribute list does not follow the [[syntax
51 INVALID_ATTRIBUTE_LIST Malformed attribute list
52 / 53 INVALID_RANGE_NUMBERS / INVALID_MISMATCH_BITS in (a-b) with a > b, or ends with different #bits
55 / 56 INVALID_DATE_SPECIFIED / INVALID_DATE_BEFORE_EPOCH Impossible date, or year before 1970
11 LIBRARY_NOT_INITIALIZED InitializeOpenABE() was not called
12 / 13 NO_SECRET_PARAMS / NO_PUBLIC_PARAMS keygen without the master secret, or encrypt without the public params
10 / 39 UNKNOWN_SCHEME / INVALID_SCHEME_ID Key or ciphertext of a scheme the context does not handle

An unknown scheme string passed to the crypto box, for example OpenABECryptoContext("MA-ABE"), does not produce a code. The constructor throws ZCryptoBoxException("Invalid input: unrecognized scheme ID").

Full list

Code Name
0 OpenABE_NOERROR
2 INVALID_CONTEXT
3 INVALID_CIPHERTEXT
4 INVALID_GROUP_PARAMS
5 INVALID_PARAMS
6 INVALID_KEY
7 OUT_OF_MEMORY
8 INVALID_INPUT
9 ENCRYPTION_ERROR
10 UNKNOWN_SCHEME
11 LIBRARY_NOT_INITIALIZED
12 NO_SECRET_PARAMS
13 NO_PUBLIC_PARAMS
14 NOT_IMPLEMENTED
15 BUFFER_TOO_SMALL
16 WRONG_GROUP
17 INVALID_PARAMS_ID
18 ELEMENT_NOT_FOUND
19 SECRET_SHARING_FAILED
20 INVALID_POLICY
21 INVALID_RNG
22 SIGNATURE_FAILED
23 WRONG_USER_PARAM
24 INVALID_LENGTH
25 SERIALIZATION_FAILED
26 INVALID_LIBVERSION
27 RAND_INSUFFICIENT
28 UNEXPECTED_EXTRA_BYTES
29 IN_USE_ALREADY
30 INVALID_KEY_HEADER
31 INVALID_CIPHERTEXT_HEADER
32 DECRYPTION_FAILED
33 VERIFICATION_FAILED
34 DIVIDE_BY_ZERO
35 CTR_DRB_NOT_INITIALIZED
36 ELEMENT_NOT_INITIALIZED
37 DESERIALIZATION_FAILED
38 INVALID_CURVE_ID
39 INVALID_SCHEME_ID
40 INVALID_KEY_BODY
41 INVALID_CIPHERTEXT_BODY
42 SYNTAX_ERROR_IN_PARSER
43 CLASS_NOT_INITIALIZED
44 INVALID_PACK_TYPE
45 INVALID_ATTRIBUTE_STRUCTURE
46 INDEX_OUT_OF_BOUNDS
47 MISSING_SENDER_PUBLIC_KEY
48 MISSING_RECEIVER_PRIVATE_KEY
49 MISSING_RECEIVER_PUBLIC_KEY
50 MISSING_AUTHORITY_ID_IN_ATTR
51 INVALID_ATTRIBUTE_LIST
52 INVALID_RANGE_NUMBERS
53 INVALID_MISMATCH_BITS
54 INVALID_PREFIX_SPECIFIED
55 INVALID_DATE_SPECIFIED
56 INVALID_DATE_BEFORE_EPOCH
57 ORDER_NOT_SPECIFIED
58 INVALID_POLICY_TREE
59 KEYGEN_FAILED
60 NO_PLAINTEXT_SPECIFIED
61 INVALID_TAG_LENGTH
99 UNKNOWN

All names except code 0 carry the OpenABE_ERROR_ prefix in code, e.g. OpenABE_ERROR_DECRYPTION_FAILED.

Clone this wiki locally