1.\" $OpenBSD: crypto.9,v 1.19 2002/07/16 06:31:57 angelos Exp $ 2.\" 3.\" The author of this manual page is Angelos D. Keromytis (angelos@cis.upenn.edu) 4.\" 5.\" Copyright (c) 2000, 2001 Angelos D. Keromytis 6.\" 7.\" Permission to use, copy, and modify this software with or without fee 8.\" is hereby granted, provided that this entire notice is included in 9.\" all source code copies of any software which is or includes a copy or 10.\" modification of this software. 11.\" 12.\" THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 13.\" IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY 14.\" REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 15.\" MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 16.\" PURPOSE. 17.\" 18.\" $FreeBSD$ 19.\" 20.Dd November 6, 2017 21.Dt CRYPTO 9 22.Os 23.Sh NAME 24.Nm crypto 25.Nd API for cryptographic services in the kernel 26.Sh SYNOPSIS 27.In opencrypto/cryptodev.h 28.Ft int32_t 29.Fn crypto_get_driverid device_t int 30.Ft int 31.Fn crypto_register uint32_t int uint16_t uint32_t "int \*[lp]*\*[rp]\*[lp]void *, uint32_t *, struct cryptoini *\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, uint64_t\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, struct cryptop *\*[rp]" "void *" 32.Ft int 33.Fn crypto_kregister uint32_t int uint32_t "int \*[lp]*\*[rp]\*[lp]void *, struct cryptkop *\*[rp]" "void *" 34.Ft int 35.Fn crypto_unregister uint32_t int 36.Ft int 37.Fn crypto_unregister_all uint32_t 38.Ft void 39.Fn crypto_done "struct cryptop *" 40.Ft void 41.Fn crypto_kdone "struct cryptkop *" 42.Ft int 43.Fn crypto_find_driver "const char *" 44.Ft int 45.Fn crypto_newsession "uint64_t *" "struct cryptoini *" int 46.Ft int 47.Fn crypto_freesession uint64_t 48.Ft int 49.Fn crypto_dispatch "struct cryptop *" 50.Ft int 51.Fn crypto_kdispatch "struct cryptkop *" 52.Ft int 53.Fn crypto_unblock uint32_t int 54.Ft "struct cryptop *" 55.Fn crypto_getreq int 56.Ft void 57.Fn crypto_freereq void 58.Bd -literal 59#define CRYPTO_SYMQ 0x1 60#define CRYPTO_ASYMQ 0x2 61 62#define EALG_MAX_BLOCK_LEN 16 63 64struct cryptoini { 65 int cri_alg; 66 int cri_klen; 67 int cri_mlen; 68 caddr_t cri_key; 69 uint8_t cri_iv[EALG_MAX_BLOCK_LEN]; 70 struct cryptoini *cri_next; 71}; 72 73struct cryptodesc { 74 int crd_skip; 75 int crd_len; 76 int crd_inject; 77 int crd_flags; 78 struct cryptoini CRD_INI; 79#define crd_iv CRD_INI.cri_iv 80#define crd_key CRD_INI.cri_key 81#define crd_alg CRD_INI.cri_alg 82#define crd_klen CRD_INI.cri_klen 83 struct cryptodesc *crd_next; 84}; 85 86struct cryptop { 87 TAILQ_ENTRY(cryptop) crp_next; 88 uint64_t crp_sid; 89 int crp_ilen; 90 int crp_olen; 91 int crp_etype; 92 int crp_flags; 93 caddr_t crp_buf; 94 caddr_t crp_opaque; 95 struct cryptodesc *crp_desc; 96 int (*crp_callback) (struct cryptop *); 97 caddr_t crp_mac; 98}; 99 100struct crparam { 101 caddr_t crp_p; 102 u_int crp_nbits; 103}; 104 105#define CRK_MAXPARAM 8 106 107struct cryptkop { 108 TAILQ_ENTRY(cryptkop) krp_next; 109 u_int krp_op; /* ie. CRK_MOD_EXP or other */ 110 u_int krp_status; /* return status */ 111 u_short krp_iparams; /* # of input parameters */ 112 u_short krp_oparams; /* # of output parameters */ 113 uint32_t krp_hid; 114 struct crparam krp_param[CRK_MAXPARAM]; 115 int (*krp_callback)(struct cryptkop *); 116}; 117.Ed 118.Sh DESCRIPTION 119.Nm 120is a framework for drivers of cryptographic hardware to register with 121the kernel so 122.Dq consumers 123(other kernel subsystems, and 124users through the 125.Pa /dev/crypto 126device) are able to make use of it. 127Drivers register with the framework the algorithms they support, 128and provide entry points (functions) the framework may call to 129establish, use, and tear down sessions. 130Sessions are used to cache cryptographic information in a particular driver 131(or associated hardware), so initialization is not needed with every request. 132Consumers of cryptographic services pass a set of 133descriptors that instruct the framework (and the drivers registered 134with it) of the operations that should be applied on the data (more 135than one cryptographic operation can be requested). 136.Pp 137Keying operations are supported as well. 138Unlike the symmetric operators described above, 139these sessionless commands perform mathematical operations using 140input and output parameters. 141.Pp 142Since the consumers may not be associated with a process, drivers may 143not 144.Xr sleep 9 . 145The same holds for the framework. 146Thus, a callback mechanism is used 147to notify a consumer that a request has been completed (the 148callback is specified by the consumer on a per-request basis). 149The callback is invoked by the framework whether the request was 150successfully completed or not. 151An error indication is provided in the latter case. 152A specific error code, 153.Er EAGAIN , 154is used to indicate that a session number has changed and that the 155request may be re-submitted immediately with the new session number. 156Errors are only returned to the invoking function if not 157enough information to call the callback is available (meaning, there 158was a fatal error in verifying the arguments). 159For session initialization and teardown there is no callback mechanism used. 160.Pp 161The 162.Fn crypto_find_driver 163function may be called to return the specific id of the provided name. 164If the specified driver could not be found, the returned id is -1. 165.Pp 166The 167.Fn crypto_newsession 168routine is called by consumers of cryptographic services (such as the 169.Xr ipsec 4 170stack) that wish to establish a new session with the framework. 171The second argument contains all the necessary information for 172the driver to establish the session. 173The third argument is either a specific driver id, or one or both 174of 175.Dv CRYPTOCAP_F_HARDWARE , 176to select hardware devices, 177or 178.Dv CRYPTOCAP_F_SOFTWARE , 179to select software devices. 180If both are specified, a hardware device will be returned 181before a software device will be. 182On success, the value pointed to by the first argument will be the 183Session IDentifier (SID). 184The various fields in the 185.Vt cryptoini 186structure are: 187.Bl -tag -width ".Va cri_next" 188.It Va cri_alg 189Contains an algorithm identifier. 190Currently supported algorithms are: 191.Pp 192.Bl -tag -width ".Dv CRYPTO_RIPEMD160_HMAC" -compact 193.It Dv CRYPTO_AES_128_NIST_GMAC 194.It Dv CRYPTO_AES_192_NIST_GMAC 195.It Dv CRYPTO_AES_256_NIST_GMAC 196.It Dv CRYPTO_AES_CBC 197.It Dv CRYPTO_AES_ICM 198.It Dv CRYPTO_AES_NIST_GCM_16 199.It Dv CRYPTO_AES_NIST_GMAC 200.It Dv CRYPTO_AES_XTS 201.It Dv CRYPTO_ARC4 202.It Dv CRYPTO_BLF_CBC 203.It Dv CRYPTO_CAMELLIA_CBC 204.It Dv CRYPTO_CAST_CBC 205.It Dv CRYPTO_DEFLATE_COMP 206.It Dv CRYPTO_DES_CBC 207.It Dv CRYPTO_3DES_CBC 208.It Dv CRYPTO_MD5 209.It Dv CRYPTO_MD5_HMAC 210.It Dv CRYPTO_MD5_KPDK 211.It Dv CRYPTO_NULL_HMAC 212.It Dv CRYPTO_NULL_CBC 213.It Dv CRYPTO_RIPEMD160_HMAC 214.It Dv CRYPTO_SHA1 215.It Dv CRYPTO_SHA1_HMAC 216.It Dv CRYPTO_SHA1_KPDK 217.It Dv CRYPTO_SHA2_256_HMAC 218.It Dv CRYPTO_SHA2_384_HMAC 219.It Dv CRYPTO_SHA2_512_HMAC 220.It Dv CRYPTO_SKIPJACK_CBC 221.El 222.It Va cri_klen 223Specifies the length of the key in bits, for variable-size key 224algorithms. 225.It Va cri_mlen 226Specifies how many bytes from the calculated hash should be copied back. 2270 means entire hash. 228.It Va cri_key 229Contains the key to be used with the algorithm. 230.It Va cri_iv 231Contains an explicit initialization vector (IV), if it does not prefix 232the data. 233This field is ignored during initialization 234.Pq Nm crypto_newsession . 235If no IV is explicitly passed (see below on details), a random IV is used 236by the device driver processing the request. 237.It Va cri_next 238Contains a pointer to another 239.Vt cryptoini 240structure. 241Multiple such structures may be linked to establish multi-algorithm sessions 242.Xr ( ipsec 4 243is an example consumer of such a feature). 244.El 245.Pp 246The 247.Vt cryptoini 248structure and its contents will not be modified by the framework (or 249the drivers used). 250Subsequent requests for processing that use the 251SID returned will avoid the cost of re-initializing the hardware (in 252essence, SID acts as an index in the session cache of the driver). 253.Pp 254.Fn crypto_freesession 255is called with the SID returned by 256.Fn crypto_newsession 257to disestablish the session. 258.Pp 259.Fn crypto_dispatch 260is called to process a request. 261The various fields in the 262.Vt cryptop 263structure are: 264.Bl -tag -width ".Va crp_callback" 265.It Va crp_sid 266Contains the SID. 267.It Va crp_ilen 268Indicates the total length in bytes of the buffer to be processed. 269.It Va crp_olen 270On return, contains the total length of the result. 271For symmetric crypto operations, this will be the same as the input length. 272This will be used if the framework needs to allocate a new 273buffer for the result (or for re-formatting the input). 274.It Va crp_callback 275This routine is invoked upon completion of the request, whether 276successful or not. 277It is invoked through the 278.Fn crypto_done 279routine. 280If the request was not successful, an error code is set in the 281.Va crp_etype 282field. 283It is the responsibility of the callback routine to set the appropriate 284.Xr spl 9 285level. 286.It Va crp_etype 287Contains the error type, if any errors were encountered, or zero if 288the request was successfully processed. 289If the 290.Er EAGAIN 291error code is returned, the SID has changed (and has been recorded in the 292.Va crp_sid 293field). 294The consumer should record the new SID and use it in all subsequent requests. 295In this case, the request may be re-submitted immediately. 296This mechanism is used by the framework to perform 297session migration (move a session from one driver to another, because 298of availability, performance, or other considerations). 299.Pp 300Note that this field only makes sense when examined by 301the callback routine specified in 302.Va crp_callback . 303Errors are returned to the invoker of 304.Fn crypto_process 305only when enough information is not present to call the callback 306routine (i.e., if the pointer passed is 307.Dv NULL 308or if no callback routine was specified). 309.It Va crp_flags 310Is a bitmask of flags associated with this request. 311Currently defined flags are: 312.Bl -tag -width ".Dv CRYPTO_F_CBIFSYNC" 313.It Dv CRYPTO_F_IMBUF 314The buffer pointed to by 315.Va crp_buf 316is an mbuf chain. 317.It Dv CRYPTO_F_IOV 318The buffer pointed to by 319.Va crp_buf 320is an 321.Vt uio 322structure. 323.It Dv CRYPTO_F_BATCH 324Batch operation if possible. 325.It Dv CRYPTO_F_CBIMM 326Do callback immediately instead of doing it from a dedicated kernel thread. 327.It Dv CRYPTO_F_DONE 328Operation completed. 329.It Dv CRYPTO_F_CBIFSYNC 330Do callback immediately if operation is synchronous (that the driver 331specified the 332.Dv CRYPTOCAP_F_SYNC 333flag). 334.It Dv CRYPTO_F_ASYNC 335Try to do the crypto operation in a pool of workers 336if the operation is synchronous (that is, if the driver specified the 337.Dv CRYPTOCAP_F_SYNC 338flag). 339It aims to speed up processing by dispatching crypto operations 340on different processors. 341.It Dv CRYPTO_F_ASYNC_KEEPORDER 342Dispatch callbacks in the same order they are posted. 343Only relevant if the 344.Dv CRYPTO_F_ASYNC 345flag is set and if the operation is synchronous. 346.El 347.It Va crp_buf 348Points to the input buffer. 349On return (when the callback is invoked), 350it contains the result of the request. 351The input buffer may be an mbuf 352chain or a contiguous buffer, 353depending on 354.Va crp_flags . 355.It Va crp_opaque 356This is passed through the crypto framework untouched and is 357intended for the invoking application's use. 358.It Va crp_desc 359This is a linked list of descriptors. 360Each descriptor provides 361information about what type of cryptographic operation should be done 362on the input buffer. 363The various fields are: 364.Bl -tag -width ".Va crd_inject" 365.It Va crd_iv 366When the flag 367.Dv CRD_F_IV_EXPLICIT 368is set, this field contains the IV. 369.It Va crd_key 370When the 371.Dv CRD_F_KEY_EXPLICIT 372flag is set, the 373.Va crd_key 374points to a buffer with encryption or authentication key. 375.It Va crd_alg 376An algorithm to use. 377Must be the same as the one given at newsession time. 378.It Va crd_klen 379The 380.Va crd_key 381key length. 382.It Va crd_skip 383The offset in the input buffer where processing should start. 384.It Va crd_len 385How many bytes, after 386.Va crd_skip , 387should be processed. 388.It Va crd_inject 389The 390.Va crd_inject 391field specifies an offset in bytes from the beginning of the buffer. 392For encryption algorithms, this may be where the IV will be inserted 393when encrypting or where the IV may be found for 394decryption (subject to 395.Va crd_flags ) . 396For MAC algorithms, this is where the result of the keyed hash will be 397inserted. 398.It Va crd_flags 399The following flags are defined: 400.Bl -tag -width 3n 401.It Dv CRD_F_ENCRYPT 402For encryption algorithms, this bit is set when encryption is required 403(when not set, decryption is performed). 404.It Dv CRD_F_IV_PRESENT 405.\" This flag name has nothing to do w/ it's behavior, fix the name. 406For encryption, if this bit is not set the IV used to encrypt the packet 407will be written at the location pointed to by 408.Va crd_inject . 409The IV length is assumed to be equal to the blocksize of the 410encryption algorithm. 411For encryption, if this bit is set, nothing is done. 412For decryption, this flag has no meaning. 413Applications that do special 414.Dq "IV cooking" , 415such as the half-IV mode in 416.Xr ipsec 4 , 417can use this flag to indicate that the IV should not be written on the packet. 418This flag is typically used in conjunction with the 419.Dv CRD_F_IV_EXPLICIT 420flag. 421.It Dv CRD_F_IV_EXPLICIT 422This bit is set when the IV is explicitly 423provided by the consumer in the 424.Va crd_iv 425field. 426Otherwise, for encryption operations the IV is provided for by 427the driver used to perform the operation, whereas for decryption 428operations the offset of the IV is provided by the 429.Va crd_inject 430field. 431This flag is typically used when the IV is calculated 432.Dq "on the fly" 433by the consumer, and does not precede the data (some 434.Xr ipsec 4 435configurations, and the encrypted swap are two such examples). 436.It Dv CRD_F_KEY_EXPLICIT 437For encryption and authentication (MAC) algorithms, this bit is set when the key 438is explicitly provided by the consumer in the 439.Va crd_key 440field for the given operation. 441Otherwise, the key is taken at newsession time from the 442.Va cri_key 443field. 444As calculating the key schedule may take a while, it is recommended that often 445used keys are given their own session. 446.It Dv CRD_F_COMP 447For compression algorithms, this bit is set when compression is required (when 448not set, decompression is performed). 449.El 450.It Va CRD_INI 451This 452.Vt cryptoini 453structure will not be modified by the framework or the device drivers. 454Since this information accompanies every cryptographic 455operation request, drivers may re-initialize state on-demand 456(typically an expensive operation). 457Furthermore, the cryptographic 458framework may re-route requests as a result of full queues or hardware 459failure, as described above. 460.It Va crd_next 461Point to the next descriptor. 462Linked operations are useful in protocols such as 463.Xr ipsec 4 , 464where multiple cryptographic transforms may be applied on the same 465block of data. 466.El 467.El 468.Pp 469.Fn crypto_getreq 470allocates a 471.Vt cryptop 472structure with a linked list of as many 473.Vt cryptodesc 474structures as were specified in the argument passed to it. 475.Pp 476.Fn crypto_freereq 477deallocates a structure 478.Vt cryptop 479and any 480.Vt cryptodesc 481structures linked to it. 482Note that it is the responsibility of the 483callback routine to do the necessary cleanups associated with the 484opaque field in the 485.Vt cryptop 486structure. 487.Pp 488.Fn crypto_kdispatch 489is called to perform a keying operation. 490The various fields in the 491.Vt cryptkop 492structure are: 493.Bl -tag -width ".Va krp_callback" 494.It Va krp_op 495Operation code, such as 496.Dv CRK_MOD_EXP . 497.It Va krp_status 498Return code. 499This 500.Va errno Ns -style 501variable indicates whether lower level reasons 502for operation failure. 503.It Va krp_iparams 504Number if input parameters to the specified operation. 505Note that each operation has a (typically hardwired) number of such parameters. 506.It Va krp_oparams 507Number if output parameters from the specified operation. 508Note that each operation has a (typically hardwired) number of such parameters. 509.It Va krp_kvp 510An array of kernel memory blocks containing the parameters. 511.It Va krp_hid 512Identifier specifying which low-level driver is being used. 513.It Va krp_callback 514Callback called on completion of a keying operation. 515.El 516.Sh DRIVER-SIDE API 517The 518.Fn crypto_get_driverid , 519.Fn crypto_register , 520.Fn crypto_kregister , 521.Fn crypto_unregister , 522.Fn crypto_unblock , 523and 524.Fn crypto_done 525routines are used by drivers that provide support for cryptographic 526primitives to register and unregister with the kernel crypto services 527framework. 528.Pp 529Drivers must first use the 530.Fn crypto_get_driverid 531function to acquire a driver identifier, specifying the 532.Fa flags 533as an argument. 534One of 535.Dv CRYPTOCAP_F_SOFTWARE 536or 537.Dv CRYPTOCAP_F_HARDWARE 538must be specified. 539The 540.Dv CRYPTOCAP_F_SYNC 541may also be specified, and should be specified if the driver does all of 542it's operations synchronously. 543.Pp 544For each algorithm the driver supports, it must then call 545.Fn crypto_register . 546The first two arguments are the driver and algorithm identifiers. 547The next two arguments specify the largest possible operator length (in bits, 548important for public key operations) and flags for this algorithm. 549The last four arguments must be provided in the first call to 550.Fn crypto_register 551and are ignored in all subsequent calls. 552They are pointers to three 553driver-provided functions that the framework may call to establish new 554cryptographic context with the driver, free already established 555context, and ask for a request to be processed (encrypt, decrypt, 556etc.); and an opaque parameter to pass when calling each of these routines. 557.Pp 558.Fn crypto_unregister 559is called by drivers that wish to withdraw support for an algorithm. 560The two arguments are the driver and algorithm identifiers, respectively. 561Typically, drivers for 562PCMCIA 563crypto cards that are being ejected will invoke this routine for all 564algorithms supported by the card. 565.Fn crypto_unregister_all 566will unregister all algorithms registered by a driver 567and the driver will be disabled (no new sessions will be allocated on 568that driver, and any existing sessions will be migrated to other 569drivers). 570The same will be done if all algorithms associated with a driver are 571unregistered one by one. 572After a call to 573.Fn crypto_unregister_all 574there will be no threads in either the newsession or freesession function 575of the driver. 576.Pp 577The calling convention for the three driver-supplied routines are: 578.Pp 579.Bl -item -compact 580.It 581.Ft int 582.Fn \*[lp]*newsession\*[rp] "device_t" "uint32_t *" "struct cryptoini *" ; 583.It 584.Ft int 585.Fn \*[lp]*freesession\*[rp] "device_t" "uint64_t" ; 586.It 587.Ft int 588.Fn \*[lp]*process\*[rp] "device_t" "struct cryptop *" "int" ; 589.It 590.Ft int 591.Fn \*[lp]*kprocess\*[rp] "device_t" "struct cryptkop *" "int" ; 592.El 593.Pp 594On invocation, the first argument to 595all routines is the 596.Fa device_t 597that was provided to 598.Fn crypto_get_driverid . 599The second argument to 600.Fn newsession 601contains the driver identifier obtained via 602.Fn crypto_get_driverid . 603On successful return, it should contain a driver-specific session 604identifier. 605The third argument is identical to that of 606.Fn crypto_newsession . 607.Pp 608The 609.Fn freesession 610routine takes as arguments the opaque data value and the SID 611(which is the concatenation of the 612driver identifier and the driver-specific session identifier). 613It should clear any context associated with the session (clear hardware 614registers, memory, etc.). 615.Pp 616The 617.Fn process 618routine is invoked with a request to perform crypto processing. 619This routine must not block or sleep, but should queue the request and return 620immediately or process the request to completion. 621In case of an unrecoverable error, the error indication must be placed in the 622.Va crp_etype 623field of the 624.Vt cryptop 625structure. 626When the request is completed, or an error is detected, the 627.Fn process 628routine must invoke 629.Fn crypto_done . 630Session migration may be performed, as mentioned previously. 631.Pp 632In case of a temporary resource exhaustion, the 633.Fn process 634routine may return 635.Er ERESTART 636in which case the crypto services will requeue the request, mark the driver 637as 638.Dq blocked , 639and stop submitting requests for processing. 640The driver is then responsible for notifying the crypto services 641when it is again able to process requests through the 642.Fn crypto_unblock 643routine. 644This simple flow control mechanism should only be used for short-lived 645resource exhaustion as it causes operations to be queued in the crypto 646layer. 647Doing so is preferable to returning an error in such cases as 648it can cause network protocols to degrade performance by treating the 649failure much like a lost packet. 650.Pp 651The 652.Fn kprocess 653routine is invoked with a request to perform crypto key processing. 654This routine must not block, but should queue the request and return 655immediately. 656Upon processing the request, the callback routine should be invoked. 657In case of an unrecoverable error, the error indication must be placed in the 658.Va krp_status 659field of the 660.Vt cryptkop 661structure. 662When the request is completed, or an error is detected, the 663.Fn kprocess 664routine should invoked 665.Fn crypto_kdone . 666.Sh RETURN VALUES 667.Fn crypto_register , 668.Fn crypto_kregister , 669.Fn crypto_unregister , 670.Fn crypto_newsession , 671.Fn crypto_freesession , 672and 673.Fn crypto_unblock 674return 0 on success, or an error code on failure. 675.Fn crypto_get_driverid 676returns a non-negative value on error, and \-1 on failure. 677.Fn crypto_getreq 678returns a pointer to a 679.Vt cryptop 680structure and 681.Dv NULL 682on failure. 683.Fn crypto_dispatch 684returns 685.Er EINVAL 686if its argument or the callback function was 687.Dv NULL , 688and 0 otherwise. 689The callback is provided with an error code in case of failure, in the 690.Va crp_etype 691field. 692.Sh FILES 693.Bl -tag -width ".Pa sys/opencrypto/crypto.c" 694.It Pa sys/opencrypto/crypto.c 695most of the framework code 696.El 697.Sh SEE ALSO 698.Xr crypto 4 , 699.Xr ipsec 4 , 700.Xr crypto 7 , 701.Xr malloc 9 , 702.Xr sleep 9 703.Sh HISTORY 704The cryptographic framework first appeared in 705.Ox 2.7 706and was written by 707.An Angelos D. Keromytis Aq Mt angelos@openbsd.org . 708.Sh BUGS 709The framework currently assumes that all the algorithms in a 710.Fn crypto_newsession 711operation must be available by the same driver. 712If that is not the case, session initialization will fail. 713.Pp 714The framework also needs a mechanism for determining which driver is 715best for a specific set of algorithms associated with a session. 716Some type of benchmarking is in order here. 717.Pp 718Multiple instances of the same algorithm in the same session are not 719supported. 720Note that 3DES is considered one algorithm (and not three 721instances of DES). 722Thus, 3DES and DES could be mixed in the same request. 723