Lines Matching refs:image

155     public byte[] generateSignableImage(byte[] image) throws IOException {  in generateSignableImage()  argument
157 byte[] signable = Arrays.copyOf(image, image.length + attrs.length); in generateSignableImage()
159 signable[i+image.length] = attrs[i]; in generateSignableImage()
164 public byte[] sign(byte[] image, PrivateKey key) throws Exception { in sign() argument
165 byte[] signable = generateSignableImage(image); in sign()
169 public boolean verify(byte[] image) throws Exception { in verify() argument
170 if (length.getValue().intValue() != image.length) { in verify()
174 byte[] signable = generateSignableImage(image); in verify()
195 ByteBuffer image = ByteBuffer.wrap(data); in getSignableImageSize() local
196 image.order(ByteOrder.LITTLE_ENDIAN); in getSignableImageSize()
198 image.getLong(); // magic in getSignableImageSize()
199 int kernelSize = image.getInt(); in getSignableImageSize()
200 image.getInt(); // kernel_addr in getSignableImageSize()
201 int ramdskSize = image.getInt(); in getSignableImageSize()
202 image.getInt(); // ramdisk_addr in getSignableImageSize()
203 int secondSize = image.getInt(); in getSignableImageSize()
204 image.getLong(); // second_addr + tags_addr in getSignableImageSize()
205 int pageSize = image.getInt(); in getSignableImageSize()
227 byte[] image = Utils.read(imagePath); in doSignature()
228 int signableSize = getSignableImageSize(image); in doSignature()
230 if (signableSize < image.length) { in doSignature()
232 " from " + image.length + " to " + signableSize + " bytes"); in doSignature()
233 image = Arrays.copyOf(image, signableSize); in doSignature()
234 } else if (signableSize > image.length) { in doSignature()
239 BootSignature bootsig = new BootSignature(target, image.length); in doSignature()
245 bootsig.setSignature(bootsig.sign(image, key), in doSignature()
249 byte[] image_with_metadata = Arrays.copyOf(image, image.length + encoded_bootsig.length); in doSignature()
252 image.length, encoded_bootsig.length); in doSignature()
258 byte[] image = Utils.read(imagePath); in verifySignature()
259 int signableSize = getSignableImageSize(image); in verifySignature()
261 if (signableSize >= image.length) { in verifySignature()
265 byte[] signature = Arrays.copyOfRange(image, signableSize, image.length); in verifySignature()
274 if (bootsig.verify(Arrays.copyOf(image, signableSize))) { in verifySignature()