1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.weaver; 18 19 // Keep in sync with native code 20 public class Consts { 21 public static final byte SLOT_ID_BYTES = 4; // 32-bit 22 public static final byte SLOT_KEY_BYTES = 16; // 128-bit 23 public static final byte SLOT_VALUE_BYTES = 16; // 128-bit 24 25 // Read errors (first byte of response) 26 public static final byte READ_SUCCESS = 0x00; 27 public static final byte READ_WRONG_KEY = 0x7f; 28 public static final byte READ_BACK_OFF = 0x76; 29 30 // Errors 31 public static final short SW_INVALID_SLOT_ID = 0x6a86; 32 33 // Instructions 34 public static final byte INS_GET_NUM_SLOTS = 0x02; 35 public static final byte INS_WRITE = 0x4; 36 public static final byte INS_READ = 0x6; 37 public static final byte INS_ERASE_VALUE = 0x8; 38 public static final byte INS_ERASE_ALL = 0xa; 39 } 40