github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/freebsd/dev_crypto.txt (about) 1 # Copyright 2021 syzkaller project authors. All rights reserved. 2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 include <sys/malloc.h> 5 include <sys/time.h> 6 include <fcntl.h> 7 include <opencrypto/cryptodev.h> 8 9 resource fd_crypto[fd] 10 11 openat$crypto(fd const[AT_FDCWD], file ptr[in, string["/dev/crypto"]], flags flags[open_flags], mode const[0]) fd_crypto 12 13 define CRIOGET 3221513060 14 ioctl$CRIOGET(fd fd_crypto, cmd const[CRIOGET], arg ptr[inout, int32]) 15 ioctl$CIOCFINDDEV(fd fd_crypto, cmd const[CIOCFINDDEV], arg ptr[inout, crypt_find_op]) 16 ioctl$CIOCGSESSION(fd fd_crypto, cmd const[CIOCGSESSION], arg ptr[inout, session_op]) 17 ioctl$CIOCGSESSION2(fd fd_crypto, cmd const[CIOCGSESSION2], arg ptr[inout, session2_op]) 18 ioctl$CIOCCRYPT(fd fd_crypto, cmd const[CIOCCRYPT], arg ptr[inout, crypt_op]) 19 ioctl$CIOCCRYPTAEAD(fd fd_crypto, cmd const[CIOCCRYPTAEAD], arg ptr[inout, crypt_aead]) 20 ioctl$CIOCFSESSION(fd fd_crypto, cmd const[CIOCFSESSION], arg ptr[inout, array[int32]]) 21 22 crypt_find_op { 23 crid int32 24 name array[int8, 32] 25 } 26 27 session_op { 28 cipher flags[cipher_flags, int32] 29 mac flags[mac_flags, int32] 30 keylen bytesize[key, int32] 31 key ptr[in, array[int8]] 32 mackeylen bytesize[mackey, int32] 33 mackey ptr[in, array[int8]] 34 ses int32 35 } 36 37 session2_op { 38 cipher flags[cipher_flags, int32] 39 mac flags[mac_flags, int32] 40 keylen bytesize[key, int32] 41 key ptr[in, array[int8]] 42 mackeylen bytesize[mackey, int32] 43 mackey ptr[in, array[int8]] 44 ses int32 45 crid int32 46 pad array[int32, 4] 47 } 48 49 crypt_op { 50 ses int32 51 op flags[op_flags, int16] 52 flags int16 53 len int32 54 src ptr[in, array[int8]] 55 dst ptr[in, array[int8]] 56 mac ptr[in, array[int8]] 57 iv ptr[in, array[int8]] 58 } 59 60 crypt_aead { 61 ses int32 62 op flags[op_flags, int16] 63 flags int16 64 len int32 65 aadlen int32 66 ivlen int32 67 src ptr[in, array[int8]] 68 dst ptr[in, array[int8]] 69 aad ptr[in, array[int8]] 70 tag ptr[in, array[int8]] 71 iv ptr[in, array[int8]] 72 } 73 74 cipher_flags = CRYPTO_AES_CBC, CRYPTO_AES_XTS, CRYPTO_AES_ICM, CRYPTO_CHACHA20, CRYPTO_NULL_CBC, CRYPTO_AES_NIST_GCM_16, CRYPTO_AES_CCM_16, CRYPTO_CHACHA20_POLY1305, CRYPTO_CAMELLIA_CBC 75 mac_flags = CRYPTO_SHA2_224_HMAC, CRYPTO_SHA2_256_HMAC, CRYPTO_SHA2_384_HMAC, CRYPTO_SHA2_512_HMAC, CRYPTO_AES_NIST_GMAC, CRYPTO_POLY1305, CRYPTO_SHA1, CRYPTO_SHA1_HMAC, CRYPTO_BLAKE2B, CRYPTO_BLAKE2S, CRYPTO_AES_NIST_GMAC, CRYPTO_SHA2_224, CRYPTO_SHA2_256, CRYPTO_SHA2_384, CRYPTO_SHA2_512, CRYPTO_RIPEMD160_HMAC, CRYPTO_AES_CCM_CBC_MAC, CRYPTO_NULL_HMAC 76 op_flags = COP_ENCRYPT, COP_DECRYPT