1 | /*
|
---|
2 | * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
5 | * this file except in compliance with the License. You can obtain a copy
|
---|
6 | * in the file LICENSE in the source distribution or at
|
---|
7 | * https://www.openssl.org/source/license.html
|
---|
8 | */
|
---|
9 |
|
---|
10 | #undef c2l
|
---|
11 | #define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
|
---|
12 | l|=((unsigned long)(*((c)++)))<< 8L, \
|
---|
13 | l|=((unsigned long)(*((c)++)))<<16L, \
|
---|
14 | l|=((unsigned long)(*((c)++)))<<24L)
|
---|
15 |
|
---|
16 | /* NOTE - c is not incremented as per c2l */
|
---|
17 | #undef c2ln
|
---|
18 | #define c2ln(c,l1,l2,n) { \
|
---|
19 | c+=n; \
|
---|
20 | l1=l2=0; \
|
---|
21 | switch (n) { \
|
---|
22 | case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
|
---|
23 | /* fall through */ \
|
---|
24 | case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
|
---|
25 | /* fall through */ \
|
---|
26 | case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
|
---|
27 | /* fall through */ \
|
---|
28 | case 5: l2|=((unsigned long)(*(--(c)))); \
|
---|
29 | /* fall through */ \
|
---|
30 | case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
|
---|
31 | /* fall through */ \
|
---|
32 | case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
|
---|
33 | /* fall through */ \
|
---|
34 | case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
|
---|
35 | /* fall through */ \
|
---|
36 | case 1: l1|=((unsigned long)(*(--(c)))); \
|
---|
37 | } \
|
---|
38 | }
|
---|
39 |
|
---|
40 | #undef l2c
|
---|
41 | #define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
|
---|
42 | *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
|
---|
43 | *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
|
---|
44 | *((c)++)=(unsigned char)(((l)>>24L)&0xff))
|
---|
45 |
|
---|
46 | /* NOTE - c is not incremented as per l2c */
|
---|
47 | #undef l2cn
|
---|
48 | #define l2cn(l1,l2,c,n) { \
|
---|
49 | c+=n; \
|
---|
50 | switch (n) { \
|
---|
51 | case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
|
---|
52 | /* fall through */ \
|
---|
53 | case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
|
---|
54 | /* fall through */ \
|
---|
55 | case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
|
---|
56 | /* fall through */ \
|
---|
57 | case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
|
---|
58 | /* fall through */ \
|
---|
59 | case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
|
---|
60 | /* fall through */ \
|
---|
61 | case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
|
---|
62 | /* fall through */ \
|
---|
63 | case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
|
---|
64 | /* fall through */ \
|
---|
65 | case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
|
---|
66 | } \
|
---|
67 | }
|
---|
68 |
|
---|