mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Merge pull request #128 from ARMmbed/psa-constant_to_string-fix_whitespace
Fix whitespace in psa_constant_names_generated.c
This commit is contained in:
		
						commit
						31aaba8828
					
				@ -71,8 +71,8 @@ static int psa_snprint_algorithm(char *buffer, size_t buffer_size,
 | 
				
			|||||||
    psa_algorithm_t padding_mode = -1;
 | 
					    psa_algorithm_t padding_mode = -1;
 | 
				
			||||||
    psa_algorithm_t alg_without_padding = alg;
 | 
					    psa_algorithm_t alg_without_padding = alg;
 | 
				
			||||||
    if (PSA_ALG_IS_CIPHER(alg) && PSA_ALG_IS_BLOCK_CIPHER(alg)) {
 | 
					    if (PSA_ALG_IS_CIPHER(alg) && PSA_ALG_IS_BLOCK_CIPHER(alg)) {
 | 
				
			||||||
            padding_mode = alg & PSA_ALG_BLOCK_CIPHER_PADDING_MASK;
 | 
					        padding_mode = alg & PSA_ALG_BLOCK_CIPHER_PADDING_MASK;
 | 
				
			||||||
            alg_without_padding = alg & ~PSA_ALG_BLOCK_CIPHER_PADDING_MASK;
 | 
					        alg_without_padding = alg & ~PSA_ALG_BLOCK_CIPHER_PADDING_MASK;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    switch (alg_without_padding) {
 | 
					    switch (alg_without_padding) {
 | 
				
			||||||
    %(algorithm_cases)s
 | 
					    %(algorithm_cases)s
 | 
				
			||||||
@ -120,16 +120,16 @@ static int psa_snprint_key_usage(char *buffer, size_t buffer_size,
 | 
				
			|||||||
'''
 | 
					'''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
key_type_from_curve_template = '''if (%(tester)s(type)) {
 | 
					key_type_from_curve_template = '''if (%(tester)s(type)) {
 | 
				
			||||||
        append_with_curve(&buffer, buffer_size, &required_size,
 | 
					            append_with_curve(&buffer, buffer_size, &required_size,
 | 
				
			||||||
                          "%(builder)s", %(builder_length)s,
 | 
					                              "%(builder)s", %(builder_length)s,
 | 
				
			||||||
                          PSA_KEY_TYPE_GET_CURVE(type));
 | 
					                              PSA_KEY_TYPE_GET_CURVE(type));
 | 
				
			||||||
    } else '''
 | 
					        } else '''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
algorithm_from_hash_template = '''if (%(tester)s(alg_without_padding)) {
 | 
					algorithm_from_hash_template = '''if (%(tester)s(alg_without_padding)) {
 | 
				
			||||||
        append_with_hash(&buffer, buffer_size, &required_size,
 | 
					            append_with_hash(&buffer, buffer_size, &required_size,
 | 
				
			||||||
                         "%(builder)s", %(builder_length)s,
 | 
					                             "%(builder)s", %(builder_length)s,
 | 
				
			||||||
                         PSA_ALG_GET_HASH(alg_without_padding));
 | 
					                             PSA_ALG_GET_HASH(alg_without_padding));
 | 
				
			||||||
    } else '''
 | 
					        } else '''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bit_test_template = '''\
 | 
					bit_test_template = '''\
 | 
				
			||||||
    if (%(var)s & %(flag)s) {
 | 
					    if (%(var)s & %(flag)s) {
 | 
				
			||||||
@ -244,7 +244,7 @@ class MacroCollector:
 | 
				
			|||||||
    def make_key_type_code(self):
 | 
					    def make_key_type_code(self):
 | 
				
			||||||
        d = self.key_types_from_curve
 | 
					        d = self.key_types_from_curve
 | 
				
			||||||
        make = self.make_key_type_from_curve_code
 | 
					        make = self.make_key_type_from_curve_code
 | 
				
			||||||
        return '\n        '.join([make(k, d[k]) for k in sorted(d.keys())])
 | 
					        return ''.join([make(k, d[k]) for k in sorted(d.keys())])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def make_hash_algorithm_cases(self):
 | 
					    def make_hash_algorithm_cases(self):
 | 
				
			||||||
        return '\n    '.join(map(self.make_return_case,
 | 
					        return '\n    '.join(map(self.make_return_case,
 | 
				
			||||||
@ -266,7 +266,7 @@ class MacroCollector:
 | 
				
			|||||||
    def make_algorithm_code(self):
 | 
					    def make_algorithm_code(self):
 | 
				
			||||||
        d = self.algorithms_from_hash
 | 
					        d = self.algorithms_from_hash
 | 
				
			||||||
        make = self.make_algorithm_from_hash_code
 | 
					        make = self.make_algorithm_from_hash_code
 | 
				
			||||||
        return '\n        '.join([make(k, d[k]) for k in sorted(d.keys())])
 | 
					        return ''.join([make(k, d[k]) for k in sorted(d.keys())])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def make_key_usage_code(self):
 | 
					    def make_key_usage_code(self):
 | 
				
			||||||
        return '\n'.join([self.make_bit_test('usage', bit)
 | 
					        return '\n'.join([self.make_bit_test('usage', bit)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user