NetBSD/tests/dev/cgd/t_cgd_aes.c

1451 lines
59 KiB
C
Raw Normal View History

2016-11-07 21:11:45 +03:00
/* $NetBSD: t_cgd_aes.c,v 1.2 2016/11/07 18:11:45 alnsn Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* Copyright (c) 2007 The Institute of Electrical and Electronics Engineers, Inc
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Alexander Nasonov.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>
#include <atf-c.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <util.h>
#include <dev/cgdvar.h>
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#define SECSIZE 512
struct testvec {
unsigned int blkno;
const uint8_t *ptxt; /* PlainText */
const uint8_t *ctxt; /* CipherText */
};
/*
* 256 bits key from IEEE 1619/D16, NUL terminated.
*/
static const char aes_xts_256_key[33] = {
0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
0
};
/*
* 512 bits key from IEEE 1619/D16, NUL terminated.
*/
static const char aes_xts_512_key[65] = {
0x27, 0x18, 0x28, 0x18, 0x28, 0x45, 0x90, 0x45,
0x23, 0x53, 0x60, 0x28, 0x74, 0x71, 0x35, 0x26,
0x62, 0x49, 0x77, 0x57, 0x24, 0x70, 0x93, 0x69,
0x99, 0x59, 0x57, 0x49, 0x66, 0x96, 0x76, 0x27,
0x31, 0x41, 0x59, 0x26, 0x53, 0x58, 0x97, 0x93,
0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27, 0x95,
0x02, 0x88, 0x41, 0x97, 0x16, 0x93, 0x99, 0x37,
0x51, 0x05, 0x82, 0x09, 0x74, 0x94, 0x45, 0x92,
0
};
/*
* Vector 4 from IEEE 1619/D16, blkno 0.
*/
static const uint8_t aes_xts_256_vec4_ptxt[SECSIZE] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x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e1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d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xf4, 0xf7, 0x9c, 0x20, 0x3e,
0xbb, 0x14, 0x0f, 0x2e, 0x58, 0x3c, 0xb2, 0xad,
0x15, 0xb4, 0xaa, 0x5b, 0x65, 0x50, 0x16, 0xa8,
0x44, 0x92, 0x77, 0xdb, 0xd4, 0x77, 0xef, 0x2c,
0x8d, 0x6c, 0x01, 0x7d, 0xb7, 0x38, 0xb1, 0x8d,
0xeb, 0x4a, 0x42, 0x7d, 0x19, 0x23, 0xce, 0x3f,
0xf2, 0x62, 0x73, 0x57, 0x79, 0xa4, 0x18, 0xf2,
0x0a, 0x28, 0x2d, 0xf9, 0x20, 0x14, 0x7b, 0xea,
0xbe, 0x42, 0x1e, 0xe5, 0x31, 0x9d, 0x05, 0x68,
};
/*
* Vector 5 from IEEE 1619/D16, blkno 1.
*/
static const uint8_t aes_xts_256_vec5_ptxt[SECSIZE] = {
0x27, 0xa7, 0x47, 0x9b, 0xef, 0xa1, 0xd4, 0x76,
0x48, 0x9f, 0x30, 0x8c, 0xd4, 0xcf, 0xa6, 0xe2,
0xa9, 0x6e, 0x4b, 0xbe, 0x32, 0x08, 0xff, 0x25,
0x28, 0x7d, 0xd3, 0x81, 0x96, 0x16, 0xe8, 0x9c,
0xc7, 0x8c, 0xf7, 0xf5, 0xe5, 0x43, 0x44, 0x5f,
0x83, 0x33, 0xd8, 0xfa, 0x7f, 0x56, 0x00, 0x00,
0x05, 0x27, 0x9f, 0xa5, 0xd8, 0xb5, 0xe4, 0xad,
0x40, 0xe7, 0x36, 0xdd, 0xb4, 0xd3, 0x54, 0x12,
0x32, 0x80, 0x63, 0xfd, 0x2a, 0xab, 0x53, 0xe5,
0xea, 0x1e, 0x0a, 0x9f, 0x33, 0x25, 0x00, 0xa5,
0xdf, 0x94, 0x87, 0xd0, 0x7a, 0x5c, 0x92, 0xcc,
0x51, 0x2c, 0x88, 0x66, 0xc7, 0xe8, 0x60, 0xce,
0x93, 0xfd, 0xf1, 0x66, 0xa2, 0x49, 0x12, 0xb4,
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0x67, 0xb1, 0x87, 0xf2, 0x25, 0xdd,
};
/*
* Vector 6 from IEEE 1619/D16, blkno 2.
*/
static const uint8_t aes_xts_256_vec6_ptxt[SECSIZE] = {
0x26, 0x4d, 0x3c, 0xa8, 0x51, 0x21, 0x94, 0xfe,
0xc3, 0x12, 0xc8, 0xc9, 0x89, 0x1f, 0x27, 0x9f,
0xef, 0xdd, 0x60, 0x8d, 0x0c, 0x02, 0x7b, 0x60,
0x48, 0x3a, 0x3f, 0xa8, 0x11, 0xd6, 0x5e, 0xe5,
0x9d, 0x52, 0xd9, 0xe4, 0x0e, 0xc5, 0x67, 0x2d,
0x81, 0x53, 0x2b, 0x38, 0xb6, 0xb0, 0x89, 0xce,
0x95, 0x1f, 0x0f, 0x9c, 0x35, 0x59, 0x0b, 0x8b,
0x97, 0x8d, 0x17, 0x52, 0x13, 0xf3, 0x29, 0xbb,
0x1c, 0x2f, 0xd3, 0x0f, 0x2f, 0x7f, 0x30, 0x49,
0x2a, 0x61, 0xa5, 0x32, 0xa7, 0x9f, 0x51, 0xd3,
0x6f, 0x5e, 0x31, 0xa7, 0xc9, 0xa1, 0x2c, 0x28,
0x60, 0x82, 0xff, 0x7d, 0x23, 0x94, 0xd1, 0x8f,
0x78, 0x3e, 0x1a, 0x8e, 0x72, 0xc7, 0x22, 0xca,
0xaa, 0xa5, 0x2d, 0x8f, 0x06, 0x56, 0x57, 0xd2,
0x63, 0x1f, 0xd2, 0x5b, 0xfd, 0x8e, 0x5b, 0xaa,
0xd6, 0xe5, 0x27, 0xd7, 0x63, 0x51, 0x75, 0x01,
0xc6, 0x8c, 0x5e, 0xdc, 0x3c, 0xdd, 0x55, 0x43,
0x5c, 0x53, 0x2d, 0x71, 0x25, 0xc8, 0x61, 0x4d,
0xee, 0xd9, 0xad, 0xaa, 0x3a, 0xca, 0xde, 0x58,
0x88, 0xb8, 0x7b, 0xef, 0x64, 0x1c, 0x4c, 0x99,
0x4c, 0x80, 0x91, 0xb5, 0xbc, 0xd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x2a, 0xae, 0xed,
0x77, 0xcb, 0x3f, 0xc6, 0xdb, 0x15, 0xdc, 0xd7,
0xd8, 0x0d, 0x7d, 0x5b, 0xc4, 0x06, 0xc4, 0x97,
0x0a, 0x34, 0x78, 0xad, 0xa8, 0x89, 0x9b, 0x32,
0x91, 0x98, 0xeb, 0x61, 0xc1, 0x93, 0xfb, 0x62,
0x75, 0xaa, 0x8c, 0xa3, 0x40, 0x34, 0x4a, 0x75,
0xa8, 0x62, 0xae, 0xbe, 0x92, 0xee, 0xe1, 0xce,
0x03, 0x2f, 0xd9, 0x50, 0xb4, 0x7d, 0x77, 0x04,
0xa3, 0x87, 0x69, 0x23, 0xb4, 0xad, 0x62, 0x84,
0x4b, 0xf4, 0xa0, 0x9c, 0x4d, 0xbe, 0x8b, 0x43,
0x97, 0x18, 0x4b, 0x74, 0x71, 0x36, 0x0c, 0x95,
0x64, 0x88, 0x0a, 0xed, 0xdd, 0xb9, 0xba, 0xa4,
0xaf, 0x2e, 0x75, 0x39, 0x4b, 0x08, 0xcd, 0x32,
0xff, 0x47, 0x9c, 0x57, 0xa0, 0x7d, 0x3e, 0xab,
0x5d, 0x54, 0xde, 0x5f, 0x97, 0x38, 0xb8, 0xd2,
0x7f, 0x27, 0xa9, 0xf0, 0xab, 0x11, 0x79, 0x9d,
0x7b, 0x7f, 0xfe, 0xfb, 0x27, 0x04, 0xc9, 0x5c,
0x6a, 0xd1, 0x2c, 0x39, 0xf1, 0xe8, 0x67, 0xa4,
0xb7, 0xb1, 0xd7, 0x81, 0x8a, 0x4b, 0x75, 0x3d,
0xfd, 0x2a, 0x89, 0xcc, 0xb4, 0x5e, 0x00, 0x1a,
0x03, 0xa8, 0x67, 0xb1, 0x87, 0xf2, 0x25, 0xdd,
};
static const uint8_t aes_xts_256_vec6_ctxt[SECSIZE] = {
0xfa, 0x76, 0x2a, 0x36, 0x80, 0xb7, 0x60, 0x07,
0x92, 0x8e, 0xd4, 0xa4, 0xf4, 0x9a, 0x94, 0x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b, 0xa4, 0x9d, 0x2a, 0x2f, 0xdb,
0xa5, 0x9f, 0xbf, 0x08, 0x97, 0xbc, 0x7a, 0xab,
0xd8, 0xd7, 0x07, 0xdc, 0x14, 0x0a, 0x80, 0xf0,
0xf3, 0x09, 0xf8, 0x35, 0xd3, 0xda, 0x54, 0xab,
0x58, 0x4e, 0x50, 0x1d, 0xfa, 0x0e, 0xe9, 0x77,
0xfe, 0xc5, 0x43, 0xf7, 0x41, 0x86, 0xa8, 0x02,
0xb9, 0xa3, 0x7a, 0xdb, 0x3e, 0x82, 0x91, 0xec,
0xa0, 0x4d, 0x66, 0x52, 0x0d, 0x22, 0x9e, 0x60,
0x40, 0x1e, 0x72, 0x82, 0xbe, 0xf4, 0x86, 0xae,
0x05, 0x9a, 0xa7, 0x06, 0x96, 0xe0, 0xe3, 0x05,
0xd7, 0x77, 0x14, 0x0a, 0x7a, 0x88, 0x3e, 0xcd,
0xcb, 0x69, 0xb9, 0xff, 0x93, 0x8e, 0x8a, 0x42,
0x31, 0x86, 0x4c, 0x69, 0xca, 0x2c, 0x20, 0x43,
0xbe, 0xd0, 0x07, 0xff, 0x3e, 0x60, 0x5e, 0x01,
0x4b, 0xcf, 0x51, 0x81, 0x38, 0xdc, 0x3a, 0x25,
0xc5, 0xe2, 0x36, 0x17, 0x1a, 0x2d, 0x01, 0xd6,
};
/*
* Vector 7 from IEEE 1619/D16, blkno 0xfd.
*/
static const uint8_t aes_xts_256_vec7_ptxt[SECSIZE] = {
0x8e, 0x41, 0xb7, 0x8c, 0x39, 0x0b, 0x5a, 0xf9,
0xd7, 0x58, 0xbb, 0x21, 0x4a, 0x67, 0xe9, 0xf6,
0xbf, 0x77, 0x27, 0xb0, 0x9a, 0xc6, 0x12, 0x40,
0x84, 0xc3, 0x76, 0x11, 0x39, 0x8f, 0xa4, 0x5d,
0xaa, 0xd9, 0x48, 0x68, 0x60, 0x0e, 0xd3, 0x91,
0xfb, 0x1a, 0xcd, 0x48, 0x57, 0xa9, 0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a0, 0x81, 0x42, 0x92, 0x3c, 0x23,
0xc8, 0x83, 0x42, 0x3f, 0xf9, 0x49, 0x82, 0x7f,
0x29, 0xbb, 0xac, 0xdc, 0x1c, 0xcd, 0xb0, 0x49,
0x38, 0xce, 0x60, 0x98, 0xc9, 0x5b, 0xa6, 0xb3,
0x25, 0x28, 0xf4, 0xef, 0x78, 0xee, 0xd7, 0x78,
0xb2, 0xe1, 0x22, 0xdd, 0xfd, 0x1c, 0xbd, 0xd1,
0x1d, 0x1c, 0x0a, 0x67, 0x83, 0xe0, 0x11, 0xfc,
0x53, 0x6d, 0x63, 0xd0, 0x53, 0x26, 0x06, 0x37,
};
/*
* Vector 8 from IEEE 1619/D16, blkno 0xfe.
*/
static const uint8_t aes_xts_256_vec8_ptxt[SECSIZE] = {
0xd5, 0x5f, 0x68, 0x4f, 0x81, 0xf4, 0x42, 0x6e,
0x9f, 0xde, 0x92, 0xa5, 0xff, 0x02, 0xdf, 0x2a,
0xc8, 0x96, 0xaf, 0x63, 0x96, 0x28, 0x88, 0xa9,
0x79, 0x10, 0xc1, 0x37, 0x9e, 0x20, 0xb0, 0xa3,
0xb1, 0xdb, 0x61, 0x3f, 0xb7, 0xfe, 0x2e, 0x07,
0x00, 0x43, 0x29, 0xea, 0x5c, 0x22, 0xbf, 0xd3,
0x3e, 0x3d, 0xbe, 0x4c, 0xf5, 0x8c, 0xc6, 0x08,
0xc2, 0xc2, 0x6c, 0x19, 0xa2, 0xe2, 0xfe, 0x22,
0xf9, 0x87, 0x32, 0xc2, 0xb5, 0xcb, 0x84, 0x4c,
0xc6, 0xc0, 0x70, 0x2d, 0x91, 0xe1, 0xd5, 0x0f,
0xc4, 0x38, 0x2a, 0x7e, 0xba, 0x56, 0x35, 0xcd,
0x60, 0x24, 0x32, 0xa2, 0x30, 0x6a, 0xc4, 0xce,
0x82, 0xf8, 0xd7, 0x0c, 0x8d, 0x9b, 0xc1, 0x5f,
0x91, 0x8f, 0xe7, 0x1e, 0x74, 0xc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 0xb3,
0x25, 0x28, 0xf4, 0xef, 0x78, 0xee, 0xd7, 0x78,
0xb2, 0xe1, 0x22, 0xdd, 0xfd, 0x1c, 0xbd, 0xd1,
0x1d, 0x1c, 0x0a, 0x67, 0x83, 0xe0, 0x11, 0xfc,
0x53, 0x6d, 0x63, 0xd0, 0x53, 0x26, 0x06, 0x37,
};
static const uint8_t aes_xts_256_vec8_ctxt[SECSIZE] = {
0x72, 0xef, 0xc1, 0xeb, 0xfe, 0x1e, 0xe2, 0x59,
0x75, 0xa6, 0xeb, 0x3a, 0xa8, 0x58, 0x9d, 0xda,
0x2b, 0x26, 0x1f, 0x1c, 0x85, 0xbd, 0xab, 0x44,
0x2a, 0x9e, 0x5b, 0x2d, 0xd1, 0xd7, 0xc3, 0x95,
0x7a, 0x16, 0xfc, 0x08, 0xe5, 0x26, 0xd4, 0xb1,
0x22, 0x3f, 0x1b, 0x12, 0x32, 0xa1, 0x1a, 0xf2,
0x74, 0xc3, 0xd7, 0x0d, 0xac, 0x57, 0xf8, 0x3e,
0x09, 0x83, 0xc4, 0x98, 0xf1, 0xa6, 0xf1, 0xae,
0xcb, 0x02, 0x1c, 0x3e, 0x70, 0x08, 0x5a, 0x1e,
0x52, 0x7f, 0x1c, 0xe4, 0x1e, 0xe5, 0x91, 0x1a,
0x82, 0x02, 0x01, 0x61, 0x52, 0x9c, 0xd8, 0x27,
0x73, 0x76, 0x2d, 0xaf, 0x54, 0x59, 0xde, 0x94,
0xa0, 0xa8, 0x2a, 0xda, 0xe7, 0xe1, 0x70, 0x3c,
0x80, 0x85, 0x43, 0xc2, 0x9e, 0xd6, 0xfb, 0x32,
0xd9, 0xe0, 0x04, 0x32, 0x7c, 0x13, 0x55, 0x18,
0x0c, 0x99, 0x5a, 0x07, 0x74, 0x14, 0x93, 0xa0,
0x9c, 0x21, 0xba, 0x01, 0xa3, 0x87, 0x88, 0x2d,
0xa4, 0xf6, 0x25, 0x34, 0xb8, 0x7b, 0xb1, 0x5d,
0x60, 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9 from IEEE 1619/D16, blkno 0xff.
*/
static const uint8_t aes_xts_256_vec9_ptxt[SECSIZE] = {
0x72, 0xef, 0xc1, 0xeb, 0xfe, 0x1e, 0xe2, 0x59,
0x75, 0xa6, 0xeb, 0x3a, 0xa8, 0x58, 0x9d, 0xda,
0x2b, 0x26, 0x1f, 0x1c, 0x85, 0xbd, 0xab, 0x44,
0x2a, 0x9e, 0x5b, 0x2d, 0xd1, 0xd7, 0xc3, 0x95,
0x7a, 0x16, 0xfc, 0x08, 0xe5, 0x26, 0xd4, 0xb1,
0x22, 0x3f, 0x1b, 0x12, 0x32, 0xa1, 0x1a, 0xf2,
0x74, 0xc3, 0xd7, 0x0d, 0xac, 0x57, 0xf8, 0x3e,
0x09, 0x83, 0xc4, 0x98, 0xf1, 0xa6, 0xf1, 0xae,
0xcb, 0x02, 0x1c, 0x3e, 0x70, 0x08, 0x5a, 0x1e,
0x52, 0x7f, 0x1c, 0xe4, 0x1e, 0xe5, 0x91, 0x1a,
0x82, 0x02, 0x01, 0x61, 0x52, 0x9c, 0xd8, 0x27,
0x73, 0x76, 0x2d, 0xaf, 0x54, 0x59, 0xde, 0x94,
0xa0, 0xa8, 0x2a, 0xda, 0xe7, 0xe1, 0x70, 0x3c,
0x80, 0x85, 0x43, 0xc2, 0x9e, 0xd6, 0xfb, 0x32,
0xd9, 0xe0, 0x04, 0x32, 0x7c, 0x13, 0x55, 0x18,
0x0c, 0x99, 0x5a, 0x07, 0x74, 0x14, 0x93, 0xa0,
0x9c, 0x21, 0xba, 0x01, 0xa3, 0x87, 0x88, 0x2d,
0xa4, 0xf6, 0x25, 0x34, 0xb8, 0x7b, 0xb1, 0x5d,
0x60, 0xd1, 0x97, 0x20, 0x1c, 0x0f, 0xd3, 0xbf,
0x30, 0xc1, 0x50, 0x0a, 0x3e, 0xcf, 0xec, 0xdd,
0x66, 0xd8, 0x72, 0x1f, 0x90, 0xbc, 0xc4, 0xc1,
0x7e, 0xe9, 0x25, 0xc6, 0x1b, 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, 0x44, 0x69, 0x32,
0x60, 0xaa, 0xb3, 0x86, 0xc0, 0xa3, 0x7b, 0x11,
0xb1, 0x14, 0xf1, 0xc4, 0x15, 0xae, 0xbb, 0x65,
0x3b, 0xe4, 0x68, 0x17, 0x94, 0x28, 0xd4, 0x3a,
0x4d, 0x8b, 0xc3, 0xec, 0x38, 0x81, 0x3e, 0xca,
0x30, 0xa1, 0x3c, 0xf1, 0xbb, 0x18, 0xd5, 0x24,
0xf1, 0x99, 0x2d, 0x44, 0xd8, 0xb1, 0xa4, 0x2e,
0xa3, 0x0b, 0x22, 0xe6, 0xc9, 0x5b, 0x19, 0x9d,
0x8d, 0x18, 0x2f, 0x88, 0x40, 0xb0, 0x9d, 0x05,
0x95, 0x85, 0xc3, 0x1a, 0xd6, 0x91, 0xfa, 0x06,
0x19, 0xff, 0x03, 0x8a, 0xca, 0x2c, 0x39, 0xa9,
0x43, 0x42, 0x11, 0x57, 0x36, 0x17, 0x17, 0xc4,
0x9d, 0x32, 0x20, 0x28, 0xa7, 0x46, 0x48, 0x11,
0x3b, 0xd8, 0xc9, 0xd7, 0xec, 0x77, 0xcf, 0x3c,
0x89, 0xc1, 0xec, 0x87, 0x18, 0xce, 0xff, 0x85,
0x16, 0xd9, 0x6b, 0x34, 0xc3, 0xc6, 0x14, 0xf1,
0x06, 0x99, 0xc9, 0xab, 0xc4, 0xed, 0x04, 0x11,
0x50, 0x62, 0x23, 0xbe, 0xa1, 0x6a, 0xf3, 0x5c,
0x88, 0x3a, 0xcc, 0xdb, 0xe1, 0x10, 0x4e, 0xef,
0x0c, 0xfd, 0xb5, 0x4e, 0x12, 0xfb, 0x23, 0x0a,
};
static const uint8_t aes_xts_256_vec9_ctxt[SECSIZE] = {
0x32, 0x60, 0xae, 0x8d, 0xad, 0x1f, 0x4a, 0x32,
0xc5, 0xca, 0xfe, 0x3a, 0xb0, 0xeb, 0x95, 0x54,
0x9d, 0x46, 0x1a, 0x67, 0xce, 0xb9, 0xe5, 0xaa,
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xb0, 0xbe, 0xbc,
0xb1, 0xdc, 0x64, 0x53, 0x25, 0xbf, 0xb3, 0xe6,
0x65, 0xef, 0x72, 0x51, 0x08, 0x2c, 0x88, 0xeb,
0xb1, 0xcf, 0x20, 0x3b, 0xd7, 0x79, 0xfd, 0xd3,
0x86, 0x75, 0x71, 0x3c, 0x8d, 0xaa, 0xdd, 0x17,
0xe1, 0xca, 0xbe, 0xe4, 0x32, 0xb0, 0x97, 0x87,
0xb6, 0xdd, 0xf3, 0x30, 0x4e, 0x38, 0xb7, 0x31,
0xb4, 0x5d, 0xf5, 0xdf, 0x51, 0xb7, 0x8f, 0xcf,
0xb3, 0xd3, 0x24, 0x66, 0x02, 0x8d, 0x0b, 0xa3,
0x65, 0x55, 0xe7, 0xe1, 0x1a, 0xb0, 0xee, 0x06,
0x66, 0x06, 0x1d, 0x16, 0x45, 0xd9, 0x62, 0x44,
0x4b, 0xc4, 0x7a, 0x38, 0x18, 0x89, 0x30, 0xa8,
0x4b, 0x4d, 0x56, 0x13, 0x95, 0xc7, 0x3c, 0x08,
0x70, 0x21, 0x92, 0x7c, 0xa6, 0x38, 0xb7, 0xaf,
0xc8, 0xa8, 0x67, 0x9c, 0xcb, 0x84, 0xc2, 0x65,
0x55, 0x44, 0x0e, 0xc7, 0xf1, 0x04, 0x45, 0xcd,
};
const struct testvec aes_xts_256_vectors[] = {
{
.blkno = 0,
.ptxt = aes_xts_256_vec4_ptxt,
.ctxt = aes_xts_256_vec4_ctxt,
},
{
.blkno = 1,
.ptxt = aes_xts_256_vec5_ptxt,
.ctxt = aes_xts_256_vec5_ctxt,
},
{
.blkno = 2,
.ptxt = aes_xts_256_vec6_ptxt,
.ctxt = aes_xts_256_vec6_ctxt,
},
{
.blkno = 0xfd,
.ptxt = aes_xts_256_vec7_ptxt,
.ctxt = aes_xts_256_vec7_ctxt,
},
{
.blkno = 0xfe,
.ptxt = aes_xts_256_vec8_ptxt,
.ctxt = aes_xts_256_vec8_ctxt,
},
{
.blkno = 0xff,
.ptxt = aes_xts_256_vec9_ptxt,
.ctxt = aes_xts_256_vec9_ctxt,
},
};
/*
* Vector 10 from IEEE 1619/D16, blkno 0xff.
*/
static const uint8_t aes_xts_512_vec10_ptxt[SECSIZE] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0x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, 0x33, 0x3b, 0x93, 0xeb, 0x4a, 0xff, 0x04,
0x79, 0xda, 0x9a, 0x41, 0x0e, 0x44, 0x50, 0xe0,
0xdd, 0x7a, 0xe4, 0xc6, 0xe2, 0x91, 0x09, 0x00,
0x57, 0x5d, 0xa4, 0x01, 0xfc, 0x07, 0x05, 0x9f,
0x64, 0x5e, 0x8b, 0x7e, 0x9b, 0xfd, 0xef, 0x33,
0x94, 0x30, 0x54, 0xff, 0x84, 0x01, 0x14, 0x93,
0xc2, 0x7b, 0x34, 0x29, 0xea, 0xed, 0xb4, 0xed,
0x53, 0x76, 0x44, 0x1a, 0x77, 0xed, 0x43, 0x85,
0x1a, 0xd7, 0x7f, 0x16, 0xf5, 0x41, 0xdf, 0xd2,
0x69, 0xd5, 0x0d, 0x6a, 0x5f, 0x14, 0xfb, 0x0a,
0xab, 0x1c, 0xbb, 0x4c, 0x15, 0x50, 0xbe, 0x97,
0xf7, 0xab, 0x40, 0x66, 0x19, 0x3c, 0x4c, 0xaa,
0x77, 0x3d, 0xad, 0x38, 0x01, 0x4b, 0xd2, 0x09,
0x2f, 0xa7, 0x55, 0xc8, 0x24, 0xbb, 0x5e, 0x54,
0xc4, 0xf3, 0x6f, 0xfd, 0xa9, 0xfc, 0xea, 0x70,
0xb9, 0xc6, 0xe6, 0x93, 0xe1, 0x48, 0xc1, 0x51,
};
/*
* Vector 11 from IEEE 1619/D16, blkno 0xffff.
*/
static const uint8_t aes_xts_512_vec11_ptxt[SECSIZE] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0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0xe7,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
0xa0, 0xa1, 0xa2, 0x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x45, 0xc6, 0x9e, 0xd5, 0x0c,
0xdc, 0x2a, 0x8b, 0x33, 0x2b, 0x1f, 0x88, 0x24,
0x10, 0x8a, 0xc9, 0x37, 0xeb, 0x05, 0x05, 0x85,
0x60, 0x8e, 0xe7, 0x34, 0x09, 0x7f, 0xc0, 0x90,
0x54, 0xfb, 0xff, 0x89, 0xee, 0xae, 0xea, 0x79,
0x1f, 0x4a, 0x7a, 0xb1, 0xf9, 0x86, 0x82, 0x94,
0xa4, 0xf9, 0xe2, 0x7b, 0x42, 0xaf, 0x81, 0x00,
0xcb, 0x9d, 0x59, 0xce, 0xf9, 0x64, 0x58, 0x03,
};
const struct testvec aes_xts_512_vectors[] = {
{
.blkno = 0xff,
.ptxt = aes_xts_512_vec10_ptxt,
.ctxt = aes_xts_512_vec10_ctxt,
},
{
.blkno = 0xffff,
.ptxt = aes_xts_512_vec11_ptxt,
.ctxt = aes_xts_512_vec11_ctxt,
},
};
static int
open_disk(const char *devpath, const char *imgpath, size_t size)
{
int fd;
2016-11-07 21:11:45 +03:00
fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
if (fd < 0)
return -1;
if (ftruncate(fd, size) < 0)
goto fail;
if (rump_pub_etfs_register_withsize(devpath,
imgpath, RUMP_ETFS_BLK, 0, size) < 0) {
goto fail;
}
unlink(imgpath);
return fd;
fail:
close(fd);
unlink(imgpath);
return -1;
}
static int
open_cgd(int devno)
{
char devpath[32];
sprintf(devpath, "/dev/rcgd%d%c", devno, getrawpartition() + 'a');
return rump_sys_open(devpath, O_RDWR, 0);
}
static int
configure_cgd(int fd, const char *dkpath, const char *alg,
const char *ivmethod, const char *key, size_t keylen)
{
struct cgd_ioctl ci;
memset(&ci, 0, sizeof(ci));
ci.ci_disk = dkpath;
ci.ci_alg = alg;
ci.ci_ivmethod = ivmethod;
ci.ci_keylen = 8 * keylen - 8; /* Exclude the NUL terminator. */
ci.ci_key = key;
ci.ci_blocksize = 128;
return rump_sys_ioctl(fd, CGDIOCSET, &ci);
}
static int
unconfigure_cgd(int fd)
{
struct cgd_ioctl ci;
return rump_sys_ioctl(fd, CGDIOCCLR, &ci);
}
static int
write_testvec(int cgdfd, const struct testvec *tv)
{
if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
return -1;
if (rump_sys_write(cgdfd, tv->ptxt, SECSIZE) != SECSIZE)
return -1;
return 0;
}
static int
read_testvec(int cgdfd, const struct testvec *tv)
{
char *buf;
int res = -1;
buf = malloc(SECSIZE);
if (buf == NULL)
return -1;
if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
goto fail;
if (rump_sys_read(cgdfd, buf, SECSIZE) != SECSIZE)
goto fail;
res = memcmp(buf, tv->ptxt, SECSIZE);
fail:
free(buf);
return res;
}
static int
check_testvec(int dkfd, const struct testvec *tv)
{
char *buf;
int res = -1;
buf = malloc(SECSIZE);
if (buf == NULL)
return -1;
if (lseek(dkfd, tv->blkno * SECSIZE, SEEK_SET) < 0)
goto fail;
if (read(dkfd, buf, SECSIZE) != SECSIZE)
goto fail;
res = memcmp(buf, tv->ctxt, SECSIZE);
fail:
free(buf);
return res;
}
ATF_TC(cgd_aes_xts_256);
ATF_TC_HEAD(cgd_aes_xts_256, tc)
{
atf_tc_set_md_var(tc, "descr", "Test aes-xts with 256 bits key");
}
ATF_TC_BODY(cgd_aes_xts_256, tc)
{
2016-11-07 21:11:45 +03:00
const char imgpath[] = "aes-xts-256.img";
const char *dkpath = "/dev/dk";
const size_t dksize = 256 * SECSIZE; /* Last blkno is 0xff. */
int dkfd, cgdfd;
atf_tc_expect_fail("aes-xts implementation not committed yet");
rump_init();
RL(dkfd = open_disk(dkpath, imgpath, dksize));
RL(cgdfd = open_cgd(0));
RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno",
aes_xts_256_key, sizeof(aes_xts_256_key)));
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_256_vectors[0]), 0);
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_256_vectors[1]), 0);
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_256_vectors[2]), 0);
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_256_vectors[3]), 0);
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_256_vectors[4]), 0);
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_256_vectors[5]), 0);
RL(unconfigure_cgd(cgdfd));
RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno",
aes_xts_256_key, sizeof(aes_xts_256_key)));
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[0]), 0);
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[1]), 0);
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[2]), 0);
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[3]), 0);
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[4]), 0);
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_256_vectors[5]), 0);
RL(unconfigure_cgd(cgdfd));
RL(rump_sys_close(cgdfd));
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[0]), 0);
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[1]), 0);
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[2]), 0);
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[3]), 0);
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[4]), 0);
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_256_vectors[5]), 0);
RL(close(dkfd));
}
ATF_TC(cgd_aes_xts_512);
ATF_TC_HEAD(cgd_aes_xts_512, tc)
{
atf_tc_set_md_var(tc, "descr", "Test aes-xts with 512 bits key");
}
ATF_TC_BODY(cgd_aes_xts_512, tc)
{
2016-11-07 21:11:45 +03:00
const char imgpath[] = "aes-xts-512.img";
const char *dkpath = "/dev/dk";
const size_t dksize = 65536 * SECSIZE; /* Last blkno is 0xffff. */
int dkfd, cgdfd;
atf_tc_expect_fail("aes-xts implementation not committed yet");
rump_init();
RL(dkfd = open_disk(dkpath, imgpath, dksize));
RL(cgdfd = open_cgd(0));
RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno",
aes_xts_512_key, sizeof(aes_xts_512_key)));
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_512_vectors[0]), 0);
ATF_CHECK_EQ(write_testvec(cgdfd, &aes_xts_512_vectors[1]), 0);
RL(unconfigure_cgd(cgdfd));
RL(configure_cgd(cgdfd, dkpath, "aes-xts", "encblkno",
aes_xts_512_key, sizeof(aes_xts_512_key)));
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_512_vectors[0]), 0);
ATF_CHECK_EQ(read_testvec(cgdfd, &aes_xts_512_vectors[1]), 0);
RL(unconfigure_cgd(cgdfd));
RL(rump_sys_close(cgdfd));
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_512_vectors[0]), 0);
ATF_CHECK_EQ(check_testvec(dkfd, &aes_xts_512_vectors[1]), 0);
RL(close(dkfd));
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, cgd_aes_xts_256);
ATF_TP_ADD_TC(tp, cgd_aes_xts_512);
return atf_no_error();
}