// 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, // A key was requested that had not been loaded into the white-box. WB_RESULT_NO_SUCH_KEY = 6, // A key was requested that was found in the white-box, but is being used // improperly. WB_RESULT_WRONG_KEY_TYPE = 7, // The requested key's security level is not sufficient for the operation. WB_RESULT_INSUFFICIENT_SECURITY_LEVEL = 8, // The input data failed to be verified. This may happen if the data was // corrupted or tampered. WB_RESULT_DATA_VERIFICATION_ERROR = 9, // The padding at the end of the decrypted data does not match the // specification. WB_RESULT_INVALID_PADDING = 10, } WB_Result; #ifdef __cplusplus } #endif #endif // WHITEBOX_API_WB_RESULT_H_