crypto.c (b59db43ad4434519feb338eacb01d77eb50825c5) | crypto.c (0f751e641a71157aa584c2a2e22fda52b52b8a56) |
---|---|
1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2004 Erez Zadok 5 * Copyright (C) 2001-2004 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 1931 unchanged lines hidden (view full) --- 1940/* 64 characters forming a 6-bit target field */ 1941static unsigned char *portable_filename_chars = ("-.0123456789ABCD" 1942 "EFGHIJKLMNOPQRST" 1943 "UVWXYZabcdefghij" 1944 "klmnopqrstuvwxyz"); 1945 1946/* We could either offset on every reverse map or just pad some 0x00's 1947 * at the front here */ | 1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2004 Erez Zadok 5 * Copyright (C) 2001-2004 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 1931 unchanged lines hidden (view full) --- 1940/* 64 characters forming a 6-bit target field */ 1941static unsigned char *portable_filename_chars = ("-.0123456789ABCD" 1942 "EFGHIJKLMNOPQRST" 1943 "UVWXYZabcdefghij" 1944 "klmnopqrstuvwxyz"); 1945 1946/* We could either offset on every reverse map or just pad some 0x00's 1947 * at the front here */ |
1948static const unsigned char filename_rev_map[] = { | 1948static const unsigned char filename_rev_map[256] = { |
1949 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */ 1950 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 15 */ 1951 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 23 */ 1952 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 31 */ 1953 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 39 */ 1954 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, /* 47 */ 1955 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* 55 */ 1956 0x0A, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 63 */ 1957 0x00, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, /* 71 */ 1958 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, /* 79 */ 1959 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, /* 87 */ 1960 0x23, 0x24, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, /* 95 */ 1961 0x00, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, /* 103 */ 1962 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, /* 111 */ 1963 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, /* 119 */ | 1949 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */ 1950 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 15 */ 1951 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 23 */ 1952 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 31 */ 1953 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 39 */ 1954 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, /* 47 */ 1955 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, /* 55 */ 1956 0x0A, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 63 */ 1957 0x00, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, /* 71 */ 1958 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, /* 79 */ 1959 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, /* 87 */ 1960 0x23, 0x24, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, /* 95 */ 1961 0x00, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, /* 103 */ 1962 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, /* 111 */ 1963 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, /* 119 */ |
1964 0x3D, 0x3E, 0x3F | 1964 0x3D, 0x3E, 0x3F /* 123 - 255 initialized to 0x00 */ |
1965}; 1966 1967/** 1968 * ecryptfs_encode_for_filename 1969 * @dst: Destination location for encoded filename 1970 * @dst_size: Size of the encoded filename in bytes 1971 * @src: Source location for the filename to encode 1972 * @src_size: Size of the source in bytes --- 305 unchanged lines hidden --- | 1965}; 1966 1967/** 1968 * ecryptfs_encode_for_filename 1969 * @dst: Destination location for encoded filename 1970 * @dst_size: Size of the encoded filename in bytes 1971 * @src: Source location for the filename to encode 1972 * @src_size: Size of the source in bytes --- 305 unchanged lines hidden --- |