CRYPT

This is the interface for accessing cryptographic hardware.

Details

define CRYPT_VERSION

define CRYPT_IOC_CHAR

define I_CRYPT_GETVERSION

define I_CRYPT_GETINFO

This request reads the random generator information.

Example:

crypt_info_t info;
ioctl(fildes, I_CRYPT_GETINFO, &info);

define I_CRYPT_SETATTR

Requests the hardware to write the random generator attributes.

Example:

crypt_attr_t attr;
attr.o_flags = CRYPT_FLAG_SET_SEED;
attr.seed = 10;
ioctl(fildes, I_CRYPT_SETATTR, &attr);

enum @6
  • CRYPT_FLAG_SET_CIPHER Sets the current cipher attributes
  • CRYPT_FLAG_IS_AES_ECB Sets the cipher to AES ECB
  • CRYPT_FLAG_IS_AES_CBC Sets the cipher to AES CBC
  • CRYPT_FLAG_IS_AES_CTR Sets the cipher to AES CTR
  • CRYPT_FLAG_IS_AES_GCM Sets the cipher to AES GCM
  • CRYPT_FLAG_IS_AES_CCM Sets the cipher to AES GCM
  • CRYPT_FLAG_IS_AES_128 Sets the cipher to a 128-bit key
  • CRYPT_FLAG_IS_AES_192 Sets the cipher to a 128-bit key
  • CRYPT_FLAG_IS_AES_256 Sets the cipher to a 128-bit key
  • CRYPT_FLAG_IS_DATA_1 Sets the data size to a 1-bit string
  • CRYPT_FLAG_IS_DATA_8 Sets the data size to a 8-bits
  • CRYPT_FLAG_IS_DATA_16 Sets the data size to a 16-bits
  • CRYPT_FLAG_IS_DATA_32 Sets the data size to a 32-bits
  • CRYPT_FLAG_SET_MODE Sets the cipher to encryption mode for use with CRYPT_FLAG_IS_ENCRYPT or CRYPT_FLAG_IS_DECRYPT
  • CRYPT_FLAG_IS_ENCRYPT Sets the cipher to encryption mode for use with CRYPT_FLAG_SET_MODE
  • CRYPT_FLAG_IS_DECRYPT Sets the cipher to decryption mode for use with CRYPT_FLAG_SET_MODE

struct::crypt_info_t

u32 o_flags

Bitwise flags

u8 max_header_size

u32 resd

struct::crypt_attr_t

u32 o_flags

Bitwise flags

u8 key

encryption key up to 256 bits

u8 iv

initialization vector up to 256 bits

u8 iv_size

u8 header_size

u32 resd

X

Thanks for Coming!

Subscribe to news and updates