// Copyright 2020 Google LLC. All Rights Reserved. #ifndef WHITEBOX_API_RESULT_H_ #define WHITEBOX_API_RESULT_H_ #ifdef __cplusplus extern "C" { #endif // Error codes returned by all the white-box API functions. See the function // returning the result for additional details. typedef enum { // The operation completed successfully. WB_RESULT_OK = 0, // The operation failed because memory could not be allocated. WB_RESULT_OUT_OF_MEMORY = 1, // The state of white-box does not allow execution of this operation. For // example, another API function may need to be called first. WB_RESULT_INVALID_STATE = 2, // The output buffer length is too small to contain the operation's output. WB_RESULT_BUFFER_TOO_SMALL = 3, // There is an issue with one or more parameters. WB_RESULT_INVALID_PARAMETER = 4, // The message and signature did not pass signature verification. WB_RESULT_INVALID_SIGNATURE = 5, // The request key is not available for the operations. For example, no key // exists for the given key id. WB_RESULT_KEY_UNAVAILABLE = 6, // The requested key's security level is not sufficient for the operation. WB_RESULT_INSUFFICIENT_SECURITY_LEVEL = 7, // The input data failed to be verified. This may happen if the data was // corrupted or tampered. WB_RESULT_DATA_VERIFICATION_ERROR = 8, } WB_Result; #ifdef __cplusplus } #endif #endif // WHITEBOX_API_WB_RESULT_H_